Am trying to do special offers to my magento shop.Actually that is easy but actually my scenario is differs from others.My scenario is,I must get the products based on custom attribute(date of sale) and as well as product qty must be greater than zero(Qty>0).I got the products using custom attribute like,
<?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;?>
On this i got the products based on date of sale is lesser than today date.On that itself i must get products which qty is greater than 0.
give me some hopes guys?