badge "new"

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
7 years 2 months ago #262403

Hi,

So it looks like your cron task is running.
So I've reviewed the whole thread as I didn't know about that ultimo_aggiornamento field.
And I found out that it was a custom product field of the type "advanced date picker".
Your problem is actually with that.
The mass actions system will compare dates using the unix timestamps (number of seconds from the 1st of January 1970).
So when you write {time} - 5184000, it will take the current date in unix timestamp, substract 5184000 and you'll get something like that: 1487152952 - 5184000 = 1481968952
And then, the system will add the condition ultimo_aggiornamento < 1481968952 in the query to get all the products matching.
However, advanced date picker fields do not store their date in unix timestamp. They use another format which is adapted in order to run the algorithm for all the restrictions of these custom fields. And thus, the condition will always be wrong and thus it won't give back any product.
That's why you think the mass action doesn't work.
If you were using the product_created or product_modified field instead of a custom field, the mass action would work as the column would also use the unix timestamp format.
Thus, in your case, a mass action with a custom product field of the type advanced date picker is not possible.
But from what I understand, you're selecting in that custom field the last time the product was updated, which is what the product_modified column already does automatically. So why not simply use that column in your mass action and get ride of that custom field ? It would be less hassle to manage, and the mass action would work fine.

The following user(s) said Thank You: french150

Please Log in or Create an account to join the conversation.

  • Posts: 106
  • Thank you received: 0
7 years 2 months ago #262496

So i use product_created for manage mass action to remove or add "new" badge and product_modified about "updated" badge.
Thanks.
Best regards

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum