0

I'm using the New Products widget on my home page and I'm also using a plugin that adds some flooring attributes to products. In the regular product listings, this plugin automatically will format the price by the square foot rather than the package price. However, in the New Products widget, it shows the packet price. I tried making a new template and manually checking the attribute, but I quickly discovered that most attributes are not loading with the products at all in that widget, and therefore the template sees them as non-flooring products (and it doesn't read any other standard attributes with which I wanted to enhance the display of products). How can I fix this? How can I load the attributes for the products in the New Products widget?

<?php if ($_product->getIsFlooringProduct()): ?>
    <?php $unit = Mage::getStoreConfig('bs_flooring/general/unit');?>
    <?php echo Mage::helper('core')->currency($_product->getFinalPrice() / (float)$_product->getFlooringCoverage()) ?>/<?php echo $unit ?>
    <!-- This doesn't get rendered -->
<?php else: ?>
    <?php echo $this->getPriceHtml($_product, true) ?>
    <!-- This always gets rendered -->
<?php endif ?>
0

The product new widget as with all other standard product listings will add the attributes to the collection that are returned by the function getAttributesUsedInProductListing

Basically it will return all the attributes that have the column used_in_product_listing set to 1. This can be done via the admin or when you add your product attribute via a set-up script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.