Need to auto refresh when variant is chosen

BloomCompany
New Member
1 0 0

Running into an issue.

Whenever the customer chooses a variant (ex. size 1 or size 2. different price breaks for different sizes), theres a price break table that is displayed. The table stays on the price breaks for size 1, and will not change to the correct table until you manually refresh.

Is there any way to auto refresh the page when the customer changes the variant/size? I am using the Masonry theme and using Bold Custom Pricing- Wholesale.

0 Likes
Guleria
Shopify Partner
1312 269 363

Hello,

  jQuery(function() {
    $('.single-option-selector').on('change', function(){
        setTimeout(function(){ 
          if($('[name="id"]').val() != "{{ product.selected_or_first_available_variant.id }}"){
            location.reload();
          }
        }, 1);
    });
  });

Use this script, it will reload page every-time when variant change.  but may be you have to make changes in it a/to your theme code.
You can use in theme.js or related file a/to theme you used.

Thanks

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
tricki
New Member
1 0 0

Hello,

I use this code, but it does not work for me. What do I need to adjust for the Debut theme? Do you have a tip for me? 

I would be very happy if you could help me.

Thanks a lot!

0 Likes
Fyre123
New Member
1 0 0

Hi, 


Where abouts do you paste this into the code? 

 

Thanks in advance. 

0 Likes