User ID for autologin

  • Posts: 21
  • Thank you received: 0
11 years 8 months ago #95524

Hi guys,

I need to put an autologin link into the order status change e-mails, and I am experimenting with this code:

$link = 'index.php?option=com_hikashop&view=order&layout=listing';
$user =& JFactory::getuser($data->customer->id);
$ursl = HIKASHOP_LIVE . $link . '&user=' . $user->get('username') . '&passw=' . $user->get('password');

However, this gives me my own credentials, and not those of the customer (as I would have expected).

Any idea what I am doing wrong?

Greetz,
Peter

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

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #95584

Hi,

By default in Joomla there is no way to auto login. This can work only if you use a plugin for that.
The infos about the customer in the email are in the object "$customer". I think that you can use:

$link = 'index.php?option=com_hikashop&view=order&layout=listing';
$user =& JFactory::getuser($customer->id);
$ursl = HIKASHOP_LIVE . $link . '&user=' . $user->get('username') . '&passw=' . $user->get('password');

Not sure for "$customer->id" thanks to use var_dump() function to see what is present in this object.

The following user(s) said Thank You: peteritv

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

  • Posts: 21
  • Thank you received: 0
11 years 8 months ago #95615

Hi Xavier,

Yes, I am using the plg_autologin2.5 plugin for the autologin (which works perfect).

I am (still) a PHP novice, so I didn't know about var_dump()...
As you told, the correct customer id is in $customer->id or $customer->user_cms_id;

Thanx for your help!

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

Time to create page: 0.066 seconds
Powered by Kunena Forum