SimonAnnermo Posted March 11, 2021 Share Posted March 11, 2021 Site URL: https://www.emilhenrohn.se I want to change the select on a product and i have tried this: But it dosn't work. The code to the site is: sociallabs. Any ideas? <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> window.Squarespace.onInitialize(Y, function(){ $("select option").html(function() { return $(this).html().replace("Select", "Vælg"); }); }); </script> Beyondspace 1 Link to comment
Beyondspace Posted March 13, 2021 Share Posted March 13, 2021 On 3/11/2021 at 10:14 PM, sonny.annermo said: Site URL: https://www.emilhenrohn.se I want to change the select on a product and i have tried this: But it dosn't work. The code to the site is: sociallabs. Any ideas? <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> window.Squarespace.onInitialize(Y, function(){ $("select option").html(function() { return $(this).html().replace("Select", "Vælg"); }); }); </script> which is product page url we can check BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
RobinJohannson Posted March 13, 2021 Share Posted March 13, 2021 I have the same problem, the code doesn't work. Link to comment
SimonAnnermo Posted March 16, 2021 Author Share Posted March 16, 2021 On 3/13/2021 at 2:44 PM, bangank36 said: which is product page url we can check https://emil-henrohn.squarespace.com/shop/p/yolla-hoodie-svart Code: sociallabs Link to comment
Solution Beyondspace Posted March 17, 2021 Solution Share Posted March 17, 2021 Try this snippet instead <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function() { $(".variant-select-wrapper select option").html(function() { return $(this).html().replace("Select", "Vælg"); }); $(".variant-select-wrapper").attr("data-text", function() { return $(this).attr("data-text").replace("Select", "Vælg"); }); }); </script> RobinJohannson sonny.annermo SimonAnnermo and Ciodensky 1 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment