-- HikaShop version -- : 4.1.0
-- Joomla version -- : 3.9.8
-- PHP version -- : 7.2.24
Hi,
I need to record which (admin) user last modified (or created) a product.
Good, so I created a custom product field with column name "product_modified_by". Pity is that in the settings of the custom field the display in the backend form can't be disabled, but no problem, I deleted the field again and. hooray, the column is still in the #__hikashop_product table. Changed it to INT(11) because I want to store the user ID there.
Off to creating a mass action...
Data: Product
Triggers: After a product is updated
Filters: none selected
Limitations: left at default (0/500)
Actions: Update the values... product_modified_by
I reckon INT won't work as I doubt a non-INT value or placeholder or so could be used. So I tried operations and various references, such as user.user_id, users.id, u.id etc etc, but when saving a product I always get "Table xyz doesn't exist".
1. How can I get the ID of the current (admin) user having created/edited the product and use it in the product-related mass action?
2. Triggers: obviously I'll need this to work on after a product is both created or updated. If I add both triggers in the same mass action, I see "And". Is that indeed the logical AND (as in both must be true, which in this case is not going to work and I'll need two mass actions, one for each trigger), or can I interpret it as OR, means I can use both in one and the same mass action? "Trial & error" would show me, of course, but your briefest answer here will be much appreciated, perhaps by others as well.
3. Just thinking... I can't imagine me being the only one needing this or, at least, finding it very helpful. Wouldn't it be nice if the column and function were there by default? Probably no further to-do required at this point... I bet that anyone who'll need it will figure it out, also how to access and make use of the data.
Thanks in advance!