No Cart Found When Last Item is Deleted

  • Posts: 109
  • Thank you received: 5
9 years 11 months ago #184034

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6

Hello, there.

Good evening!

Hikashop mistakenly displays a no cart found item when the last item is deleted from the cart/showcart.php view.

This requires a menu item to display the cart in the cart/showcart view.

The following sequence is required to produce the error:

a) add a product to the cart
b) log out
c) log back in
d) go to cart/showcart via the menu link
e) remove the product(s) until the cart is empty

The system then displays the "No cart found" message (please see attached).

Note - this message does not appear when the user does not log out and log back in between adding the products and deleting the products from the cart. I.e. when the following sequence is used, the message does not appear (which is the correct behaviour):
i) add a product
ii) go to cart/showcart via the menu link
iii) remove the product(s) until the cart is empty

I suspect that the Cart details are not full repopulated upon log in.

Please could you let me know how to fix this problem?

Thanks.

Take care!

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
9 years 11 months ago #184093

Hi,

This is a session issue, while in the session the cart is kept even if it's empty.
But as soon as you log out, so there is no more cart stored in session so when loggin back it display the message because there is indeed no more cart attached to the customer.

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

  • Posts: 109
  • Thank you received: 5
9 years 11 months ago #184095

Thanks, Xavier.

I can't make sense of your response in light of the configuration, though. You mentioned that this is a session issue and that "as soon as you log out, so there is no more cart stored in session". However, in Hikashop we can configure the Cart retaining period to x number of days. Hence, when we log out and log back in, Hikashop remembers the items that have been ordered but not yet confirmed.

It just seems that Hikashop retains some information but not the cart ID (which I think is the most important bit of info).

Please could you shed some more light on this?

Thanks.

Take care!

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

  • Posts: 13201
  • Thank you received: 2322
9 years 11 months ago #184099

Hmmm in the showcart view, we get the cart id from the session as in any other views.
More debug on the showcart function of the "components/com_hikashop/views/cart/view.html.php" file will be required.

Checks near the line:

		$cart_id = JRequest::getInt('cart_id','');
		if(empty($cart_id) || $cart_id == 0){
			$cart_id = $app->getUserState( HIKASHOP_COMPONENT.'.'.$cart_type.'_id', 0, 'int' );
			if($cart_id == 0){

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

Time to create page: 0.070 seconds
Powered by Kunena Forum