Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

need to get products close to “today”
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

Hello - I have a product set with a custom attribute “event_date”
I need to be able to pull “upcoming” products

I would like to either:
1) sort by date / attribute but only grab ones that are close to today (ones in the future, but closest to today’s date...) - most like via “getModel(’catalog/products’)…

or

2) Sort by date attribute within a .phtml file.

I was hoping magento might have a useful way to accomplish number 1, otherwise I need to find a PHP way to sort through a product collection and reorganize based on a custom attribute!

Anyone have any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

Looks like i’ll have to sort by date attribute via the .phtml template file I’m using...I was hoping for a “faster” solution (via sql...hoping magento had something that would handle this in their Model?? - but I don’t have a clear enough understanding of how their Model retrieves info from the DB yet)

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top