2014-10-09 50 views
0

越来越Magento的图像的URL我写了在Magento的畅销产品的一些代码,但不是从畅销书

我很老的产品形象网址....

我需要的小图像画廊..

余米开发畅销书滑块.....整个事情是好的

但只有我不是让图像网址...

我的代码

$current_category = Mage::registry('current_category'); 
     $is_category_filter = Mage::getStoreConfig('productslider/product_setting/category_filter'); 
     $collection = Mage::getResourceModel('reports/product_collection') 
          ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes()) 
          ->addOrderedQty() 
          ->addMinimalPrice() 
          ->addTaxPercents() 
          ->addStoreFilter(); 
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection); 
     Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection); 
     if($current_category && $is_category_filter == '1'){ 
      $current_category_id = Mage::registry('current_category')->getId(); 
      $currentCategory = Mage::getModel('catalog/category')->load($current_category_id); 
      $collection->addCategoryFilter($currentCategory); 
     } 
     $collection->setPageSize(30); 

     $this->setProductCollection($collection); 








return $collection; 

回答

0
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(160, 225) ?>" width="160" height="225" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" /></a>