|
I tried to call ->getUsedProducts() of a configurable product from design/frontend/../../template/catalog/product/view/description.phtml
My first approach looked like this:
<?php if( $_product->canConfigure() ): ?> <?php $_usedProducts = $_product->getUsedProducts(null, $_product) ?> <?php foreach($_usedProducts as $product):?> <?php if( $product->getData('isbn') != '' ): ?> <p class='isbn'> <?php echo $product->getData('design') . ' ISBN: ' ?> <span><?php echo $product->getData('isbn') ?></span></p> <?php endif; ?> <?php endforeach; ?> <?php endif; ?>
But this does not work. What is the difference to this:
<?php if( $_product->canConfigure() ): ?> <?php $_usedProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $_product) ?> <?php foreach($_usedProducts as $product):?> <?php if( $product->getData('isbn') != '' ): ?> <p class='isbn'> <?php echo $product->getData('design') . ' ISBN: ' ?> <span><?php echo $product->getData('isbn') ?></span></p> <?php endif; ?> <?php endforeach; ?> <?php endif; ?>
which creates the output?
|