- Posts: 64
- Thank you received: 0
How to update old cart if new session is created?
- irfanhanfi
-
Topic Author
- Offline
Less
More
12 years 11 months ago #126019
by irfanhanfi
How to update old cart if new session is created? was created by irfanhanfi
-- HikaShop version -- : 2.1.1
-- Joomla version -- : 3.0.4 Stable
I am using code to add product into cart.
This works fine if login session and cart session is same.If meanwhile user session is expired and after login if we edit one of the product of cart it creates new cart.Is there any way to solve this? What I need is to save some data in cart table.It remains untill I edit product.once I delete newly added cart product old one appears and this starts working fine.
Thanks,
-- Joomla version -- : 3.0.4 Stable
I am using code to add product into cart.
Code:
$cartClass = hikashop_get('class.cart');
$productsArray = $cartClass->get();
$cartClass->update($productId,$latestQuantity);
This works fine if login session and cart session is same.If meanwhile user session is expired and after login if we edit one of the product of cart it creates new cart.Is there any way to solve this? What I need is to save some data in cart table.It remains untill I edit product.once I delete newly added cart product old one appears and this starts working fine.
Thanks,
Please Log in or Create an account to join the conversation.
12 years 11 months ago #126035
by nicolas
Replied by nicolas on topic How to update old cart if new session is created?
I don't see why it would create a new cart if you edit a product of the cart ?
The user session expiring or not shouldn't change that behavior. When a user login and doesn't have a cart, his last cart is brought up automatically from the database.
The user session expiring or not shouldn't change that behavior. When a user login and doesn't have a cart, his last cart is brought up automatically from the database.
Please Log in or Create an account to join the conversation.
Time to create page: 0.146 seconds