• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.