Jump to content

Change text "Select" in product detail page

Recommended Posts

Add to Code Injection Footer

<script>
  jQuery(function($){
$("select option").html(function() { 
          return $(this).html().replace("Select", "tuan");  
    });
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

remove above and use this

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
		$("select option").html(function() { 
          return $(this).html().replace("Select", "tuan");  
    });
	});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

I don't want to be the bearer of bad news, but that solution will appear to work when logged on, and when the page is refreshed, but it won't work for visitors who navigate to the page from another page on your site. This is because the document.ready function will not fire when this template loads a new page (see Ajax). For example, this is what I see:

1807761671_Screenshot2020-04-02at13_23_44.png.99d9a76a81249a64481d8a78ec0080ee.png

Replacing it with the onInitialize function will fix this.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment

Thanks. You are right. I tried this code and it seems like this works. 

 

<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>

 

Link to comment
  • 4 weeks later...
On 4/2/2020 at 2:31 PM, paul2009 said:

I don't want to be the bearer of bad news, but that solution will appear to work when logged on, and when the page is refreshed, but it won't work for visitors who navigate to the page from another page on your site. This is because the document.ready function will not fire when this template loads a new page (see Ajax). For example, this is what I see:

1807761671_Screenshot2020-04-02at13_23_44.png.99d9a76a81249a64481d8a78ec0080ee.png

Replacing it with the onInitialize function will fix this.

Any idea of why this code does´nt work in 7.1 ?

Using it here fx:

https://www.lindbikeparts.dk/webshop/marconi-collection-1

Link to comment
On 5/2/2020 at 4:43 PM, tuanphan said:

Which code did you use?

<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>
Link to comment
  • 1 year later...
On 3/26/2020 at 3:44 PM, tuanphan said:

Add to Code Injection Footer


<script>
  jQuery(function($){
$("select option").html(function() { 
          return $(this).html().replace("Select", "tuan");  
    });
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

 

@tuanphan Your solution works perfectly, however, on mobile the word SELECT still pops up. Do you have an idea how to solve this issue?

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.