0
votes

I want to map color-code with actual value of color so what I did is just set color-code value into "Default Store Value" and actual color-name in admin-label.

Like in color attribute option-value, I have added "blue" for "Admin" and "#0000FF" to
"Default Store View"

Now, when I place any order the entry of color-code placed inside the order and displayed on invoice and also sent via mail to the customer.

How can I solve this problem or How can I change color-code value with admin-label value of color-code while placing the order?

2

2 Answers

1
votes

You need to install extension for proper mapping of color code with color names. Many Extensions are available at magento connect.

1
votes

This way you can get admin label for an attribute for a product

$attrbute_code = 'color';
$_attribute= $product->getResource()->getAttribute($attrbute_code);
$_options= $_attribute->getSource()->getAllOptions(true, true);
foreach($_options as $option)
      if ($option['value'] == $product->getData($attrbute_code))
        echo  $option['label'];

and for Storeview label

echo $product->getAttributeText($attribute_code);