Some of the products on my page are time sensitive (events). Currently I am getting them all like this:
{% set events = craft.commerce.products.type('event').order('eventStartDate desc') %}
I can't use the expiryDate
as the end date for my event, as I am keeping an archive that I want users to be able to click though. But, I don't want to include these "expired" events in my "upcoming events" list.
I am reading through this SO thread which I think is doing the same thing I am. It's painfully obvious that I don't know what I am doing though.
{% set today = now %}
{% set events = craft.commerce.products.type('event').eventEndDate('>= today') %}
: Call to a member function getTimestamp() on boolean
eventEndDate
is a dateTime
field type.
I am trying (and failing) to get all events that have an end date that is equal to, or before today. Once the event is over eventEndDate
is after today, I do not want to show it in my list.
Thank you for any suggestions!