Php MAGENTO:向“添加属性”;列表.phtml“;用于比较页面

Php MAGENTO:向“添加属性”;列表.phtml“;用于比较页面,php,magento,compare,Php,Magento,Compare,编辑:以下是我现在拥有的: _______________ 我希望此信息位于“添加到购物车”按钮上方: 下面是现在产品页面中的代码: `getProductUrl($\u item)>',true)“title=”stripTags($\u item->getName(),null,true)>>“>helper($\u item->getName(),null,true)->init($\u item,'small\u image')->resize(125,125);?>“width=

编辑:以下是我现在拥有的:

_______________
我希望此信息位于“添加到购物车”按钮上方:


下面是现在产品页面中的代码:
`getProductUrl($\u item)>',true)“title=”stripTags($\u item->getName(),null,true)>>“>helper($\u item->getName(),null,true)->init($\u item,'small\u image')->resize(125,125);?>“width=“125”height=“125”alt=“stripTags($\u item->getName(),null,true)>”/>



此模板中没有$\u产品变量,应改用$\u item->getProduct())


关于,

我如何实现这一点?用$\u item->getProduct()替换$\u product,或者在顶部添加这一行:$\u product=$\u item->getProduct();
                <h2 class="product-name"><a href="#" onclick="setPLocation('<?php echo $this->getProductUrl($_item) ?>', true)" title="<?php echo $this->stripTags($_item->getName(), null, true) ?>"><?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName(), 'name') ?></a></h2>

                <?php echo $this->getReviewsSummaryHtml($_item, 'short') ?>
                <?php echo $this->getPriceHtml($_item, true, '-compare-list-top') ?>
                <?php if($_item->isSaleable()): ?>
                    <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
                <?php else: ?>
                    <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
                <?php endif; ?>
                <?php if ($this->helper('wishlist')->isAllow()) : ?>
                    <ul class="add-to-links">
                        <li><a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist" onclick="setPLocation(this.href, true)"><?php echo $this->__('Add to Wishlist') ?></a>`
<h2>
    <?php echo (($_product->getResource()->getAttribute('hersteller')->getFrontend()->getValue($_product) && $_product->getResource()->getAttribute('hersteller')->getFrontend()->getValue($_product) != "Nein") ? $_product->getResource()->getAttribute('hersteller')->getFrontend()->getValue($_product) : ''); ?>
    <?php echo (($_product->getResource()->getAttribute('weingut')->getFrontend()->getValue($_product) && $_product->getResource()->getAttribute('weingut')->getFrontend()->getValue($_product) != "Nein") ? $_product->getResource()->getAttribute('weingut')->getFrontend()->getValue($_product) : ''); ?>
    <?php echo (($_product->getResource()->getAttribute('ob_hersteller')->getFrontend()->getValue($_product) && $_product->getResource()->getAttribute('ob_hersteller')->getFrontend()->getValue($_product) != "Nein") ? $_product->getResource()->getAttribute('ob_hersteller')->getFrontend()->getValue($_product) : ''); ?>
</h2>