Skip to main content

User variables and affiliate program

More
15 years 6 months ago #10823 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

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

More
15 years 6 months ago #10847 by nicolas
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.

More
15 years 6 months ago #10943 by emergentec
nicolas wrote:

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.

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?

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

More
15 years 6 months ago #10954 by nicolas
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;

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

Time to create page: 0.156 seconds
Powered by Kunena Forum