Product Scheduling - Schedule to disable/delete Product if the custom date field is in the past
I am looking to use a rule that whenever the cron is run, it will update the status of any products that has a custom date field set into the past.... so basically, I'm looking for a product (course) to expire on the site after the start time of the class pass (after a cron run). I currently have all the classes and time variations as separate products.
I'm not familiar with creating too many rules within Drupal, but I believe this is the way to go. I have looked all over for a solution, and even tried several ways myself, but I am coming up short. I would love to hear any ideas even if it doesn't involve rules. There is an easy way to unpublish content, but not products.
Here's what I got so far...
Event
Cron maintenance tasks are performed
Conditions
Entity exists by property
Parameter: Entity type: Commerce Product, Property:Status, Value:true
Data comparison
Parameter: Data to compare:????, Operator: is greater than, Data value:[site:current-date]
Actions
????
I can't figure out the data comparison parameter to get the custom field under Products: $field_date. I'm assuming you use php validation. And then in the actions I'm assuming you use a loop to fetch an entity by property and then save entity? Possibly in a loop...?
Any and all help would be appreciated! Thanks!