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

    (@rcreators)

    Hi dumshi,

    This is not out of topic, you need is a help to create new plugin or want a contribution in plugin development.

    Please post Question in wordpress plugin support forum to get better help.

    Support Forums

    Thread Starter dumshi

    (@dumshi)

    Hi,
    I don’t believe this is out of topic, as your plugin is suppose to fix the ajax call and magically make “Add to cart” button appear for Variable products.

    It works fine for Simple product, but you plugin won’t do anything for variable products.

    Plugin Author Rishi Mehta

    (@rcreators)

    Hi Dumsi,

    There is a misunderstaning about plugin. Plugin is adding ajax functionality and not the add to cart button showing option. Add to cart button is directly show after selection variable by woocommerce itself. So if you don’t get add to cart button after selecting variation, you need to check your theme to find out where theme is breaking code of woocommerce template.

    You can check plugin by disabling current theme and try in wordpress default theme. it will work for variable products.

    Another thing, your ticket is stated with your custom plugin development, which is also make it out of topic for me, i cannot support another plugin development on this plugin development forum. You can post customization in your plugin or any issue on your plugin development on plugin support forum of wordpress, than all developers around the globle can help you to short out issue. But mostly i think, you are on wrong track somewhere and don’t know what you required and what plugin does.

    Thread Starter dumshi

    (@dumshi)

    Hi Rcreators,
    Apologies, I thought this plugin will fix the “Add-to-cart” button pulled from Ajax call.

    It turns out that when woocommerce_template_single_add_to_cart() is pulled from ajax request, it loses the JS binding (even though I have supplied the p_id in POST var).

    Upon reading the woocommerece JS, Add-to-Cart-Variation.js, file, I manually bind the form to wc_variation_form.

    $( ‘.variations_form’ ).wc_variation_form();
    $( ‘.variations_form .variations select’ ).change();
    $( ‘div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)’ )
    .addClass( ‘buttons_added’ )
    .append( ‘<input type=”button” value=”+” class=”plus” />’ )
    .prepend( ‘<input type=”button” value=”-” class=”minus” />’ );

    I am not sure why JS binding is LOST.
    Some people suggest to register add-to-cart-variation.js in footer.

    Sorry for confusion.
    Maybe you can make another plugin available for the world that does the above things.

    Plugin Author Rishi Mehta

    (@rcreators)

    Hi Dumsi,

    Glad you got your site running back. Issues you faces is mosly cause by wrongly created theme or plugin. Woocommerce is a quite stable and have lots of things to add through hooks and filters. So if something wrong created in theme or plugin Or something missed classes or add wrong templating for woocommerce template files, woocommerce some functionality stops wierdly. So Better to have some list of codes and some list of plugins you can use and just work with them as they are reliable and tested by users.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Ajax call won't show Add-to-cart button’ is closed to new replies.