User points

  • Posts: 197
  • Thank you received: 13
1 year 2 months ago #355629

-- HikaShop version -- : 5.0.0
-- Joomla version -- : 4.3.4

Hi
Can you please tell me how can I set a mass action to run a php code when i change user points value ?
my php code sends a SMS to user, I also want to to put user's name and the amount of points in a variable

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
1 year 2 months ago #355633

Hi,

How are the user points being changed ?
I suppose that in most cases, you'll want to use two mass actions.
1. First, a mass action with a trigger "before a user is updated" with an action "run PHP code". And in your PHP code, you'll want to:
- use the tag {user_id} to run a MySQL query to get the value of the points from the user_points column of the hikashop_user table
- store that value in $_SESSION
2. Second, a massaction with the "after a user is updated" trigger with an action "run PHP code" where first you check {user_points} against the value in $_SESSION. If it's the same, you return (because it means the number of points didn't change). If it's different, you run your SMS sending code.

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

  • Posts: 197
  • Thank you received: 13
1 year 2 months ago #355648

I exactly want to do this the way you described

The following user(s) said Thank You: nicolas

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

Time to create page: 0.056 seconds
Powered by Kunena Forum