I created a drop-down attribute called "marketing" with 2 values : "sale" & "new" and I like to use a cron script that check every day :
- if a product has a special price (or a catalog rule) => attribute "marketing" set to "sale"
- if a product has no special price => attribute "marketing" empty
- if a product is set to new from/to date => attribute "marketing" set to "new" or nothing
Idea is to filter in a catalog list all products that are "on sale" or "new". I know ho to check the conditions but not how to set the correct value for this attribute.
Best Answer
In your cron script, you can add the below code to fetch
marketing
dropdown attribute all options and values.then you can use directly value to set the data in product like below:
Hope this help !!