0
畅销书滑块我需要在Magento打造畅销书.... 我一些代码line..but它不工作..如何创建Magento的
我需要知道什么喊我修改这个代码... 的畅销书....
$todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
$collection = Mage::getResourceModel('catalog/product_collection');
$collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
$collection = $this->_addProductAttributesAndPrices($collection)
->addStoreFilter()
->addAttributeToFilter('special_from_date', array('or'=> array(
0 => array('date' => true, 'to' => $todayDate),
1 => array('is' => new Zend_Db_Expr('null')))
), 'left')
->addAttributeToFilter('special_to_date', array('or'=> array(
0 => array('date' => true, 'from' => $todayDate),
1 => array('is' => new Zend_Db_Expr('null')))
), 'left')
->addAttributeToFilter(
array(
array('attribute' => 'special_from_date', 'is'=>new Zend_Db_Expr('not null')),
array('attribute' => 'special_to_date', 'is'=>new Zend_Db_Expr('not null'))
)
)
->addAttributeToSort('special_from_date', 'desc')
->setPageSize($this->getProductsCount())
->setCurPage(1)
;