[Skip to main content](#vessel-content)

#   Empty cart redirect

##

- **[jeffmcbiscuit](/forum/user/60250-jeffmcbiscuit "View jeffmcbiscuit's Profile")**
- [![jeffmcbiscuit's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/60250-jeffmcbiscuit "View jeffmcbiscuit's Profile") Topic Author
- [ Offline](/forum/user/60250-jeffmcbiscuit)

Less More

- Posts: 32
- Thank you received: 1
-
-

6 years 2 weeks ago [\#325876](#325876) by [jeffmcbiscuit](/forum/user/60250-jeffmcbiscuit "View jeffmcbiscuit's Profile")  *[Empty cart redirect](/forum/27-checkout/901207-empty-cart-redirect#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?")* was created by *[jeffmcbiscuit](/forum/user/60250-jeffmcbiscuit "View jeffmcbiscuit's Profile")*

-- 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTIwNy1lbXB0eS1jYXJ0LXJlZGlyZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

6 years 2 weeks ago [\#325907](#325907) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Empty cart redirect](/forum/27-checkout/901207-empty-cart-redirect#325907 "-- 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?")*

Hi,

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTIwNy1lbXB0eS1jYXJ0LXJlZGlyZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jeffmcbiscuit](/forum/user/60250-jeffmcbiscuit "View jeffmcbiscuit's Profile")**
- [![jeffmcbiscuit's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/60250-jeffmcbiscuit "View jeffmcbiscuit's Profile") Topic Author
- [ Offline](/forum/user/60250-jeffmcbiscuit)

Less More

- Posts: 32
- Thank you received: 1
-
-

6 years 5 days ago [\#326427](#326427) by [jeffmcbiscuit](/forum/user/60250-jeffmcbiscuit "View jeffmcbiscuit's Profile")  Replied by *[jeffmcbiscuit](/forum/user/60250-jeffmcbiscuit "View jeffmcbiscuit's Profile")* on topic *[Empty cart redirect](/forum/27-checkout/901207-empty-cart-redirect#326427 "-- 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?")*

Hi Nicolas. That almost worked thanks ![:)](/media/kunena/emoticons/3.png ":)")

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTIwNy1lbXB0eS1jYXJ0LXJlZGlyZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

6 years 5 days ago [\#326434](#326434) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Empty cart redirect](/forum/27-checkout/901207-empty-cart-redirect#326434 "-- 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?")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTIwNy1lbXB0eS1jYXJ0LXJlZGlyZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.070 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
