Jump to content

Change text "Select" in product detail page

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
  • Replies 4
  • Views 646
  • Created
  • Last Reply
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

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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

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

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.