Custom add to cart with ajax
Hi ,
I want to know how to add a custom add to cart button with ajax form submission inside xcart custom odule development. Please let me know. Thanks. xcart - 5.3.5.5 |
Re: Custom add to cart with ajax
You should try looking for examples in the existing code of X-Cart, I'm sure it has some. Then just copypaste the examples.
Also, this might help. * https://devs.x-cart.com/ |
Re: Custom add to cart with ajax
Quote:
Hi , I am following this tutorial. https://devs.x-cart.com/customization_examples/inserting_an_x-cart_'add_to_cart'_button_in_a_new_page.html I placed a form and js. But it seems like some default xcart js is conflicting due to which form is submitted twice. please advise. |
Re: Custom add to cart with ajax
Hi @lakin1,
Could you please let me know what page you are putting this 'Add to cart' button on? Thank you. Tony Quote:
|
Re: Custom add to cart with ajax
Quote:
Hi Tony, I am trying to show product variants in product details page in tabular format. And each table row will contain one add to cart button with its own quantity. Also we have our own stock management system etc. Hope it helps. |
Re: Custom add to cart with ajax
Hi @lakin1,
I assume you use the 2nd method described here: https://devs.x-cart.com/customization_examples/inserting_an_x-cart_'add_to_cart'_button_in_a_new_page.html If so, the problem might be that the submit event is triggered for each the 'form.custom-add2cart' form. Code:
$('form.custom-add2cart').each(function () { You may need to adjust this JS code and submit only particular form instead of all of them. Let me know if it helps. Tony Quote:
|
All times are GMT -8. The time now is 10:38 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.