- Posts: 137
- Thank you received: 2
User variables and affiliate program
- emergentec
-
Topic Author
- Offline
Less
More
15 years 6 months ago #10823
by emergentec
User variables and affiliate program was created by emergentec
Hi!
We use the Hikashop-Variables in a Joomla-User-Plugin which triggers on "onUserLogin" with $user_id =& hikashop::loadUser();
It works fine, but if we deactivate the Hikashop-plugin affiliate program the Joomla-plugin doesn't work anymore, because the plugin can't load the hikashop userID. Why?
Best regards
We use the Hikashop-Variables in a Joomla-User-Plugin which triggers on "onUserLogin" with $user_id =& hikashop::loadUser();
It works fine, but if we deactivate the Hikashop-plugin affiliate program the Joomla-plugin doesn't work anymore, because the plugin can't load the hikashop userID. Why?
Best regards
Please Log in or Create an account to join the conversation.
15 years 6 months ago #10847
by nicolas
Replied by nicolas on topic Re: User variables and affiliate program
Hi,
Right after the loggin of the user, it's possible that the session is not yet initialized for the user. Please make sure that the ordering of your plugin is greater than the joomla user plugin so that the session of the user is initialized before your plugin is triggered by joomla.
Right after the loggin of the user, it's possible that the session is not yet initialized for the user. Please make sure that the ordering of your plugin is greater than the joomla user plugin so that the session of the user is initialized before your plugin is triggered by joomla.
Please Log in or Create an account to join the conversation.
- emergentec
-
Topic Author
- Offline
Less
More
- Posts: 137
- Thank you received: 2
15 years 6 months ago #10943
by emergentec
Replied by emergentec on topic Re: User variables and affiliate program
nicolas wrote:
My plugin has ordering 9 and joomla user plugin has 0 and it still doesn't work. What has the status of the affiliate plugin to do with the status of the session?Hi,
Right after the loggin of the user, it's possible that the session is not yet initialized for the user. Please make sure that the ordering of your plugin is greater than the joomla user plugin so that the session of the user is initialized before your plugin is triggered by joomla.
Please Log in or Create an account to join the conversation.
15 years 6 months ago #10954
by nicolas
Replied by nicolas on topic Re: User variables and affiliate program
The affiliate plugin initialize the hikashop framework when loaded. If you deactivate it, the hikashop framework might not be loaded before and you should load it yourself in your plugin if you need to use a funtion from hikashop like the hikashop::loadUser() function. For that you can use the line below before your code:
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true;
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true;
Please Log in or Create an account to join the conversation.
Time to create page: 0.156 seconds