0

So i have created a attributes is future_date

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?

1 Answer 1

2

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))
             ->addAttributeToSelect('*')
             ->load();

I think it will help you..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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