Jump to content

Change text "Select" in product detail page

Go to solution Solved by Beyondspace,

Recommended Posts

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>

9618ffa349315a802d8375171cfb7152.png

Link to comment
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>

9618ffa349315a802d8375171cfb7152.png

which is product page url we can check

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • Solution

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>

image.thumb.png.5f4b145e001743ba0f9d495cc79c09eb.png

RobinJohannson sonny.annermo

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.