Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

attribute label translations on configurable products
 
Jools
Sr. Member
 
Total Posts:  95
Joined:  2009-03-05
 

if I add to /Repos/magento/trunk/site/magento/app/design/frontend/default/default/template/catalog/product/view/attributes.phtml

<php echo $this->__(’some attribute label’) ?>

depending on the store view it is correctly translated (and the list of attributes is translated)

however in the file

app/design/frontend/default/default/template/catalog/product/view/type/options/configurable.phtml

the same code will not work, and will not show the translated label.

This problems stems from that I do not want to use the “attribute label” that you set in EACH configurable product. say I have 200 configurable products in 4 languages, and decide to change the label, i would have to edit every single configurable product (or some some custom query against database). So instead I changed some code in app/design/frontend/default/default/template/catalog/product/view/type/options/configurable.phtml to instead of displaying

echo $_attribute->getLabel();

to

echo $_attribute->getProductAttribute()->getFrontend()->getLabel()

and it does work. It returns the main “admin” attribute label, rather than the one set in the configurable product. However, i am unable to get this to translate between my stores (by using __() ). The __ function exists, so why would some stuff translate on some areas and some on another? does magento selectively include the attribute labels in the translation code only for some classes?

Any help would be appreciated

 
Magento Community Magento Community
Magento Community
Magento Community
 
mirelon
Member
 
Total Posts:  41
Joined:  2008-11-04
 

I had the same problem, i solved it this way:
echo $this->__($_attribute->getLabel())
because i have no time to study why (when i dont use __()) is the default one label displayed instead of that of current store view (it is translated in admin->manage attributes->manage labels)

EDIT: and i also added translations to .csv files

 
Magento Community Magento Community
Magento Community
Magento Community
 
amadex
Member
 
Total Posts:  43
Joined:  2008-12-15
 

I’m also facing this situation!… any solution? I’ve just crawled all over Internet and found nothing…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jools
Sr. Member
 
Total Posts:  95
Joined:  2009-03-05
 

The issue is now marked as fixed, but not available in any release and of course because we have limited source access, it isnt possible to pull the fix from any repository.

http://www.magentocommerce.com/bug-tracking/issue?issue=6909

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tomakun
Sr. Member
 
Total Posts:  77
Joined:  2008-10-21
 

Here’s what I experience on my side: changing the label for an attribute does not effet what is displayed on the front end. Even if I enter a completely different word in all the field and save the attribute, on the front end it will keep showing the original label I saved the first time. Are you guys experiencing the same thing?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jools
Sr. Member
 
Total Posts:  95
Joined:  2009-03-05
 

If you are using configurable products, note that a “copy” of the label is stored in the configurable product, hence my change to $_attribute->getProductAttribute()->getFrontend()->getLabel() to use the original label name and not the one from the configurable product.

 
Magento Community Magento Community
Magento Community
Magento Community
 
amadex
Member
 
Total Posts:  43
Joined:  2008-12-15
 

Hi! I’ve found a solution in here: http://www.libre-a-vous.fr/recuperer-liste-complete-attributs-produit-magento/

// récupérer le modèle de données produit
$model = Mage::getResourceModel(’catalog/product’);
// récupérer le type d’entité produit
$typeId = $model->getTypeId();
// récupérer tous les attributs d’un produit
$attributes = Mage::getResourceModel(’eav/entity_attribute_collection’)
->setEntityTypeFilter($typeId)
->load();
// afficher les codes des attributs et les labels utilisés sur le site
foreach ($attributes as $att) {
echo $att->attribute_code;
echo Mage::helper(’catalog’)->__($att->getFrontend()->getLabel());
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Creepin
Jr. Member
 
Total Posts:  28
Joined:  2012-03-28
 

Mirelon’s simple solution worked great! I did not need to put translations in .csv files. But I have a copy of configurable.phtml in my custom theme, so i had to change this one.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Frederik Krautwald
Member
 
Avatar
Total Posts:  58
Joined:  2007-09-25
Reykjavík, Iceland
 

As mentioned by dknzdesign, January 2 2011, on Issue #15466, the fix is to modify entries in the database. You should run this SQL command on your Magento database:

UPDATE `catalog_product_super_attribute_labelSET `use_default` = 1 WHERE `catalog_product_super_attribute_label`.`use_default` = 0;
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top