on ‎2018 Aug 28 5:51 PM
I have a custom attribute called visibility in CategoryModel and it can be changed both from backoffice manually and from a cronjob which checks whether there is at least one product under the category. If it is changed from backoffice, cronjob should not change the visibility even if any product is found under it. When an attribute is changed from backoffice, section called Last Changes in Backoffice registers changes related to attribute but I could not find how or where it is done.
How can I find out the place where an attribute of a model changes? From Backoffice or Cronjob or something like that?
Request clarification before answering.
I assume this visibility attribute is a boolean value. True means visible and false means not visible.
Now a simple way to achieve what you wish to do is rather than having a boolean value, have a string value.
value 'A' means visible to users but edited from backoffice requesting Mr. Cronjob to not touch it.
value 'B' means visible to users but edited from backoffice allowing Cronjob to change/update it.
value 'C' means not visible to users but edited from backoffice requesting Mr. Cronjob to not touch it.
value 'D' means not visible to users but edited from backoffice allowing Cronjob change/update it.
blank value means not visible to users but cronjob can update it.
so rather than your website manager changing the visibility to true/false, he can change it to A/C and cronjob won't touch it.
Hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
related to attribute but I could not find how or where it is done.
it's called Saved values mechanism, however not sure that it will satisfy your requirement completely because how can you guarantee that change detected in the saved values is THE last change? I would recommend making your visibility attribute a bit more complex and write down along with actual value also the system made last change. In such a way you will always know what component made the last change.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe a Interceptor would help here. Had a similar issue many years ago. You can add logs and search if a backoffice user did the changes etc. Check here for more informations: https://help.hybris.com/1808/hcd/8bfbf43e8669101480d0f060d79b1baa.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.