Empty cart redirect

  • Posts: 32
  • Thank you received: 1
4 years 1 week ago #325876

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.22
-- PHP version -- : 7.4

Currently when the cart is empty and a user (for example) clicks the Carts button from the cpanel, they're taken to /product/listing and a message is shown at the top to say the cart is empty.

How can I change this so that the message appears at the top of the current screen (wherever that is) but there's no redirect?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 1 week ago #325907

Hi,

You can try to change the line:
$this->setRedirect($checkoutHelper->getRedirectUrl($override), JText::_('CART_EMPTY'));
to:
$app->enqueueMessage(JText::_('CART_EMPTY'));
in the file components/com_hikashop/controllers/cart.php

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

  • Posts: 32
  • Thank you received: 1
3 years 11 months ago #326427

Hi Nicolas. That almost worked thanks :)

The only problem is when cancelling once you get to the Paypal screen, where it again sends you back to product/listing. Is there a way to send the user to the homepage from cancelling paypal?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 11 months ago #326434

Hi,

No. However, I would recommend to change the "Clean cart when order is" setting to "confirmed" in the HikaShop configuration.
That, way if you cancel the payment on paypal, you'll go back to the checkout as you'll still have the cart available.
I believe it's better for the customer.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum