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

#   Add to cart not working from product show view

##

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

Less More

- Posts: 86
- Thank you received: 0
-
-

15 years 8 months ago [\#9142](#9142) by [YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")  *[Add to cart not working from product show view](/forum/4-how-to/9142-add-to-cart-not-working-from-product-show-view#9142 "Hi Nicolas,  I'm using the following code in my product show view:    orm action=&quot;&amp;lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&amp;gt;&quot; method=&quot;post&quot; name=&quot;hikashop&#95;product&#95;form&#95;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name'); ?&gt;&quot;&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt; input type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;row-&gt;product&#95;id; ?&gt;&quot; /&gt;      When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?  Gert.")* was created by *[YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")*

Hi Nicolas,

I'm using the following code in my product show view:

&lt;!-- BUY NOW--&gt;
&lt;span id="hikashop_product_quantity_main" class="hikashop_product_quantity_main" &gt;
&lt;form action="&lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&gt;" method="post" name="hikashop_product_form_&lt;?php echo $this-&gt;row-&gt;product_id.'_'.$this-&gt;params-&gt;get('main_div_name'); ?&gt;"&gt;&lt;?php
$this-&gt;setLayout('quantity');
echo $this-&gt;loadTemplate();
?&gt;
&lt;input type="hidden" name="product_id" value="&lt;?php echo $this-&gt;row-&gt;product_id; ?&gt;" /&gt;
&lt;input type="hidden" name="add" value="1"/&gt;
&lt;input type="hidden" name="ctrl" value="product"/&gt;
&lt;input type="hidden" name="task" value="updatecart"/&gt;
&lt;/form&gt;&lt;?php
?&gt;

When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?

Gert.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkxNDItYWRkLXRvLWNhcnQtbm90LXdvcmtpbmctZnJvbS1wcm9kdWN0LXNob3ctdmlldz90bXBsPW1hcmtkb3du) 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: 86561
- Thank you received: 14307
-
-

15 years 8 months ago [\#9151](#9151) 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 not working from product show view](/forum/4-how-to/9142-add-to-cart-not-working-from-product-show-view#9151 "Hi Nicolas,  I'm using the following code in my product show view:    orm action=&quot;&amp;lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&amp;gt;&quot; method=&quot;post&quot; name=&quot;hikashop&#95;product&#95;form&#95;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name'); ?&gt;&quot;&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt; input type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;row-&gt;product&#95;id; ?&gt;&quot; /&gt;      When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?  Gert.")*

In the config, under the tab checkout (or display if you don't have the latest version), you have the option "After a product is added to the cart" where you can select what hikashop should do when you press "add to cart". Please make sure that this option is set to "always go to the checkout".

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

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

Less More

- Posts: 86
- Thank you received: 0
-
-

15 years 8 months ago [\#9153](#9153) by [YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")  Replied by *[YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")* on topic *[Re: Add to cart not working from product show view](/forum/4-how-to/9142-add-to-cart-not-working-from-product-show-view#9153 "Hi Nicolas,  I'm using the following code in my product show view:    orm action=&quot;&amp;lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&amp;gt;&quot; method=&quot;post&quot; name=&quot;hikashop&#95;product&#95;form&#95;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name'); ?&gt;&quot;&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt; input type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;row-&gt;product&#95;id; ?&gt;&quot; /&gt;      When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?  Gert.")*

It is set like that already. But it's not working, not even when I change back to the unmodified view.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkxNDItYWRkLXRvLWNhcnQtbm90LXdvcmtpbmctZnJvbS1wcm9kdWN0LXNob3ctdmlldz90bXBsPW1hcmtkb3du) 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: 86561
- Thank you received: 14307
-
-

15 years 8 months ago [\#9155](#9155) 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 not working from product show view](/forum/4-how-to/9142-add-to-cart-not-working-from-product-show-view#9155 "Hi Nicolas,  I'm using the following code in my product show view:    orm action=&quot;&amp;lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&amp;gt;&quot; method=&quot;post&quot; name=&quot;hikashop&#95;product&#95;form&#95;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name'); ?&gt;&quot;&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt; input type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;row-&gt;product&#95;id; ?&gt;&quot; /&gt;      When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?  Gert.")*

Could you give a back end access to your website so that we can check the problem ?

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

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

Less More

- Posts: 86
- Thank you received: 0
-
-

15 years 8 months ago [\#9164](#9164) by [YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")  Replied by *[YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")* on topic *[Re: Add to cart not working from product show view](/forum/4-how-to/9142-add-to-cart-not-working-from-product-show-view#9164 "Hi Nicolas,  I'm using the following code in my product show view:    orm action=&quot;&amp;lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&amp;gt;&quot; method=&quot;post&quot; name=&quot;hikashop&#95;product&#95;form&#95;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name'); ?&gt;&quot;&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt; input type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;row-&gt;product&#95;id; ?&gt;&quot; /&gt;      When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?  Gert.")*

Hi Nicolas,

Just send the details to you through your contact us form.

Gert.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkxNDItYWRkLXRvLWNhcnQtbm90LXdvcmtpbmctZnJvbS1wcm9kdWN0LXNob3ctdmlldz90bXBsPW1hcmtkb3du) 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: 86561
- Thank you received: 14307
-
-

15 years 8 months ago [\#9166](#9166) 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 not working from product show view](/forum/4-how-to/9142-add-to-cart-not-working-from-product-show-view#9166 "Hi Nicolas,  I'm using the following code in my product show view:    orm action=&quot;&amp;lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&amp;gt;&quot; method=&quot;post&quot; name=&quot;hikashop&#95;product&#95;form&#95;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name'); ?&gt;&quot;&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt; input type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;row-&gt;product&#95;id; ?&gt;&quot; /&gt;      When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?  Gert.")*

We changed the whole add to cart system in the last few releases so that it works with the custom item fields and other features we added. Since you bases your modifications on the 1.4.0 code, the redirection didn't work. I've changed a bit your code so that it still works.

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

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

Less More

- Posts: 86
- Thank you received: 0
-
-

15 years 8 months ago [\#9167](#9167) by [YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")  Replied by *[YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")* on topic *[Re: Add to cart not working from product show view](/forum/4-how-to/9142-add-to-cart-not-working-from-product-show-view#9167 "Hi Nicolas,  I'm using the following code in my product show view:    orm action=&quot;&amp;lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&amp;gt;&quot; method=&quot;post&quot; name=&quot;hikashop&#95;product&#95;form&#95;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name'); ?&gt;&quot;&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt; input type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;row-&gt;product&#95;id; ?&gt;&quot; /&gt;      When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?  Gert.")*

Wonderful!

When you come to Thailand, let me know. Will buy you a few beers.

Gert.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkxNDItYWRkLXRvLWNhcnQtbm90LXdvcmtpbmctZnJvbS1wcm9kdWN0LXNob3ctdmlldz90bXBsPW1hcmtkb3du) 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: 86561
- Thank you received: 14307
-
-

15 years 8 months ago [\#9168](#9168) 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 not working from product show view](/forum/4-how-to/9142-add-to-cart-not-working-from-product-show-view#9168 "Hi Nicolas,  I'm using the following code in my product show view:    orm action=&quot;&amp;lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&amp;gt;&quot; method=&quot;post&quot; name=&quot;hikashop&#95;product&#95;form&#95;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name'); ?&gt;&quot;&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt; input type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;row-&gt;product&#95;id; ?&gt;&quot; /&gt;      When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?  Gert.")*

Thailand is on my list of countries to visit in the future ![:)](/media/kunena/emoticons/3.png ":)")

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

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

Less More

- Posts: 86
- Thank you received: 0
-
-

15 years 8 months ago [\#9174](#9174) by [YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")  Replied by *[YakNarak](/forum/user/476-yaknarak "View YakNarak's Profile")* on topic *[Re: Add to cart not working from product show view](/forum/4-how-to/9142-add-to-cart-not-working-from-product-show-view#9174 "Hi Nicolas,  I'm using the following code in my product show view:    orm action=&quot;&amp;lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&amp;gt;&quot; method=&quot;post&quot; name=&quot;hikashop&#95;product&#95;form&#95;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name'); ?&gt;&quot;&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt; input type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;row-&gt;product&#95;id; ?&gt;&quot; /&gt;      When I press the button the quantity is updated in the cart but the program doesn't go to the checkout page. Am I doing something wrong?  Gert.")*

Do let me know. You won't regret it ![:cheer:](/media/kunena/emoticons/2.png ":cheer:")

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

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