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

#   Redirect when checking out

##

- **[twscott](/forum/user/43011-twscott "View twscott's Profile")**
- [![twscott's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/43011-twscott "View twscott's Profile") Topic Author
- [ Offline](/forum/user/43011-twscott)

Less More

- Posts: 252
- Thank you received: 1
-
-
-
-

8 years 8 months ago [\#289882](#289882) by [twscott](/forum/user/43011-twscott "View twscott's Profile")  *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#289882 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")* was created by *[twscott](/forum/user/43011-twscott "View twscott's Profile")*

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.7

Hi,
During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?

Thanks

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

8 years 8 months ago [\#289906](#289906) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#289906 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Hi,

I suppose that you're talking about the "continue shopping" button available in the checkout page.
That button is just a link with the URL you have configured in your HikaShop configuration.

Now, thanks to a view override, you can change how the button is acting and use a include JS code to perform a history back instead.
But that's not something we would recommend since you don't really know from where the customer is coming from and it might not send him to a product listing or product page.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [twscott](/forum/user/43011-twscott "View twscott's Profile")

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

- **[twscott](/forum/user/43011-twscott "View twscott's Profile")**
- [![twscott's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/43011-twscott "View twscott's Profile") Topic Author
- [ Offline](/forum/user/43011-twscott)

Less More

- Posts: 252
- Thank you received: 1
-
-
-
-

8 years 8 months ago [\#289979](#289979) by [twscott](/forum/user/43011-twscott "View twscott's Profile")  Replied by *[twscott](/forum/user/43011-twscott "View twscott's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#289979 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Thanks for your help, I've modified the continue shopping as my user requested.
but there is another request about when user delete all the products in cart while in the checking out page, the system will redirect it to \check\listing page. we were asked to redirect it to a specific page, would you show me which view file should I modify or how o I achieve that?

best regards

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

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile")
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 746
-
- [](http://www.inphase.one)
-

8 years 8 months ago [\#289980](#289980) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#289980 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

> twscott wrote: ... when user delete all the products in cart while in the checking out page, the system will redirect it to \\check\\listing page. we were asked to redirect it to a specific page ...

Hi,

No view needs to be modified for this.
See documentation: [ www.hikashop.com/support/documentation/5...onfig.html#main\_cart](https://www.hikashop.com/support/documentation/54-hikashop-config.html#main_cart)
Field "URL where you will be redirected when the cart is empty"

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

The following user(s) said Thank You: [twscott](/forum/user/43011-twscott "View twscott's Profile")

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

- **[twscott](/forum/user/43011-twscott "View twscott's Profile")**
- [![twscott's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/43011-twscott "View twscott's Profile") Topic Author
- [ Offline](/forum/user/43011-twscott)

Less More

- Posts: 252
- Thank you received: 1
-
-
-
-

8 years 8 months ago [\#290024](#290024) by [twscott](/forum/user/43011-twscott "View twscott's Profile")  Replied by *[twscott](/forum/user/43011-twscott "View twscott's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#290024 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Got it, thanks.
I was asked to redirect to the related products that user just removed from the cart.
So I kept at product ID in session, but I still have problem to redirect the the proper page.
Could you tell me the view file name?

Thanks in advance

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NDE3MC1yZWRpcmVjdC13aGVuLWNoZWNraW5nLW91dD90bXBsPW1hcmtkb3du) 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
-
-

8 years 8 months ago [\#290033](#290033) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#290033 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Hi,

In that case, you want to create a small system plugin which would add some javascript to the header of the pages (or modify your template index.php to add that javascript).
The javascript to use: Code:

if(window.Oby) { window.Oby.registerAjax(["cart.updated","wishlist.updated"],function(params){ window.location = 'URL where to redirect'; return true; } }

The following user(s) said Thank You: [twscott](/forum/user/43011-twscott "View twscott's Profile")

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

- **[twscott](/forum/user/43011-twscott "View twscott's Profile")**
- [![twscott's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/43011-twscott "View twscott's Profile") Topic Author
- [ Offline](/forum/user/43011-twscott)

Less More

- Posts: 252
- Thank you received: 1
-
-
-
-

8 years 8 months ago [\#290104](#290104) by [twscott](/forum/user/43011-twscott "View twscott's Profile")  Replied by *[twscott](/forum/user/43011-twscott "View twscott's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#290104 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Hi,
I put the code into index.php, the result is not expected.
When click on 'buy' button , it jump to the page I specified. and no effect when deleted all the products in cart.
Could you please provide further support?

Best regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NDE3MC1yZWRpcmVjdC13aGVuLWNoZWNraW5nLW91dD90bXBsPW1hcmtkb3du) 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
-
-

8 years 8 months ago [\#290109](#290109) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#290109 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Hi,

Ho sorry, I thought that you wanted to redirect to the related products of the product you added to the cart.

For when the products are deleted, it kind of depends where you're deleting them from.
On the checkout, you will have to also register your javascript to the 'checkout.cart.updated'
Also, you need to have the "checkout legacy" setting turned off in order to use the new checkout of HikaShop 3 or it won't work.

The following user(s) said Thank You: [twscott](/forum/user/43011-twscott "View twscott's Profile")

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

- **[twscott](/forum/user/43011-twscott "View twscott's Profile")**
- [![twscott's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/43011-twscott "View twscott's Profile") Topic Author
- [ Offline](/forum/user/43011-twscott)

Less More

- Posts: 252
- Thank you received: 1
-
-
-
-

8 years 8 months ago [\#290159](#290159) by [twscott](/forum/user/43011-twscott "View twscott's Profile")  Replied by *[twscott](/forum/user/43011-twscott "View twscott's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#290159 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Thanks Nicolas,
My problem is almost solved but I need to know weather the cart is empty or not.
The params passed in did not have enough content the intimation.

Thanks in advance.
Best regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NDE3MC1yZWRpcmVjdC13aGVuLWNoZWNraW5nLW91dD90bXBsPW1hcmtkb3du) 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
-
-

8 years 8 months ago [\#290170](#290170) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#290170 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Hi,

The params parameter should contain a parameter empty with the value true when the cart is empty.

The following user(s) said Thank You: [twscott](/forum/user/43011-twscott "View twscott's Profile")

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

- **[twscott](/forum/user/43011-twscott "View twscott's Profile")**
- [![twscott's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/43011-twscott "View twscott's Profile") Topic Author
- [ Offline](/forum/user/43011-twscott)

Less More

- Posts: 252
- Thank you received: 1
-
-
-
-

8 years 7 months ago [\#290571](#290571) by [twscott](/forum/user/43011-twscott "View twscott's Profile")  Replied by *[twscott](/forum/user/43011-twscott "View twscott's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#290571 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Hi,
Sorry but I still have trouble redirect the page when cart is empty.

Following is the code I put into index.php :
$document-&gt;addScriptDeclaration('
if(window.Oby) {
window.Oby.registerAjax(["checkout.cart.updated"],function(params){
alert(JSON.stringify(params));
document.location.href="[ www.google.com](http://www.google.com)";
return true;
})
}
');

There are two issues here:
1.
I can see the params is the alert message is like :
{"src":{"step":1,"workflow_step":0,"pos":0}}
dose the "pos" is the count of products in cart?

2. after the alert message, I redirect the page to [ www.google.com](http://www.google.com)
but it actually goto /index.php/checkout/product/listing
What should I do to rediect it to the proper page?

Thanks in advance
Best regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NDE3MC1yZWRpcmVjdC13aGVuLWNoZWNraW5nLW91dD90bXBsPW1hcmtkb3du) 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
-
-

8 years 7 months ago [\#290592](#290592) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Redirect when checking out](/forum/27-checkout/894170-redirect-when-checking-out#290592 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.7  Hi, During checking out, when user click on Continue shopping button and the same situation but when user remove all the products in cart, we want ti to redirect to the previous page, Could you show me a way to achieve that?  Thanks")*

Hi,

the pos parameter indicates the position of the view which did the triggering in the current step. So if you have 0 there, it indicates that you used the cart view placed in the first position of your checkout step.

That's because you must be deleting the last product. In that case, the system redirects to the URL you specified in the "URL where to redirect when the cart is empty" setting of the Hikashop configuration. If you get "/index.php/checkout/product/listing" it means that you must have left that setting empty as that's the default URL where the customer is redirected to upon deleting the last product of his cart.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NDE3MC1yZWRpcmVjdC13aGVuLWNoZWNraW5nLW91dD90bXBsPW1hcmtkb3du) 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.111 seconds

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