Hi there,
I've been in and out of Magento development for a while and am finding it hard to find any documentation that will help.
In my base/default/template/catalog/category/view.phtml, the code seems to be slightly... inconsistent.
For example, at the top we declare
$_helper = $this->helper('catalog/output');
$_category = $this->getCurrentCategory();
Yet, further down on line 56, we aren't using the $_category variable
<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
But, my real question is, with custom attributes, should I be using
$_category->getDescription() or $_helper->categoryAttribute($_category, $_description, 'description') --- how do they differ? Is one better than the other in regards to performance... is it security-related?
Thanks for any help you can offer.
@littlepixiez You can get product attribute value by below code.
$_product->getData('<your attribute name');
Same as you can get attribute value
$_category->getData('your attribute name');
I didn't realise you could get it that way. Fantastic! Do you know if there's a "correct" way of doing it? There seems to be a few ways you can get the end result.
Either way this works great for me so thank you!