Modal Close button submits the variations form
-
Hello!
If the the size chart link is placed inside the variations form (see the first snippet below), the modal close button submits the form and the product is added to the Cart.
function my_add_hook_custom_size_chart_position($position){ return 'woocommerce_before_variations_form'; } add_filter('add_hook_custom_size_chart_position', 'my_add_hook_custom_size_chart_position');
You can fix it by adding e.preventDefault() inside size-chart-for-woocommerce-public.js.
$('div#md-size-chart-modal .remodal-close').click(function(e) { e.preventDefault(); var modal = document.getElementById('md-size-chart-modal'); modal.style.display = 'none'; });
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Modal Close button submits the variations form’ is closed to new replies.