Welcome Guest, Not a member yet? Register   Sign In
2 or More Different Cart
#1

Can I have 2 different carts in CodeIgniter?
Because I am using cart for Product Orders, and I will be using another cart for Product Returns. I want to specify the different carts so that there will be different sessions. How can I specify the specific each cart?

I don't want the "Return Cart" will show the data of "Orders Cart", since they will definitely have the same session. That is why I wanted to specify the Carts so that the session data will differ.

I hope anyone can help
Reply
#2

(This post was last modified: 08-12-2015, 03:26 AM by Wouter60.)

It should work if you create 2 instances of the shopping cart class:

PHP Code:
$this->load->library'cart''''product_orders' );
$this->load->library'cart''''product_returns' );

$this->product_orders->...
$this->product_returns->... 
Reply
#3

Hi,

"The Cart library is DEPRECATED and should not be used. It is currently only kept for backwards compatibility."

Just thought it might help to mention that. If you write your own cart you can easily have two, although I would have one cart per session and use an identifier to distinguish between a sale or a return. You can then use the data however you wish.

I use a temp_cart table linking the session to the cart. A clean up procedure keeps the table small, removing carts with expired sessions if need be.

Best wishes,

Paul.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB