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

#   Add to cart link. Ajax or Stay same page POSSIBLE?

##

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile")
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

10 years 9 months ago [\#228247](#228247) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[Re: Add to cart link. Ajax or Stay same page POSSIBLE?](/forum/4-how-to/8572-add-to-cart-link-ajax-or-stay-same-page-possible?start=20#228247 "Hi.  In item (product) card there is a button Add to cart HTML link After clicking on this link (in content) is redirected to checkout.  1. Is it possible to add product from content with ajax ? 2. Do not redirect to checkout, Stay at same page (content) and display a popup notice ? (HikaShop-&gt;System-&gt;Configuration-&gt;Checkout-&gt;After a product is added to the cart: any setting does not affect)  Thanks.")*

Thank you
I used latest version of hikashop. How can do it?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg1NzItYWRkLXRvLWNhcnQtbGluay1hamF4LW9yLXN0YXktc2FtZS1wYWdlLXBvc3NpYmxlP2xhbmc9ZW4mc3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

10 years 9 months ago [\#228255](#228255) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Add to cart link. Ajax or Stay same page POSSIBLE?](/forum/4-how-to/8572-add-to-cart-link-ajax-or-stay-same-page-possible?start=20#228255 "Hi.  In item (product) card there is a button Add to cart HTML link After clicking on this link (in content) is redirected to checkout.  1. Is it possible to add product from content with ajax ? 2. Do not redirect to checkout, Stay at same page (content) and display a popup notice ? (HikaShop-&gt;System-&gt;Configuration-&gt;Checkout-&gt;After a product is added to the cart: any setting does not affect)  Thanks.")*

Hi,

> With that kind of code ; you cannot.
> But it will be possible in HikaShop 3.

You have the latest version of HikaShop ; so you have the version 2.6.1
So you do not have HikaShop 3 ; which is fully logical because we are still working on that development.

Regards,

---

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

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

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

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile")
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

10 years 9 months ago [\#228301](#228301) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[Re: Add to cart link. Ajax or Stay same page POSSIBLE?](/forum/4-how-to/8572-add-to-cart-link-ajax-or-stay-same-page-possible?start=20#228301 "Hi.  In item (product) card there is a button Add to cart HTML link After clicking on this link (in content) is redirected to checkout.  1. Is it possible to add product from content with ajax ? 2. Do not redirect to checkout, Stay at same page (content) and display a popup notice ? (HikaShop-&gt;System-&gt;Configuration-&gt;Checkout-&gt;After a product is added to the cart: any setting does not affect)  Thanks.")*

Thank you
I think I can get cart id by this code Code:

$app-&gt;getUserState( HIKASHOP_COMPONENT.'.cart_id', 0, 'int' );

and remove product from my cart with prodct_id and cart id by using ajax post method.

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

10 years 9 months ago [\#228355](#228355) 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 link. Ajax or Stay same page POSSIBLE?](/forum/4-how-to/8572-add-to-cart-link-ajax-or-stay-same-page-possible?start=20#228355 "Hi.  In item (product) card there is a button Add to cart HTML link After clicking on this link (in content) is redirected to checkout.  1. Is it possible to add product from content with ajax ? 2. Do not redirect to checkout, Stay at same page (content) and display a popup notice ? (HikaShop-&gt;System-&gt;Configuration-&gt;Checkout-&gt;After a product is added to the cart: any setting does not affect)  Thanks.")*

Hi,

As this post says [ www.hikashop.com/forum/4-how-to/8572-add...-possible.html#27582](https://www.hikashop.com/forum/4-how-to/8572-add-to-cart-link-ajax-or-stay-same-page-possible.html#27582) you can set the quantity to 0 in the add to cart URL in order to reset the quantity to 0 for the product in the cart.

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

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