Mass- Action works only when manually triggered

  • shashankkouloorkar
  • Topic Author
6 years 7 months ago #278307

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5

Hello,

I have created two mass- actions- "Free Group" and "Paid Group". The free group mass- action allows the user to add all the courses for free when the user selects any one of the values from the field- "Sports and Recreation Organisations" other than, "Not applicable". The changes in the user's group occur only after I manually click "Process" on the mass- action. I have also created a Cron task to run every 2 secs but, sadly, it doesn't. Please assist.

Thank you,

Shashank. K

Attachments:
Last edit: 6 years 7 months ago by shashankkouloorkar.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
6 years 7 months ago #278312

Hi,

That's normal. The address is not yet saved in the database when the user is created.
So the mass action system cannot yet see the address data the user entered.

Regarding the cron task, note that even if you configure the mass action to be called every two seconds, if the use the cron task triggering system from our server, you're limited to one cron task every 15 minutes.

Also, when you change the user groups of a user in the database, if the user is already logged in, he will only see the change in his access rights after logging out and in again as Joomla ACL system has caching of the rules.

If you want to set the user group of the user during the registration based on what the user select, I would recommend to use instead the setting "User group on registration" of the HikaShop configuration.
If you select a custom field there, the system will set the user group of the user during the registration matching its user group id with the value selected by the customer.
So if you have values like that in your custom field:
12 registered normal user
20 special user
based on the selection of the customer, he will be added to either the user group with the id 12 or with the id 20.

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

  • shashankkouloorkar
  • Topic Author
6 years 7 months ago #278407

Hello again, Nicolas

I would like the mass- action "process" to work as soon as the user is created, based on the user field selection. I'm afraid, I am unable to follow your instruction. Would it be possible to look into my site's backend?

Thank you,
Shashank. K

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
6 years 7 months ago #278442

Hi,

Even if you ask me to look, I can't fix something that is already working as expected.
As I said, it's totally normal that your mass action is not processed when the user is created if you use the "after a user is created" trigger since the address data is not yet in the database at that point and thus you can't use filters on the address data.
What you can do is create a custom field of the table "user" instead of the table "address". It will also display on the registration form but the custom user fields are saved along with the user account and thus you can use mass action filters on them in the "after a user is created" trigger.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum