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

#   add to cart and redirect to custom page \[solved\]

##

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

Less More

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

14 years 6 months ago -  14 years 6 months ago [\#48848](#48848) by [futureknight](/forum/user/7291-futureknight "View futureknight's Profile")  *[add to cart and redirect to custom page \[solved\]](/forum/4-how-to/48848-add-to-cart-and-redirect-to-custom-page-solved#48848 "Hey,  Do you have a tip on how I can solve this?  on my main page are 3 images. when I click on one of those it adds a specific product to the cart and redirects me to a custom url.  for example:  Click on Image &quot;A&quot; it adds product &quot;1&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;B&quot; it adds product &quot;2&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;C&quot; it adds product &quot;3&quot; to the cart and redirects me to &quot;category xyz001&quot;  &quot;category xyz001&quot; is a specific link with new products listed when I click on &quot;add to cart&quot; of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)  thx i really love hika. it is well made!")* was created by *[futureknight](/forum/user/7291-futureknight "View futureknight's Profile")*

Hey,

Do you have a tip on how I can solve this?

on my main page are 3 images.
when I click on one of those it adds a specific product to the cart and redirects me to a custom url.

for example:

Click on Image "A" it adds product "1" to the cart and redirects me to "category xyz001"
Click on Image "B" it adds product "2" to the cart and redirects me to "category xyz001"
Click on Image "C" it adds product "3" to the cart and redirects me to "category xyz001"

"category xyz001" is a specific link with new products listed when I click on "add to cart" of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)

thx
i really love hika. it is well made!

Last edit: 14 years 6 months ago by [futureknight](/forum/user/7291-futureknight "View futureknight's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ4ODQ4LWFkZC10by1jYXJ0LWFuZC1yZWRpcmVjdC10by1jdXN0b20tcGFnZS1zb2x2ZWQ/dG1wbD1tYXJrZG93bg==) 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: 86359
- Thank you received: 14296
-
-

14 years 6 months ago [\#48871](#48871) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: add to cart and redirect to custom page](/forum/4-how-to/48848-add-to-cart-and-redirect-to-custom-page-solved#48871 "Hey,  Do you have a tip on how I can solve this?  on my main page are 3 images. when I click on one of those it adds a specific product to the cart and redirects me to a custom url.  for example:  Click on Image &quot;A&quot; it adds product &quot;1&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;B&quot; it adds product &quot;2&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;C&quot; it adds product &quot;3&quot; to the cart and redirects me to &quot;category xyz001&quot;  &quot;category xyz001&quot; is a specific link with new products listed when I click on &quot;add to cart&quot; of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)  thx i really love hika. it is well made!")*

In your products, you have an "add to cart HTML button" button that you can click on in order to get the HTML to use for the add to cart of that product.
It will add the product and redirect to the checkout by default.
In order to redirect somewhere else, you will have to remove the checkout=1 parameter from the URL and instead add a parameter return_url=XXX where XXX is the base64_encoded URL of your category listing.

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

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

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

Less More

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

14 years 6 months ago [\#48889](#48889) by [futureknight](/forum/user/7291-futureknight "View futureknight's Profile")  Replied by *[futureknight](/forum/user/7291-futureknight "View futureknight's Profile")* on topic *[Re: add to cart and redirect to custom page](/forum/4-how-to/48848-add-to-cart-and-redirect-to-custom-page-solved#48889 "Hey,  Do you have a tip on how I can solve this?  on my main page are 3 images. when I click on one of those it adds a specific product to the cart and redirects me to a custom url.  for example:  Click on Image &quot;A&quot; it adds product &quot;1&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;B&quot; it adds product &quot;2&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;C&quot; it adds product &quot;3&quot; to the cart and redirects me to &quot;category xyz001&quot;  &quot;category xyz001&quot; is a specific link with new products listed when I click on &quot;add to cart&quot; of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)  thx i really love hika. it is well made!")*

thanks it works!

return_url=XXX was the missing piece.

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

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

Less More

- Posts: 65
- Thank you received: 0
-
-

14 years 4 months ago [\#56785](#56785) by [soheilom](/forum/user/4248-soheilom "View soheilom's Profile")  Replied by *[soheilom](/forum/user/4248-soheilom "View soheilom's Profile")* on topic *[Re: add to cart and redirect to custom page](/forum/4-how-to/48848-add-to-cart-and-redirect-to-custom-page-solved#56785 "Hey,  Do you have a tip on how I can solve this?  on my main page are 3 images. when I click on one of those it adds a specific product to the cart and redirects me to a custom url.  for example:  Click on Image &quot;A&quot; it adds product &quot;1&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;B&quot; it adds product &quot;2&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;C&quot; it adds product &quot;3&quot; to the cart and redirects me to &quot;category xyz001&quot;  &quot;category xyz001&quot; is a specific link with new products listed when I click on &quot;add to cart&quot; of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)  thx i really love hika. it is well made!")*

Hello I have a similar problem but return_url(to base64_encoded URL of your category listing) doesnt seem to work for me.
I basically added an HTML Add to cart button to one of my product description pages and what I want is to stay on the current page when add to cart is clicked. So in this case what do I put in return_url??

Thank you for your help.

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

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

Less More

- Posts: 65
- Thank you received: 0
-
-

14 years 4 months ago [\#56786](#56786) by [soheilom](/forum/user/4248-soheilom "View soheilom's Profile")  Replied by *[soheilom](/forum/user/4248-soheilom "View soheilom's Profile")* on topic *[Re: add to cart and redirect to custom page](/forum/4-how-to/48848-add-to-cart-and-redirect-to-custom-page-solved#56786 "Hey,  Do you have a tip on how I can solve this?  on my main page are 3 images. when I click on one of those it adds a specific product to the cart and redirects me to a custom url.  for example:  Click on Image &quot;A&quot; it adds product &quot;1&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;B&quot; it adds product &quot;2&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;C&quot; it adds product &quot;3&quot; to the cart and redirects me to &quot;category xyz001&quot;  &quot;category xyz001&quot; is a specific link with new products listed when I click on &quot;add to cart&quot; of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)  thx i really love hika. it is well made!")*

Just one more thing, I have added a return-url to my add to cart module, like this
&lt;a href="/tempweb/component/hikashop/product/updatecart/quantity-1/return_url=index.php?option=com_content&amp;view=article&amp;id=19/cid-2/return_url-index.php?option=com_content&amp;view=article&amp;id=19" class="addcart"&gt; &lt;strong&gt;Add to cart&lt;/strong&gt; &lt;/a&gt;

and it does redirect to the correct page, but it doesnt add the product to the cart??
please help.

thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ4ODQ4LWFkZC10by1jYXJ0LWFuZC1yZWRpcmVjdC10by1jdXN0b20tcGFnZS1zb2x2ZWQ/dG1wbD1tYXJrZG93bg==) 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: 86359
- Thank you received: 14296
-
-

14 years 4 months ago [\#56820](#56820) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: add to cart and redirect to custom page](/forum/4-how-to/48848-add-to-cart-and-redirect-to-custom-page-solved#56820 "Hey,  Do you have a tip on how I can solve this?  on my main page are 3 images. when I click on one of those it adds a specific product to the cart and redirects me to a custom url.  for example:  Click on Image &quot;A&quot; it adds product &quot;1&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;B&quot; it adds product &quot;2&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;C&quot; it adds product &quot;3&quot; to the cart and redirects me to &quot;category xyz001&quot;  &quot;category xyz001&quot; is a specific link with new products listed when I click on &quot;add to cart&quot; of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)  thx i really love hika. it is well made!")*

You need to base64_encode the return URL...You can't just put it in the add to cart URL link that.

Here is a base64_encoder:
[ www.motobit.com/util/base64-decoder-encoder.asp](http://www.motobit.com/util/base64-decoder-encoder.asp)

If you put index.php?option=com_content&amp;view=article&amp;id=19 in it, you get:
aW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZ2aWV3PWFydGljbGUmaWQ9MTk=

You actually also have to URL encode that because of the = character which cannot be used directly in the URL. Here is a tool for that:
[ www.string-functions.com/urlencode.aspx](http://www.string-functions.com/urlencode.aspx)
So you get that:
aW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZ2aWV3PWFydGljbGUmaWQ9MTk%3d

Thus, your link should be:
&lt;a href="/tempweb/component/hikashop/product/updatecart/quantity-1/return_url=index.php?option=com_content&amp;view=article&amp;id=19/cid-2/return_url-aW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZ2aWV3PWFydGljbGUmaWQ9MTk%3d" class="addcart"&gt; &lt;strong&gt;Add to cart&lt;/strong&gt; &lt;/a&gt;

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

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

Less More

- Posts: 44
- Thank you received: 1
-
-

13 years 1 month ago [\#126823](#126823) by [PhilP](/forum/user/5076-philp "View PhilP's Profile")  Replied by *[PhilP](/forum/user/5076-philp "View PhilP's Profile")* on topic *[Re: add to cart and redirect to custom page](/forum/4-how-to/48848-add-to-cart-and-redirect-to-custom-page-solved#126823 "Hey,  Do you have a tip on how I can solve this?  on my main page are 3 images. when I click on one of those it adds a specific product to the cart and redirects me to a custom url.  for example:  Click on Image &quot;A&quot; it adds product &quot;1&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;B&quot; it adds product &quot;2&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;C&quot; it adds product &quot;3&quot; to the cart and redirects me to &quot;category xyz001&quot;  &quot;category xyz001&quot; is a specific link with new products listed when I click on &quot;add to cart&quot; of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)  thx i really love hika. it is well made!")*

Hi Nicolas,
I have followed this topic and used it successfully on our own site.
However, some of our products consist of a main product with options and/or variants.

When a customer orders, the transaction shows up in the back end order report as typically) two distinct items i.e. the main product itself + the option/variant.

Is it possible to somehow modify or concatenate the 'add to cart' html string so that two products get added to the cart when that link is activated? In our case, that would be the main product itself plus its option/variant.

Regards
PhilP

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 1 month ago [\#126925](#126925) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: add to cart and redirect to custom page](/forum/4-how-to/48848-add-to-cart-and-redirect-to-custom-page-solved#126925 "Hey,  Do you have a tip on how I can solve this?  on my main page are 3 images. when I click on one of those it adds a specific product to the cart and redirects me to a custom url.  for example:  Click on Image &quot;A&quot; it adds product &quot;1&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;B&quot; it adds product &quot;2&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;C&quot; it adds product &quot;3&quot; to the cart and redirects me to &quot;category xyz001&quot;  &quot;category xyz001&quot; is a specific link with new products listed when I click on &quot;add to cart&quot; of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)  thx i really love hika. it is well made!")*

Hi,

I think that what you need is to enable the option "Group options with product" in Configuration &gt; Main &gt; Cart.
This will display only one item with its options.

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

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

Less More

- Posts: 44
- Thank you received: 1
-
-

13 years 1 month ago [\#126937](#126937) by [PhilP](/forum/user/5076-philp "View PhilP's Profile")  Replied by *[PhilP](/forum/user/5076-philp "View PhilP's Profile")* on topic *[Re: add to cart and redirect to custom page](/forum/4-how-to/48848-add-to-cart-and-redirect-to-custom-page-solved#126937 "Hey,  Do you have a tip on how I can solve this?  on my main page are 3 images. when I click on one of those it adds a specific product to the cart and redirects me to a custom url.  for example:  Click on Image &quot;A&quot; it adds product &quot;1&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;B&quot; it adds product &quot;2&quot; to the cart and redirects me to &quot;category xyz001&quot; Click on Image &quot;C&quot; it adds product &quot;3&quot; to the cart and redirects me to &quot;category xyz001&quot;  &quot;category xyz001&quot; is a specific link with new products listed when I click on &quot;add to cart&quot; of on of the products on this page should not redirect anywhere. (actually everything in this last sentence is already working.)  thx i really love hika. it is well made!")*

Hi Xavier,
Yes, that is already enabled.
In the meantime, I think I have thought of another way of achieving what I want. I'll try it but if I still have problems I'll come back to you.
Thanks for your help anyway.
Regards
PhilP

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

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