How to brute force translate "Buy it Now" button on the product page? Dawn theme.

How to brute force translate "Buy it Now" button on the product page? Dawn theme.

RUSHWAYC
Tourist
8 0 1

Hello!

 

I am creating my Shopify page and I've been trying to translate the "Buy it Now" button on the product page for the past couple of hours. Reading other community forums I know that there is no official way of doing that inside the Shopify app, and some other solutions were either outdated or didn't work for me.

 

I am not even able to find there the "Buy it Now" button is stored in the Dawn theme's code so that I can just change the value. So if anyone knows how to translate the button (specifically to Serbian) that would be appreciated!

 

RUSHWAYC_0-1689027673638.png

P.S. Also want to remove the parenthesis after "Količina" where quantity is, but that is less important.

Replies 16 (16)

Transcy
Shopify Partner
285 19 87

Hello @RUSHWAYC ,

 

You can try to follow these steps:

Go to Online Store -> Themes -> Actions -> Edit code

Go to Snippets folder -> product-template.liquid file

Replace the existing code for the "Buy it Now" button with the following code:

<button class="buy-now-button">{{ 'products.product.buy_it_now' | t }}</button>

Open the en.default.json file (or a similar file for the default language

Add the following translation key-value pair for the Serbian translation:

"products.product.buy_it_now": "Kupi odmah"

Save and preview

 

Hope this can help.

Transcy team

Transcy - The #1 Translation and Currency Converter
- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Blog
RUSHWAYC
Tourist
8 0 1

Hi @Transcy! Really appreciate your reply. Unfortunately, I do not have a file like that and searching for similar file names I was unable to find anything that contains "buy it now" and I searched by "buy" only.

Also, I downloaded the full code of my theme and when I search through all the files and what is inside using Visual Studio Code there again is no "Buy it now", and again I searched with "buy" only.

 

In the picture I'm uploading you'll be able to see all the search results that include "buy" inside. (there is more if scrolled up, but it's just for other languages)

 

RUSHWAYC_0-1689078644271.png

 

I'm really stumped how it's not possible to find it.

 

 

RUSHWAYC
Tourist
8 0 1

Okay, I was able to figure it out from THIS thread, comment by @olessia that was posted in 2021 and still works as of 11 July 2023. It's not the most optimal solution, but hey, it works.

I will keep the thread open for another day or two in case someone else comes up with a better solution before marking as resolved.

 

The solution is (copied from Olessia):

 

Go to the code of your theme -> Assets -> global.js and add this code at the end of the file:

 

/* fix BUY IT NOW button to Hebrew */
/* for desktop view */
setTimeout(function(){
    buyItNowButtonsCollection = document.getElementsByClassName('shopify-payment-button__button');
    if(buyItNowButtonsCollection.length) {
		buyItNowButton = buyItNowButtonsCollection[0];
		buyItNowButton.textContent = 'קנו עכשיו';
    }
}, 1000);

/* for mobile view */
setTimeout(function(){
    buyItNowButtonsCollection = document.getElementsByClassName('shopify-payment-button__button--unbranded');
    if(buyItNowButtonsCollection.length) {
		buyItNowButton = buyItNowButtonsCollection[0];
		buyItNowButton.textContent = 'קנו עכשיו';
    }
}, 2000);
richbrown_staff
Shopify Staff
652 96 168

Hi @RUSHWAYC , sorry you've had to encounter this. We'll do the translation this end. 'Buy it now' behaves differently to other parts of your store and translations are centrally managed. I'll update once we've done it.

 

If anyone else reading this finds 'Buy it now' doesn't translate into their language, please reply with the language and we'll sort. Rich

To learn more visit the Shopify Help Center or the Community Blog.

richbrown_staff
Shopify Staff
652 96 168

Hey @RUSHWAYC try now - it should be fixed (you should hide / remove your temp fix)

To learn more visit the Shopify Help Center or the Community Blog.

RUSHWAYC
Tourist
8 0 1

Aayyyy, thanks @richbrown_staff! I removed the temporary fix and it still says "Kupi odmah". Just to confirm, how is this achieved in case I (or anyone else) wants to change it in the future?

 

Also, if I may make suggestions, would be neat if changing the colors of the buttons was integrated in the page builder as well as changing the text inside.

Also, also, changing the font sizes across the theme as the navbar and caption texts would be quite neat.

 

But I appreciate you looking into this so fast! 🙌

richbrown_staff
Shopify Staff
652 96 168

No problem. This is managed centrally by us; 'Buy it now' works differently to all other text on your store, so there's no easy way to amend it yourself without hacky overrides. We're aiming to get coverage to every language we support.

 

Thanks for the thoughts on button design. That sits outside our team's control but I'll pass that feedback on. All the best

To learn more visit the Shopify Help Center or the Community Blog.

Drdrea87
Visitor
2 0 1

Hello,
I was searching for a solution for the same problem, and bumped into this thread.
I need a help to translate 'Buy it now' button to Serbian, can you please help me?

richbrown_staff
Shopify Staff
652 96 168

Hi @Drdrea87 , I believe we've done Serbian. Can you send screenshots of the problem you're having? And what theme you're using. Thanks

To learn more visit the Shopify Help Center or the Community Blog.

Drdrea87
Visitor
2 0 1

Hi @richbrown_staff ,

My bad, you are right. Default language was not Serbian, now i have changed it and "Buy it now" button is translated properly.

Thank you very much for your quick reply and help!

richbrown_staff
Shopify Staff
652 96 168

No problem!

To learn more visit the Shopify Help Center or the Community Blog.

pokepopspot
Excursionist
21 0 5

Hi @richbrown_staff can you please add also a translation for Slovak? Should be: "Kúpiť" Thanks! 🙂 

pokepopspot
Excursionist
21 0 5

Hey @richbrown_staff we're having the same issue on our store. We would like the "buy it now" translated into Slovak. Already requested once without any update.

esaamariamis
New Member
4 0 0

Hi @richbrown_staff , We would like to translate the "buy it now" button to Georgian, it would be translated as: "ყიდვა"; Could you please assist us?  This is our store: https://211dc4-2.myshopify.com/. It should be accessible to customers both in English and in Georgian.

Thanks

richbrown_staff
Shopify Staff
652 96 168

Hi @esaamariamis , we've added this to the backlog.

To learn more visit the Shopify Help Center or the Community Blog.

Jahid-KlinKode
Excursionist
145 1 5

Hey @RUSHWAYC, here's a helpful YouTube video that addresses language limitations in Shopify and guides you on customizing the 'Buy It Now' button: https://www.youtube.com/watch?v=zL-n5LYFr4E&t=45s