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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
5 hours ago, jacobtdb said:

Thanks, but it seems not work. Any idea why? It is a webshop in 7.0 version

Can you keep above code & I will check again?

and which template do you use?

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

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/1/2020 at 3:10 PM, jacobtdb said:

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

Using it here fx:

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

Which code did you use?

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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
On 5/31/2021 at 4:19 PM, ievavi said:

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

Can you share link to a product?

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
On 6/2/2021 at 5:49 AM, ievavi said:

Of course. For example, on mobile (one variant):
https://rocksforlife.com/our-jewellery/band-ring-yellow-gold (pass: rocksfor.life)


 

IMG_3130.PNG

It looks like you solved?

image.thumb.png.568649bd91dc227bb804cc99b5bdd691.png

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.