0

On our item page we have a block that says "product name is available for purchase in increments of amount" I would like to change product name to product sku. Here is how the original code looks ...

<?php if ($this->getProductQtyIncrements()) : ?>
<div class="product-pricing">
    <?php echo $this->__('%s is available for purchase in increments of %s', $this->getProductName(), $this->getProductQtyIncrements()) ?>
</div>
<?php endif ?>

I tried changing $this->getProductName() to $this->getProductSku() or to $this->getSku() and nothing shows up. What am I missing?

0

1 Answer 1

1

In Mage_CatalogInventory_Block_Qtyincrements is no function that can do this.

This schould work:

Mage::registry('current_product')->getSku()

Edit: just for information why $this->getProductName() works:

/**
 * Retrieve current product object
 *
 * @return Mage_Catalog_Model_Product
 */
protected function _getProduct()
{
    return Mage::registry('current_product');
}

/**
 * Retrieve current product name
 *
 * @return string
 */
public function getProductName()
{
    return $this->_getProduct()->getName();
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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