我正在尝试为我的magento商店提供特别优惠。事实上,这很容易,但实际上我的场景与其他场景不同。我的场景是,我必须根据自定义属性(销售日期)获得产品,并且产品数量必须大于零(数量>0)。我使用自定义属性获得的产品如下,
<?php
$collection = Mage::getResourceModel('catalogsearch/advanced_collection')
->addAttributeToSelect(Mage::getSingleton('catalog/config')- >getProductAttributes())
->addMinimalPrice()
->addStoreFilter();
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
$collection->addAttributeToFilter('date_sale', array('lt' => $todayDate));
return $collection;?>
在这个问题上,我得到的产品基于销售日期小于今天的日期。就这一点而言,我必须得到数量大于0的产品。
给我一些希望,伙计们?