X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   General questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=66)
-   -   Add to Cart more than 1 (https://forum.x-cart.com/showthread.php?t=76158)

jmiranda 04-04-2018 08:52 AM

Add to Cart more than 1
 
I use this all time
<form action="?target=cart" method="post" accept-charset="utf-8" class="custom-add2cart"> <input type="hidden" name="target" value="cart" /> <input type="hidden" name="action" value="add" /> <input type="hidden" name="product_id" value="5" /> <div class="add-button-wrapper widget-fingerprint-product-add-button"> <button type="submit" class="btn regular-button regular-main-button add2cart submit"> <span>Add to cart</span> </button> </div> </form>

I have a case where i need to add 2 of the same item. Is there a hidden variable for quantanty
Thanks
Jorge

qualiteam 04-09-2018 10:38 PM

Re: Add to Cart more than 1
 
Yes, you can use the "amount" parameter to pass the quantity:
https://[YOUR_DOMAIN]/cart.php?target=cart&action=add&product_id=15&amou nt=2

jmiranda 04-09-2018 11:32 PM

Re: Add to Cart more than 1
 
Thank you that works great now. I was able to use those calls with Jquery/AJax and I now let users upload a shopping carts from a csv file.

You should consider adding this as a feature in the future.
Here where i did it
https://asia.serpent.com/xcart/uploadcart.html


All times are GMT -8. The time now is 10:34 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.