Pulling product information in templates
Posted: 16 Feb 2017, 07:22
I am having trouble with $productItem->getRefItems( 'text', 'short', 'default' ) function, as it returns empty array. I have the demo product database installed, and have short and long text associated with the Demo article out of the box, however cannot see not only the short text in the catalog/lists component, but the product price either. I am talking about template in ext/ai-client-html/client/html/templates/catalog/lists/items-body-default.php.
There is a foreach loop in items-body-default.php starting around line 122:
<?php foreach( $productItem->getRefItems( 'text', 'short', 'default' ) as $textItem ) : ?>
<div class="text-item" itemprop="description">
<?php echo $enc->html( $textItem->getContent(), $enc::TRUST ); ?><br/>
</div>
<?php endforeach; ?>
which gets skipped because $productItem->getRefItems( 'text', 'short', 'default' ) returns empty array.
There is a foreach loop in items-body-default.php starting around line 122:
<?php foreach( $productItem->getRefItems( 'text', 'short', 'default' ) as $textItem ) : ?>
<div class="text-item" itemprop="description">
<?php echo $enc->html( $textItem->getContent(), $enc::TRUST ); ?><br/>
</div>
<?php endforeach; ?>
which gets skipped because $productItem->getRefItems( 'text', 'short', 'default' ) returns empty array.