1

I'm trying to get our product prices to display a unit suffix using an attribute, which I called 'matric'.

So for example we sell wallpaper by the roll, so I want the price to display £9.99 / Roll

I downloaded the file:

public_html/app/design/frontend/base/default/template/catalog/product/price.phtml

and uploaded it to:

public_html/app/design/frontend/smartwave/porto/template/catalog/product/price.phtml

So I could make changes to it without changing core files.

In this file I added the line:

<span><?php echo $_product->getAttributeText('metric') ?></span>

to line 214

This has worked perfectly on the product view pages but it has not worked for the list page (Category).

I've used the developer option on the back end and both pages are calling the code from the same file and when I inspect the item using chrome the div seems to be exactly the same and so does the css.

So not sure what I've missed, any ideas?

1 Answer 1

0

You have to configure the "metric" attribute to "Used In Product Listings" = "Yes" under Catalog > Manage Attributes, then reindex the flat product index. This is necessary to make the attribute available on category pages.

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.