Shopify.OptionSelectors.prototype.replaceSelector = function (t) {
var e = document.getElementById(t),
o = e.parentNode;
Shopify.each(this.buildSelectors(), function (t) {
o.insertBefore(t, e)
}),
e.style.display = 'none',
this.variantIdField = e
},
This seems to be a file that Shopify is loading and then it is rewriting all the option selectors in the page to be hidden. How can we stop this from happening?
Yes but only minor changes like text in the footer.
There is no update and iirc the theme used to be the default theme provided by shopify? It’s been so long I don’t recall and it’s not in the theme shop.
option_selection-9f517843f664ad329c689020fb1e45d03cac979f64b9eb1651ea32858b0ff452.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at Shopify.Product.getVariantById (option_selection-9f517843f664ad329c689020fb1e45d03cac979f64b9eb1651ea32858b0ff452.js:1:2264)
at Shopify.OptionSelectors.selectVariant (option_selection-9f517843f664ad329c689020fb1e45d03cac979f64b9eb1651ea32858b0ff452.js:1:4977)
at Shopify.OptionSelectors.selectVariantFromDropdown (option_selection-9f517843f664ad329c689020fb1e45d03cac979f64b9eb1651ea32858b0ff452.js:1:4740)
at Shopify.OptionSelectors.initDropdown (option_selection-9f517843f664ad329c689020fb1e45d03cac979f64b9eb1651ea32858b0ff452.js:1:3838)
at new Shopify.OptionSelectors (option_selection-9f517843f664ad329c689020fb1e45d03cac979f64b9eb1651ea32858b0ff452.js:1:3640)
at HTMLDocument.
I noticed this error in the console that the javascript doesn't seem to be able to read the length of the variant object? I also found an older copy of the theme that doesn't have this problem but the code for product.liquid is identical.
Here's an example page [https://smartwholesale.net/products/akz-g6-bt-earphones](https://smartwholesale.net/products/akz-g6-bt-earphones)