fbpx
Skip to content
Questions & AnswersCategory: QuestionsVariant selector
Ainoa asked 8 years ago
Hi! We are starting to test the script and first of all want to say thanks, it can save us so many time!!
We are migrating from Woocommerce to Squarespace and needed an alternative to WPML. Your plugins seems to be the solution. So now the issue, I've found the script is not filtering a translation in a variant selector of product pages:   Here closed: And open:         Using the standard script plus the hard-coded-text script, "SIZE" is translated to "TALLA" and "Select size" is translated to "Select talla" but just when is open. Probably because the closed state text it's in a data-text property:
<div class="variant-select-wrapper" data-text="Select Size" id="yui_3_17_2_1_1494158974426_315">
<select data-variant-option-name="Size" id="yui_3_17_2_1_1494158974426_214">
<option value="">Selecciona Talla</option>
<option value="10">10</option><option value="12">12</option><option value="14">14</option>
</select>
</div>

 
    Jose
 
1 Answers
Ainoa answered 8 years ago

Solved it by adding this to the hard-coded-text script:


jQuery(".variant-select-wrapper").each(function() {
 jQuery(this).attr('data-text', 'Seleccionar');
});

 

Dave Hilditch replied 8 years ago

nicely done!

We use cookies

We use cookies for various things on our site, including our on-site chat bubble (if you use it), our comment forms (if you use them) and for session handling (if you log in).

Other than that, we use cookies to identify where traffic came from to help us understand which traffic turns into sales, we use a cookie for Google Analytics traffic analysis and we use a cookie to customise adverts for our own products we think you'll be interested in.

You can read more detail in our privacy policy page. Please click 'Accept' or 'Decline' to continue.