How to displaying custom attributes in the Product Listing Page
Step1.
->In your custom attribute properties, the scope should be set to global.
->Set Yes to "Visible on product view page on Front-end"
->Set Yes to "Used in Product Listing"
Step2. Open your template. Goto Catalog->Product->list.phtml
Step3. There are 2 mode in list.phtml. Grid and list mode. Write in both block.
<?php if($_product->getattribute name()): // eg getProductname. It should be in camel case.
echo $_product->getattribute name(); // eg getProductname. It should be in camel case.
endif;
?>
Step1.
->In your custom attribute properties, the scope should be set to global.
->Set Yes to "Visible on product view page on Front-end"
->Set Yes to "Used in Product Listing"
Step2. Open your template. Goto Catalog->Product->list.phtml
Step3. There are 2 mode in list.phtml. Grid and list mode. Write in both block.
<?php if($_product->getattribute name()): // eg getProductname. It should be in camel case.
echo $_product->getattribute name(); // eg getProductname. It should be in camel case.
endif;
?>
No comments:
Post a Comment