We have a modal box that shows variant pricing on product pages. But it only shows the correct variant price if you reload the page. How do I force reload the page when someone clicks on a variant? I tried the code below in product.liquid file but it doesn't work? Any help?
<script> jQuery(function() { $('.single-option-selector').on('change', function(){ setTimeout(function(){ if($('[name="id"]').val() != "{{ product.selected_or_first_available_variant.id }}"){ location.reload(); } }, 1); }); }); </script>
User | Count |
---|---|
23 | |
19 | |
18 | |
17 | |
16 |