User variables and affiliate program

  • Posts: 137
  • Thank you received: 2
13 years 8 months ago #10823

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #10847

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.

  • Posts: 137
  • Thank you received: 2
13 years 8 months ago #10943

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #10954

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.061 seconds
Powered by Kunena Forum