Ajax Add to Cart on a URL without refreshing page

3 replies2 participantsUpdated by Olga Barlow

  • Avatar: nuj
    nuj
    Participant

    I am trying to create the ability to add items to cart from an URL in a textbox in the same fashion the woo commerce add to cart functions. The current theme always reloads the page whenever I link using ?add-to-cart=id

    3 Answers

    Avatar: Olga Barlow
    Olga Barlow
    Participant

    Hello,

    Point is that “?add-to-cart=id” uses POST not Ajax add to cart by default.
    Add the following classes to your button
    progress-button etheme_add_to_cart_button ajax_add_to_cart
    Check the add to cart after that.

    Regards

    Avatar: nuj
    nuj
    Participant

    Thank you – it seems to have worked to initiate the add to cart process in ajax but it still reloads the page upon clicking.

    Avatar: Olga Barlow
    Olga Barlow
    Participant

    Hello,

    Provide us with link to page where you use custom add to cart link and temporary WP Dashboard access. We’ll check.

    Regards

Want to reply? Log in, or register with your ThemeForest purchase code, to reply to this topic.

Login / Register