Home Forums WoodMart support forum AJAX Add to cart

AJAX Add to cart

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #192845

    EntreDosCom
    Participant

    Hi we have bought the Woocommerce Wishlist plugin from the official Woocommerce marketplace, it turns out that having activated the AJAX in Add to Cart button what it does is Add the product to the cart. We have consulted with the developer and he answered this if it can be solved because we are interested in working with Ajax, we left it activated so you can see it thank you very much!

    Here is an example: https://nuvole.es/tienda/conjunto-cubrepanal-acuario-rosa-palo/

    DEVELOPER (LUCAS STARK): This is because something in your theme is intercepting the click event and clicking the add to cart button, because it’s trying to submit it via AJAX. I’d recommend disabling AJAX add to cart features from your theme so that it’s not conflicting with other button presses on the form. Alternatively, let the theme author know that their button handler script is too aggressive and needs to target the click event specifically of the add to cart button, otherwise it’ll consume clicks it’s not supposed to.

    #192965

    Artem Temos
    Keymaster

    Hello,

    Our AJAX add to cart action is triggered on WooCommerce form submit an event and not on the button click $('body').on('submit', 'form.cart', function (e) {. It means that the plugin’s button click triggers this form submit event. We are not able to prevent this.

    Kind Regards

    #193015

    EntreDosCom
    Participant

    Thanks, I sent your reply to plugin developer.

    thanks!

    #193262

    EntreDosCom
    Participant

    He replied me this:

    That is exactly what I meant. They should be attached to the button, not to the form submission event. We dynamically change the form action with the wishlist extension and submit the form, that allows us to intercept the submission so rather than it going to the cart it’ll go to a list. We can’t do that if the form is submitted via Ajax, and if they are hooked on to the general form submit action rather than specifically to the form’s submit button.

    #193328

    Artem Temos
    Keymaster

    In some situations, WooCommerce doesn’t submit the form when the button is clicked. That is why the button click event is not suitable for that. We need to be sure that the whole form is submitted.

    #193556

    EntreDosCom
    Participant

    Hi, we finally solved the incident changing the button style! Only happens with Circle Buttons!

    thanks.

    #193598

    Artem Temos
    Keymaster

    Strange, but we are glad that you sorted it out.

    #193630

    EntreDosCom
    Participant

    Hi Artem, no, always happens with Ajax activated and the developer does not want to know anything, we will have to work with Ajax disabled that we do not like the idea very much.

    Thanks anyway!!

    #193659

    Artem Temos
    Keymaster

    OK, contact us if you will have any extra questions.

Viewing 9 posts - 1 through 9 (of 9 total)