php - Product Attributes Not Loading -
i'm adding "most viewed" section our website.
while product url loading correctly, other attributes (image, product name, price, etc) not.
any idea might doing wrong here?
<?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() $_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 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; ?>
when create attribute
1)make select display list page yes
2)assign product group
3)provide value
4)reindexing
5) add in phtml want display , case might ( echo $_product->getmostviewed() ).
Comments
Post a Comment