php - Magento - Display a custom text in product page, only for products from specific categories -
i need show text near price products inside specific categories.
i've found code works, works 1 specific category. need put 119, 120, 121, 122 etc... more categories id, not one.
can me?
<?php $category = mage::getmodel('catalog/layer')->getcurrentcategory();?> <?php if($category->getid()==119): ?> <span class="price-specification"> <?php echo $this->__('price per meter.'); ?><br /> <?php echo $this->__('sold in multiples of three.'); ?> </span> <?php endif; ?>
to display text on more 1 specific categories, following:
- create array of category ids in want show text. example: $arr = array(19, 120, 121, 122);
now in place of
if($category->getid()==119):
put following code:
if(in_array($category->getid(),$arr)):
please let me know if have question.
Comments
Post a Comment