How to update old cart if new session is created?

  • Posts: 64
  • Thank you received: 0
11 years 1 month ago #126019

-- HikaShop version -- : 2.1.1
-- Joomla version -- : 3.0.4 Stable

I am using code to add product into cart.

$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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 1 month ago #126035

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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.045 seconds
Powered by Kunena Forum