Skip to content

Instantly share code, notes, and snippets.

@ffflabs
Created October 12, 2018 11:36
Show Gist options
  • Select an option

  • Save ffflabs/3883fe9b6933e70fb523d0691ed9aaf0 to your computer and use it in GitHub Desktop.

Select an option

Save ffflabs/3883fe9b6933e70fb523d0691ed9aaf0 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function() {
if (jQuery('.woocommerce-cart-form').length) {
jQuery('.dgwt-wcas-search-input').one('focus',function() {
jQuery('.dgwt-wcas-suggestions-wrapp')
.addClass('noClicks');
.on('click','.dgwt-wcas-suggestion', function() {
return false;
});
jQuery('.dgwt-wcas-suggestions-wrapp').on('click','.ajax_add_to_cart',function() {
var product_id = jQuery(this).data('product_id');
jQuery('.dgwt-wcas-close').click();
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment