Magento- Adding Short Description to the View Cart page
magento默认的购物车如下:
At line 34, 找到如下
<h2>
<?php if ($this->hasProductUrl()):?>
<a href=”<?php echo $this->getProductUrl() ?>”><?php echo $this->htmlEscape($this->getProductName()) ?></a>
<?php else: ?>
<?php echo $this->htmlEscape($this->getProductName()) ?>
<?php endif; ?>
</h2>
我们在下面加入如下代码:
<?php
$custom = Mage::getModel(‘catalog/product’)->load($_item->getProductId());
echo $custom->getShortDescription();
?>
将会出现下面的图片样子的short description:
当您有其他自己加入的属性也想让他显示出来,可以这样:如下!
<h2>
<?php if ($this->hasProductUrl()):?>
<a href=”<?php echo $this->getProductUrl() ?>”><?php echo $this->htmlEscape($this->getProductName()) ?></a>
<?php else: ?>
<?php echo $this->htmlEscape($this->getProductName()) ?>
<?php endif; ?>
</h2>
<?php
$custom = Mage::getModel(‘catalog/product’)->load($_item->getProductId());
echo $custom->getdimensions();
?>
<?php
$custom = Mage::getModel(‘catalog/product’)->load($_item->getProductId());
echo $custom->getShortDescription();
?>