- Posts: 21
- Thank you received: 0
User ID for autologin
13 years 6 months ago #95524
by peteritv
User ID for autologin was created by peteritv
Hi guys,
I need to put an autologin link into the order status change e-mails, and I am experimenting with this code:
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
I need to put an autologin link into the order status change e-mails, and I am experimenting with this code:
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.
13 years 6 months ago #95584
by Xavier
Replied by Xavier on topic User ID for autologin
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:
Not sure for "$customer->id" thanks to use var_dump() function to see what is present in this object.
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:
Code:
$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.
13 years 6 months ago #95615
by peteritv
Replied by peteritv on topic User ID for autologin
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!
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.149 seconds