1

In the backend I have given my attribute label different names, but on the frontend both store views use the admin label. The code that gets the label;

echo $_attribute->getLabel()

How do I make this store view specific?

2 Answers 2

6

Go to

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

find

<dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt>

replace with

<dt><label class="required"><em>*</em><?php echo $_attribute->getProductAttribute()->getStoreLabel() ?></label></dt>
1

Step 1: login in your magento backend.

Step 2: Catalog >> Attributes >> manage Attributes.

Step 3: Open your Attribute.

Step 4: Got to Tab Manage Label / Options.

Step 5: You can hear Specify Store vise Label. Magento Will call automatic when that store will load.

This is simple way to show the attribute Label.

you can use below code.

  <?php
  $productAttribute = $_product->getResource()->getAttribute($attr);
  $_label = $productAttribute->getStoreLabel(Mage::app()->getStore()->getName());
  echo $_label;
  ?>

The above code will give the attribute label as per store wise.

Let me know if any comments.

4
  • Hi Keyul. Like I wrote in the question, the problem is that I've already done this but sadly it doesn't show on the frontend.
    – McKeene
    Sep 2, 2014 at 12:24
  • Update your cache
    – Keyul Shah
    Sep 2, 2014 at 12:24
  • All caching is disabled.
    – McKeene
    Sep 2, 2014 at 12:28
  • then check have you install any custom module that will affect
    – Keyul Shah
    Sep 2, 2014 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.