What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Dawn Theme Variant Pricing Not Working

Why is my Dawn Theme 4.0 variant pricing not displaying correctly?

Treyhaskett
Visitor
2 0 0

I am having an issue with my product variants not displaying the proper pricing. They all default to the lowest price not matter what variant options I select. This seems to be an issue with every product on my site. Any help or advice on where to look would be greatly appreciate. I am using Dawn Theme 4.0 https://highlandridgewoodworks.com/products/laurel-dining-table

Replies 8 (8)

nidhipatel
Pathfinder
89 20 24

Hi @Treyhaskett 

 

Please add the below code to the variants.js file

  updateMasterId() {
    this.currentVariant = this.getVariantData().find((variant) => {
      	return !variant.options.map((option, index) => {
        return this.options[index] === option;
      }).includes(false);
    });
  }

 

I hope it's helpful to you.

If our answer is helpful then please feel free to Like and Accept it as solution!
Hire our Shopify Developers for all your small & big needs:
New Store Development | Custom Theme Development | Site Speed Optimization
Email: hello@mintyourstore.com | Instagram: @mintyourstore
Treyhaskett
Visitor
2 0 0

Thanks for the response! For some reason I am unable to locate the variant.js file. Might it be called something else by any chance?

GoDrinks-Bali
Excursionist
37 0 5

Hi @nidhipatel , Need help to find variants js

 

nidhipatel
Pathfinder
89 20 24

Hi @GoDrinks-Bali & @Treyhaskett 

 

Sorry for delay.

 

I have checked your theme version 4.0.0 where variants.js is not available. so you have to add the below code to the global.js file.

 

Go to Assets/ global.js and add below code.

 

 

updateMasterId() {
    this.currentVariant = this.getVariantData().find((variant) => {
      	return !variant.options.map((option, index) => {
        return this.options[index] === option;
      }).includes(false);
    });
  }

 

 

2022_07_06_global.png

 

Thank you.

 

If our answer is helpful then please feel free to Like and Accept it as solution!
Hire our Shopify Developers for all your small & big needs:
New Store Development | Custom Theme Development | Site Speed Optimization
Email: hello@mintyourstore.com | Instagram: @mintyourstore
TSF5b
Tourist
5 0 2

HI, I seem to be having the same issue when changing my theme from Debut to Expanse, tried your fix above (had to put in my theme.js)

 

 updateMasterId() {
this.currentVariant = this.getVariantData().find((variant) => {
return !variant.options.map((option, index) => {
return this.options[index] === option;
}).includes(false);
});
}


but it is not working, do you have an alternative for the Expanse theme at all, would really appreciate any feedback, thanks 🙂

 

Soles
Visitor
1 0 0

Hi,

I have the same issue with the Dawn Theme. I have tried inserting that extra bit, but noticed that its already in the global.js. I tried adding it anyway and everything else and nothing worked. 

 

Would you or anyone else have any other solution to this please?

moe6
Tourist
8 0 1

Where do i add this on that page?  At the bottom of the file? That will be helpful.  thanks

 

vseazon
Shopify Partner
46 0 10

how did you fix that bro ?