cancel
Showing results for 
Search instead for 
Did you mean: 

translating quantity discount in product view

translating quantity discount in product view

Hi, good day to all,

 

Hopefully someone can point out to me the way to translate the text within the product view box for quantity discount.

see screenshot below:

2018-04-11_1323.png

thank you in advance for your time and helpSmiley Happy

regards

7 REPLIES 7

Re: translating quantity discount in product view

By default tier_price content is coming for configurable product is from,

vendor/magento/module-configurable-product/view/base/templates/product/price/tier_price.phtml

 

If you want to translate the text for your requirement, you need to create en_US.csv file to translate a text.

 

For Module level,

app/code/{Vendorname}/{Modulename}/i18n/en_US.csv

 

For Theme level,

app/design/frontend/{Vendorname}/{themename}/i18n/en_US.csv file.

 

In CSV file, the First column is original text and the second column is for our translatable text.

Now, You have to keep content in your CSV file,

"Buy %1 for %2 each and","Buy %1 for %2 each and"
"save","save"

now you need to run below command to see your changes,

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

 

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: translating quantity discount in product view

Hi @Rakesh Jesadiya,

 

Thank you very much for your response!

I already do have an en_US.csv in my theme at app/design/frontend/{Vendorname}/{themename}/i18n/en_US.csv file.

Can I add the lines and translation into that csv? now I'm egtting a little lost where to add what? for example the first column is without ".." and the second column is with quotation marks.

How exactly would I put the "buy %2 etc in there? (as I;ve tried but guess something went wrongSmiley Sad

Your Checkout Progress"Checkout Progress"
Card Verification Number"CVV"
Items %1-%2 of %3%3 items

 

thank you very much for your assistance!

Re: translating quantity discount in product view

You have to append quotes for both the column in csv and first column represent orinigal text whereas second column represent translation text.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: translating quantity discount in product view

Hello,

 

you can generate sample CSV from module then copy from it

 

 

 php bin/magento i18n:collect-phrases vendor/magento/module-catalog -o test.csv

 

It will generate one csv into root directory and you need to copy what ever you need  into your theme csv file.

 

Then remove from pub/static/frontend and var/view_preprocessed folder.

 

Then do static content deploy using with your lunguage pack

 

e.g 

php bin/magento setup:static-content:deploy de_DE

Hope it will help you.

 

If it will work then mark as solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: translating quantity discount in product view

Hi @Sunil Patel,

 

Thank you for your reply.

Do you mean I can remove the whole folders as you mentioned? or a file?

 

Thank you in advance for your assistance,

regards

Re: translating quantity discount in product view

@RockMariska

 

yes please 

 

var/view_preprocessed, var/cache and pub/static/frontend folder.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: translating quantity discount in product view

You dont need to remove any folder from magento instance,

Just run below command and your new translations file are generated using command,

 

Login with SSH, Go to magento root path, run below command

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy de_DE
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial