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

#   redirect to page after adding to cart

##

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

Less More

- Posts: 4
- Thank you received: 0
-
-

6 years 7 months ago [\#317335](#317335) by [djtim](/forum/user/35704-djtim "View djtim's Profile")  *[redirect to page after adding to cart](/forum/27-checkout/899514-redirect-to-page-after-adding-to-cart#317335 "-- HikaShop version -- : 4.2.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.2.1 -- Browser(s) name and version -- : chrome  I want to redirect to a specific page after adding something to the shopping cart. In the forum i found this: window.localPage.cartRedirect = function(cid,pid,resp){window.location=&quot;URL&#95;WHERE&#95;TO&#95;REDIRECT&#95;AFTER&#95;ADD&#95;TO&#95;CART&quot;;};  I tried this but it is not redirecting. Can someone help me please?")* was created by *[djtim](/forum/user/35704-djtim "View djtim's Profile")*

-- HikaShop version -- : 4.2.3
-- Joomla version -- : 3.9.16
-- PHP version -- : 7.2.1
-- Browser(s) name and version -- : chrome

I want to redirect to a specific page after adding something to the shopping cart. In the forum i found this:
window.localPage.cartRedirect = function(cid,pid,resp){window.location="URL_WHERE_TO_REDIRECT_AFTER_ADD_TO_CART";};

I tried this but it is not redirecting. Can someone help me please?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5OTUxNC1yZWRpcmVjdC10by1wYWdlLWFmdGVyLWFkZGluZy10by1jYXJ0P3RtcGw9bWFya2Rvd24=) 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 7 months ago [\#317337](#317337) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[redirect to page after adding to cart](/forum/27-checkout/899514-redirect-to-page-after-adding-to-cart#317337 "-- HikaShop version -- : 4.2.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.2.1 -- Browser(s) name and version -- : chrome  I want to redirect to a specific page after adding something to the shopping cart. In the forum i found this: window.localPage.cartRedirect = function(cid,pid,resp){window.location=&quot;URL&#95;WHERE&#95;TO&#95;REDIRECT&#95;AFTER&#95;ADD&#95;TO&#95;CART&quot;;};  I tried this but it is not redirecting. Can someone help me please?")*

Hi,

This code is indeed correct.
Where are you adding it ? could you do a screenshot ?

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

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

Less More

- Posts: 4
- Thank you received: 0
-
-

6 years 7 months ago [\#317355](#317355) by [djtim](/forum/user/35704-djtim "View djtim's Profile")  Replied by *[djtim](/forum/user/35704-djtim "View djtim's Profile")* on topic *[redirect to page after adding to cart](/forum/27-checkout/899514-redirect-to-page-after-adding-to-cart#317355 "-- HikaShop version -- : 4.2.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.2.1 -- Browser(s) name and version -- : chrome  I want to redirect to a specific page after adding something to the shopping cart. In the forum i found this: window.localPage.cartRedirect = function(cid,pid,resp){window.location=&quot;URL&#95;WHERE&#95;TO&#95;REDIRECT&#95;AFTER&#95;ADD&#95;TO&#95;CART&quot;;};  I tried this but it is not redirecting. Can someone help me please?")*

[ ![pagesource.PNG](/forum/attachment/49035) ](/forum/attachment/49035 "pagesource.PNG")

[ ![screenshotyootheme.PNG](/forum/attachment/49036) ](/forum/attachment/49036 "...otyootheme.PNG")

thanks for the response!

- [ ![pagesource.PNG](/forum/attachment/49035) ](/forum/attachment/49035 "pagesource.PNG") [ ](/forum/attachment/49035?download=1 "pagesource.PNG")
- [ ![screenshotyootheme.PNG](/forum/attachment/49036) ](/forum/attachment/49036 "...otyootheme.PNG") [ ](/forum/attachment/49036?download=1 "...otyootheme.PNG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5OTUxNC1yZWRpcmVjdC10by1wYWdlLWFmdGVyLWFkZGluZy10by1jYXJ0P3RtcGw9bWFya2Rvd24=) 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 7 months ago [\#317357](#317357) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[redirect to page after adding to cart](/forum/27-checkout/899514-redirect-to-page-after-adding-to-cart#317357 "-- HikaShop version -- : 4.2.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.2.1 -- Browser(s) name and version -- : chrome  I want to redirect to a specific page after adding something to the shopping cart. In the forum i found this: window.localPage.cartRedirect = function(cid,pid,resp){window.location=&quot;URL&#95;WHERE&#95;TO&#95;REDIRECT&#95;AFTER&#95;ADD&#95;TO&#95;CART&quot;;};  I tried this but it is not redirecting. Can someone help me please?")*

Hi,

Your code is not valid. You're missing a double quote at the end of the URL. This makes your javascript not run.
You should normally see an error in your browser's console log on that page pointing at that.
I suppose that's why it doesn't work for you.

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

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

Less More

- Posts: 4
- Thank you received: 0
-
-

6 years 7 months ago -  6 years 7 months ago [\#317363](#317363) by [djtim](/forum/user/35704-djtim "View djtim's Profile")  Replied by *[djtim](/forum/user/35704-djtim "View djtim's Profile")* on topic *[redirect to page after adding to cart](/forum/27-checkout/899514-redirect-to-page-after-adding-to-cart#317363 "-- HikaShop version -- : 4.2.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.2.1 -- Browser(s) name and version -- : chrome  I want to redirect to a specific page after adding something to the shopping cart. In the forum i found this: window.localPage.cartRedirect = function(cid,pid,resp){window.location=&quot;URL&#95;WHERE&#95;TO&#95;REDIRECT&#95;AFTER&#95;ADD&#95;TO&#95;CART&quot;;};  I tried this but it is not redirecting. Can someone help me please?")*

Sorry that was my mistake. I tested it acouple of times today and i made an error bij pasting it. Now it has double quotes and still not working. Code:

&lt;script&gt;try { window.localPage.cartRedirect = function(cid,pid,resp){window.location="https://www.w3schools.com";}; } catch (e) { console.error('Custom Theme JS Code: ', e); }&lt;/script&gt;

Last edit: 6 years 7 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5OTUxNC1yZWRpcmVjdC10by1wYWdlLWFmdGVyLWFkZGluZy10by1jYXJ0P3RtcGw9bWFya2Rvd24=) 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 7 months ago [\#317364](#317364) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[redirect to page after adding to cart](/forum/27-checkout/899514-redirect-to-page-after-adding-to-cart#317364 "-- HikaShop version -- : 4.2.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.2.1 -- Browser(s) name and version -- : chrome  I want to redirect to a specific page after adding something to the shopping cart. In the forum i found this: window.localPage.cartRedirect = function(cid,pid,resp){window.location=&quot;URL&#95;WHERE&#95;TO&#95;REDIRECT&#95;AFTER&#95;ADD&#95;TO&#95;CART&quot;;};  I tried this but it is not redirecting. Can someone help me please?")*

Hi,

Ok, I checked on your link. You need to deactivate the cart notification plugin via the Joomla plugins manager.
The cartRedirect function is only called if there is no JS to handle the add to cart (to display a popup or a notification box or do something else). It's a bit of a failsafe.

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

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

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