目前我在crosselling.phtml中有这个:
<?php if($this->getItemCount()): ?>
<div class="crosssell">
<h2><?php echo $this->__('Service:') ?></h2>
<ul id="crosssell-products-list">
<?php foreach ($this->getItems() as $_item): ?>
<li class="item">
<a class="product-image" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(75, 75); ?>" width="75" height="75" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a>
<div class="product-details">
<h3 class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h3>
<?php echo $this->getPriceHtml($_item, true) ?>
<p><?php
$custom = Mage::getModel('catalog/product')->load($_item->getProductId());
echo $custom->getAttributeText('servicetekst');
?></p>
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<ul class="add-to-links">
</ul>
</div>
</li>
<?php endforeach; ?>
</ul>
<script type="text/javascript">decorateList('crosssell-products-list', 'none-recursive')</script>
</div>
<?php endif; ?>
除了自定义属性“servicetekst”之外,所有内容都可以正常加载。从这里开始,我不确定如何继续?
答案 0 :(得分:0)
我找到了一些对我有用的东西,用于在crossell模板Magento 1.9.2.2中显示自定义属性。这很容易。
modify()
确保&#34;用于产品清单&#34;设置为&#34;是&#34;和reindex。