没有促销产品的畅销书页面过滤(特价)-magento

Bestseller page filtration without on sale products (special price) - magento

我有加载畅销产品集合的畅销书页面。我想从此页面中删除所有促销产品。 这部分代码我有:

$collection = Mage::getResourceModel('catalog/product_collection');

Mage::getModel('catalog/layer')->prepareProductCollection($collection);

$attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
$collection->addIdFilter($productIds)
           ->addAttributeToSelect($attributes)
           ->addMinimalPrice()
           ->addFinalPrice();
$this->_productCollection = $collection;
$this->_productCollection->load();

并且我添加了 ->addAttributeToFilter('special_price', array('null' => true)) 但它不起作用:

$collection = Mage::getResourceModel('catalog/product_collection');

Mage::getModel('catalog/layer')->prepareProductCollection($collection);

$attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
$collection->addIdFilter($productIds)
           ->addAttributeToSelect($attributes)
           ->addAttributeToFilter('special_price', array('null' => true))
           ->addMinimalPrice()
           ->addFinalPrice();
$this->_productCollection = $collection;
$this->_productCollection->load();

天哪

我检查了我的例子,它是有效的 我的文件

中有 special_price 的特价 instide