Change word "Price:"
Hi...
How to change word "Price :" that appear on front end site to be "Harga :" ? I want to translate it in my country language . This is screenshot of the word www.fizzjogja.com/price.jpg
Hi...
How to change word "Price :" that appear on front end site to be "Harga :" ? I want to translate it in my country language . This is screenshot of the word www.fizzjogja.com/price.jpg
You can edit the Field settings for the Product Type, and change the label there.
Thanks Dexter...,
I Have fixed it by change label 'Price' on file node-product.tpl.php in my theme
I used theme Ecommercpro
When trying to edit the field settings for price on my product type I get this: "The field Price is locked and cannot be edited." So I can not change the label through the manage fields system.
Were you able to find how to modify the product price field settings? It seems they are provided by a module and cannot be edited...
The accepted answer seems incorrect since the field's settings page is locked.
To alter a field's label from the theme you can use:
<?php
function YOURTHEME_preprocess_field(&$variables) {
if ($variables['element']['#field_name'] == 'commerce_price') {
$variables['label'] = t('My label for price');
}
}
?>
and from a module (found at http://dropbucket.org/node/1172):
<?php
function YOURMODULE_field_attach_view_alter(&$output, $context) {
if (!empty($output['commerce_price'])) {
$output['commerce_price']['#title'] = t('My label for price');
}
}
?>
Comments
Hi,
Try to install and enable Entity translation
Then got to /admin/commerce/products/types/[your product type]/fields
[your product type] should be the machine name of your product.
Try to edit the "price" field and you should see a message that allows you to enable translation for this field.
After you just need to edit again the field and you will be able to add translations for it.
In my case it caused some trouble in my Product display page but I don't know if it's because Entity translation is in alpha version or because I use Page manager (from Ctools suite) and I need to do some extra settings...
Hope it help you.
I used a CSS workaround,
/*price*/
.field-name-commerce-price .field-label {
color: transparent;
}
.field-name-commerce-price .field-label:before {
content: "מחיר:";/*new price name*/
color: black;
}