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

Change Product Page Text Based on the Category
 
hez
Sr. Member
 
Avatar
Total Posts:  103
Joined:  2008-02-02
 

For instance - I’ve changed Short Description to read Ingredients - but for the products of some categories I want that to say Contents instead.  So, I need to know how to get the category name or id.

Thanks,
Heather

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

You can create another text attribute and put there values per product (Short Description, Ingredients), and then use it in your template?

 
Magento Community Magento Community
Magento Community
Magento Community
 
hez
Sr. Member
 
Avatar
Total Posts:  103
Joined:  2008-02-02
 

Thanks Moshe!  That did the trick.  I guess I was coming at it from the wrong direction.

Just out of curiosity though - is there a way to get the current category on a product page?

Heather

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

If you add it in Custom Layout XML:

<reference name="content>
  <block type="
catalog/product_list" template="catalog/product/list.phtml"/>
</reference>
If in the template phtml:
<?=$this->getLayout()->createBlock('catalog/product_list')->setTemplate('catalog/product/list.phtml')->toHtml()?>

This will show category product list if you came to product page from a category.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ecreate
Jr. Member
 
Total Posts:  4
Joined:  2008-01-29
 

Hi,

it works’ but in product lists and product view, when I do this I always see doubled content (2 lists, and 2 product views)

what may cause it ?

Mac

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top