2016-08-23 11 views
0

私は、「よく見る」セクションを当社のウェブサイトに追加しています。商品の属性がロードされていません

商品URLは正しく読み込まれていますが、他のすべての属性(画像、商品名、価格など)は正しくありません。

私はここで間違っているかもしれないと思っていますか?あなたはその後、

1)を選択し、表示リストページを作成する属性の作成時にはい

2)製品グループ

3)に

<?php if (($_products = $this->getProductCollection()) && $_products->getSize()): ?> 
<div class=" most_viewed"> 
<?php  $_productCollection=$this->getLoadedProductCollection(); 
    $_helper = $this->helper('catalog/output'); ?> 
<?php $_collectionSize = 5;//count($_products->getItems()); echo $_collectionSize; ?> 
    <?php $_columnCount = 4; ?> 
<div class="category-products"> 
<ul class="products-grid"> 
    <?php $i=1; foreach ($_products->getItems() as $_product): ?> 
    <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>"> 

      <a class="product-image" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>"> 
       <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" /> 
      </a> 
       <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2> 

       <?php if($_product->getRatingSummary()): ?> 
        <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?> 
       <?php endif; ?> 
       <?php echo $this->getPriceHtml($_product, true) ?> 
       <div class="actions"> 
        <?php if($_product->isSaleable()): ?> 
         <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $_product->getProductUrl() ?>')"><span><span><?php echo $this->__('Details') ?></span></span></button> 
        <?php else: ?> 
         <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p> 
        <?php endif; ?> 
           </div> 
    </li> 
<?php $i++; endforeach; $kol = $_collectionSize; ?> 
</ul> 
</div> 
</div> 
<?php endif; ?> 

答えて

0

割り当てることは、いくつかの値

4)再インデックスを提供します

5)あなたが表示したい場所にphtmlを追加します(echo $ _product-> getMostViewed())になります。

関連する問題