Cannot get new product attribute in grid display
Posted
by russjman
on Stack Overflow
See other posts from Stack Overflow
or by russjman
Published on 2010-04-07T23:03:35Z
Indexed on
2010/04/08
0:53 UTC
Read the original article
Hit count: 316
I added a new attribute to my products(a boolean "yes/no" field). It is a variable to enable/disable the price from displaying on the product detail page, and grid view.
I managed to get it work on the product info page. But on product grid page I cant seem to access that variable. Specifically, the template i am working with is catalog/product/price.phtml. From what i can tell, the price is being displayed by the same group of if-statements on both the product detail page, and grid page. This has me confused because i cant find any code on that template to handle multiple products, just a bunch of nested if statements.
this is how im attempting to access this new variable using $_displayPrice. on line 36 of catalog/product/price.html
<?php $_product = $this->getProduct(); ?>
<?php $_id = $_product->getId() ?>
<?php $_displayPrice = $_product->getDisplayPrice() ? "Yes" : "No";
echo $_displayPrice;?>
What has me further confused is that when display $_product->getData(), my new variable isn't anywhere among that data.
thanks in advance
© Stack Overflow or respective owner