• davidyfw

    (@davidyfw)


    Hi, it appears that there is some sort of possible timing issue with the plugin code that prevents the Add to Cart button from enabling properly on the first click. I reproduced this behaviour with both radio and the ddSlick options.

    Problem: Clicking on the variation button doesn’t enable the Add to Cart button immediately. The user has to click the button twice.

    Workaround: Click the variation button twice.

    Workaround 2: The following change to the frontend.js code appears to work but only for the “radio” type (see the line below “WORKAROUND HERE”:

    $(document).on('click touch', '.woovr-variation-radio', function() {
        var _this = $(this);
        var _variations = _this.closest('.woovr-variations');
        var _click = parseInt(_variations.attr('data-click'));
        var _variations_form = _this.closest('.variations_form');
    
        woovr_do_select(_this, _variations, _variations_form, _click);
    
        // WORKAROUND HERE: Repeat the call twice
        woovr_do_select(_this, _variations, _variations_form, _click);
    
        _this.find('input[type="radio"]').prop('checked', true);
      });

    Edit: repeating the woovr_do_select call twice in the other respective code blocks fixes it for the other selector types (radio, select, ddSlick, etc.).

    Any idea why this issue occurs?

    • This topic was modified 4 years ago by davidyfw.
    • This topic was modified 4 years ago by davidyfw. Reason: update fix workaround
Viewing 1 replies (of 1 total)
  • I’m having the same issue. Works as expected on products using default Hello theme product page. Does not work on products using my custom Elementor single product template. I reached out to their support 3 weeks ago. Tier one support said they were escalating it to a developer. Haven’t heard back yet. I will try your workaround code above on my staging site and see if it works. Thank you for posting it!

Viewing 1 replies (of 1 total)
  • The topic ‘Buttons have to be clicked twice before “add to cart” enables’ is closed to new replies.