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

#   can not stay on the same page after add to cart

##

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

Less More

- Posts: 51
- Thank you received: 0
-
-

14 years 10 months ago -  14 years 10 months ago [\#33078](#33078) by [loling](/forum/user/989-loling "View loling's Profile")  *[can not stay on the same page after add to cart](/forum/4-how-to/33078-can-not-stay-on-the-same-page-after-add-to-cart#33078 "Hi Nicolas  i just updated hikashop to 1.5.5. Then i played in checkout process. After changing some checkout workflow, i couldn't stay on the same page after adding product to cart.  I believe the option is in hikashop configuration - checkout tab - &quot;After a product is added to the cart&quot; - &quot;always stay on the same page&quot;  I have tried every option in &quot;After a product is added to the cart&quot;, all of them give the same result, which always go to checkout.  I would like to have &quot;always stay on the same page&quot;  Thanks  !!edit!!: it turns out that if we add product to cart from product page it works fine. It goes to checkout process when in listing page  !!temporary solution!! : Replace display-view-product-listing&#95;img&#95;Desc code:  orm action=&quot;&amp;lt;?php echo hikashop&#95;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;ajax=''; if(!$this-&gt;config-&gt;get('ajax&#95;add&#95;to&#95;cart',1)){ $this-&gt;ajax = 'return hikashopModifyQuantity(&#92;''.$this-&gt;row-&gt;product&#95;id.'&#92;',field,1,&#92;'hikashop&#95;product&#95;form&#95;'.$this-&gt;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name').'&#92;');'; } $this-&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;       back to old version of hikashop 1.4.9  ?&gt;form action=&quot;&amp;lt;?php echo hikashop::complteLink('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;ajax=''; $this-&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;    ?php  i'm not sure whether this is good thing to do, at least it works for now.")* was created by *[loling](/forum/user/989-loling "View loling's Profile")*

Hi Nicolas

i just updated hikashop to 1.5.5. Then i played in checkout process. After changing some checkout workflow, i couldn't stay on the same page after adding product to cart.

I believe the option is in hikashop configuration - checkout tab - "After a product is added to the cart" - "always stay on the same page"

I have tried every option in "After a product is added to the cart", all of them give the same result, which always go to checkout.

I would like to have "always stay on the same page"

Thanks

!!edit!!: it turns out that if we add product to cart from product page it works fine. It goes to checkout process when in listing page

!!temporary solution!! : Replace display-view-product-listing_img_Desc code:
&lt;!-- ADD TO CART BUTTON --&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;ajax='';
if(!$this-&gt;config-&gt;get('ajax_add_to_cart',1)){
$this-&gt;ajax = 'return hikashopModifyQuantity(\''.$this-&gt;row-&gt;product_id.'\',field,1,\'hikashop_product_form_'.$this-&gt;row-&gt;product_id.'_'.$this-&gt;params-&gt;get('main_div_name').'\');';
}
$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;!-- EO ADD TO CART BUTTON --&gt;

back to old version of hikashop 1.4.9

?&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;ajax='';
$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

i'm not sure whether this is good thing to do, at least it works for now.

Last edit: 14 years 10 months ago by [loling](/forum/user/989-loling "View loling's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzMDc4LWNhbi1ub3Qtc3RheS1vbi10aGUtc2FtZS1wYWdlLWFmdGVyLWFkZC10by1jYXJ0P3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 10 months ago [\#33102](#33102) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: can not stay on the same page after add to cart](/forum/4-how-to/33078-can-not-stay-on-the-same-page-after-add-to-cart#33102 "Hi Nicolas  i just updated hikashop to 1.5.5. Then i played in checkout process. After changing some checkout workflow, i couldn't stay on the same page after adding product to cart.  I believe the option is in hikashop configuration - checkout tab - &quot;After a product is added to the cart&quot; - &quot;always stay on the same page&quot;  I have tried every option in &quot;After a product is added to the cart&quot;, all of them give the same result, which always go to checkout.  I would like to have &quot;always stay on the same page&quot;  Thanks  !!edit!!: it turns out that if we add product to cart from product page it works fine. It goes to checkout process when in listing page  !!temporary solution!! : Replace display-view-product-listing&#95;img&#95;Desc code:  orm action=&quot;&amp;lt;?php echo hikashop&#95;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;ajax=''; if(!$this-&gt;config-&gt;get('ajax&#95;add&#95;to&#95;cart',1)){ $this-&gt;ajax = 'return hikashopModifyQuantity(&#92;''.$this-&gt;row-&gt;product&#95;id.'&#92;',field,1,&#92;'hikashop&#95;product&#95;form&#95;'.$this-&gt;row-&gt;product&#95;id.'&#95;'.$this-&gt;params-&gt;get('main&#95;div&#95;name').'&#92;');'; } $this-&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;       back to old version of hikashop 1.4.9  ?&gt;form action=&quot;&amp;lt;?php echo hikashop::complteLink('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;ajax=''; $this-&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;    ?php  i'm not sure whether this is good thing to do, at least it works for now.")*

Thank you for the feedback.

You won't have any drawbacks by doing that modification.

We'll look on our end to fix that (the change is necessary in some other cases).

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

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