Shopping cart after order is not empty

  • Posts: 122
  • Thank you received: 2
4 years 2 months ago #314578

Hello, need help.
After the user makes an order, in their shopping cart all ordered items are still inside the shopping cart. How to make, after ordering users shopping cart to be emptied?
Thank you

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 2 months ago #314603

Hi,

Check the setting "clean cart after order is" in the HikaShop configuration. If it's set to "created" then the cart will be emptied directly after the order is created.

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

  • Posts: 122
  • Thank you received: 2
4 years 2 months ago #314625

Hello it is set up to "created". After my test order items are still in a shopping card.
Thank you

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 2 months ago #314631

Hi,

Then the issue is probably that you have several carts assigned to your user account and when you finished the checkout the next cart got loaded.
To do your test, please first delete all the carts of your user account via the Customers>Carts menu. Then, do a checkout of a cart on your website and it should work fine.

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

  • Posts: 168
  • Thank you received: 7
2 years 2 months ago #338634

hi.
I have similar problem but for me , i use mass action for on after order confirmed redirect to some joomla menu. i use this code in Run PHP code box:

$url="index.php?Itemid=337";
JFactory::getApplication()->redirect(
        JRoute::_($url, false)
        );
and when i disable that , the cart empty successfully.
i can set return url in payment method but if user use 100% coupon it is not work.
even i use that code in the plugin but the problem is still and cart not empty.
i write my redirect code at the end of checkout/after_end.php and it is work without problem

Last edit: 2 years 2 months ago by sadaf3d.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
2 years 2 months ago #338644

Hi,

The cart is normally cleared in the controller of the after_end view file. So if you use a mass action to redirect the user somewhere after the order is created/confirmed, you'll skip the after_end controller.
So yes, the solution is indeed to add instead the redirect in the after_end view file, which is displayed just after the after_end controller so that the cart will be cleared before your redirect.

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

  • Posts: 168
  • Thank you received: 7
2 years 2 months ago #338901

excuse me nicolas.
it seems i have mistake. my code not work in after_end.php . i must use my redirect code at the end of end.php. i don't understand their different.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
2 years 2 months ago #338916

Hi,

Normally, the checkout workflow goes like this:

click on "finish" -> order is created -> "end" view file is displayed with the redirect code of the payment plugin to go to the payment page of the payment gateway -> user enter his credit card information and validates -> the user is redirected back to the "after_end" view file -> the cart is cleared in the controller -> the "after_end" view file is displayed with the thank you message.

However, some payment plugins work differently:

click on "finish" -> the payment is processed directly with the credit card information already filled in during the checkout -> order is created -> the cart is cleared in the controller -> the "end" view file is displayed with the thank you message.

And some other payment plugins might have a different behavior, these are just the main ones.

I don't know which payment plugin you're using so I'm not sure what is the situation.

The following user(s) said Thank You: sadaf3d

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

Time to create page: 0.068 seconds
Powered by Kunena Forum