• Resolved maysam.a

    (@maysama)


    Hi There,

    After searching around all blogs and forums, this seems kind of impossible for me to figure out. I hope you have a solution.

    I have both Simple and Variable products. Using your plugin, all items work AJAX in shop page, yet I use shortcodes for listing some items using independent pages and tables;
    add_to_cart button appears, but only simple products get AJAX and variable products keep refreshing the whole page.

    Can you help finding a simple solution for AJAX add to cart button for ALL products through SHORTCODE?

    PS:
    I have tried the LOOP folder PHP JS solutions… Copying PHP codes from shop to other pages etc too.

    The only way to force AJAX is to make the ADD_TO_CART.PHP behave like single product. But this way any variable added to cart will be added as the default variable.
    eg. if you have 4 sizes of an item, clicking ADD for sizes 1, 3 and 4 of an item. Will add 3 times size 1, which is the default, to the basket.

    Update:
    The only way to force AJAX is to make the ADD_TO_CART.PHP behave like single product. But this way any variable added to cart will be added but with empty variables.
    eg. if you have 4 sizes of an item, clicking ADD for sizes 1, 3 and 4 of an item. Will add 3 times, showing the price of size 3 and no variable information, to the basket.

    https://www.ads-software.com/plugins/woocommerce-ajax-add-to-cart-for-variable-products/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Rishi Mehta

    (@rcreators)

    Hi,

    Can you provide me a link where you are testing. Most of the time plugin doesn’t work cause of wrong template classes or default woo-commerce classes removed in template override. So if you can provide me a testing link, i can check generated code and give exact resolution for issue.

    Thread Starter maysam.a

    (@maysama)

    Hi;
    Sure. Thank you for your consideration.
    https://esprooz.com/#bilet

    Plugin Author Rishi Mehta

    (@rcreators)

    Hi,

    Can you provide url, which have variable product ? I am not getting it translated automatic. so i need exact page from website, where variable product listed.

    Make sure plugin is installed and activated.

    I also get one thing that, you don’t have product detail page. so if you want variable option selection and add to cart button on shop page or category page, you need to activate option from setting. I have put that setting in plugin.

    From here you can activate this, hope this will give you better idea :
    https://i.imgur.com/QJdJTMX.png

    Thread Starter maysam.a

    (@maysama)

    Yes. This is active. This is a shop page:
    https://esprooz.com/shop
    And this is a variable product link:
    https://esprooz.com/product/%D8%AA%DB%8C%D8%B1%D8%A2%D9%87%D9%86/
    Ajax work in second link. But i need it in first link that i sent to you. Actually i don’t want to use shop page. I want a single button with price that work with ajax without any option to choose.

    Plugin Author Rishi Mehta

    (@rcreators)

    Hi,

    I am not getting your point. Do you want to add variable product into cart without selecting any variable ? Does that mean you want a button which directly adds a specific variable with its value ? – If yes, this plugin is not for that. Plugin can only add variation if its selected from variable product form and than button clicked like we do on product detail page in second link.
    https://esprooz.com/product/%D8%AA%DB%8C%D8%B1%D8%A2%D9%87%D9%86/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Ajax for Shortcode (Variable and Simple Products)’ is closed to new replies.