Tags/topics: 
4
Answers
Vote up!
1
Vote down!

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

Asked by: Jericho
on June 19, 2012

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.

- Dexter0015 on June 19, 2012

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

- RoyE on September 23, 2012

4 Answers

Vote up!
-1
Vote down!

You can edit the Field settings for the Product Type, and change the label there.

Answer by: Chris Charlton
Posted: Jun 22, 2012
Vote up!
0
Vote down!

Thanks Dexter...,
I Have fixed it by change label 'Price' on file node-product.tpl.php in my theme
I used theme Ecommercpro

Answer by: Jericho
Posted: Jun 20, 2012
Vote up!
0
Vote down!

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.

Answer by: Anonymous (not verified)
Posted: Jul 24, 2012

Comments

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

- bohemier on April 10, 2013
Vote up!
0
Vote down!

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');
  }
}
?>
Answer by: lmeurs
Posted: May 14, 2014