So i have created a attributes is future_date


Now i want to filter product based on this attribute. I want to filter product whatever match with this date. For an example we setup a date 5th June and today is 28th May. But when i filter at 5th June this product will be in filtered list. How can i achive this?


If You want to get product collection which has future date is current date,

You the following code :

$today = date("Y-m-d");
$collection = Mage::getResourceModel('catalog/product_collection')
             ->addAttributeToFilter('future_date', array('eq' => $today))

I think it will help you..

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.