Ajax Add to Cart on a URL without refreshing page

This topic has 4 replies, 2 voices, and was last updated 3 years, 6 months ago ago by Olga Barlow

  • Avatar: nuj
    nuj
    Participant
    April 28, 2021 at 21:45

    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
    Support staff
    April 29, 2021 at 10:48

    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
    May 1, 2021 at 01:23

    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
    Support staff
    May 5, 2021 at 08:31

    Hello,

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

    Regards

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.