[Skip to main content](#vessel-content)

#   User ID for autologin

##

- **[peteritv](/forum/user/12073-peteritv "View peteritv's Profile")**
- [![peteritv's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12073-peteritv "View peteritv's Profile") Topic Author
- [ Offline](/forum/user/12073-peteritv)

Less More

- Posts: 21
- Thank you received: 0
-
-

13 years 7 months ago [\#95524](#95524) by [peteritv](/forum/user/12073-peteritv "View peteritv's Profile")  *[User ID for autologin](/forum/2-general-talk-about-hikashop/79499-user-id-for-autologin#95524 "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")* was created by *[peteritv](/forum/user/12073-peteritv "View peteritv's Profile")*

Hi guys,

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&amp;view=order&amp;layout=listing'; $user =&amp; JFactory::getuser($data-&gt;customer-&gt;id); $ursl = HIKASHOP_LIVE . $link . '&amp;user=' . $user-&gt;get('username') . '&amp;passw=' . $user-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NDk5LXVzZXItaWQtZm9yLWF1dG9sb2dpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 7 months ago [\#95584](#95584) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[User ID for autologin](/forum/2-general-talk-about-hikashop/79499-user-id-for-autologin#95584 "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")*

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: Code:

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

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

The following user(s) said Thank You: [peteritv](/forum/user/12073-peteritv "View peteritv's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NDk5LXVzZXItaWQtZm9yLWF1dG9sb2dpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[peteritv](/forum/user/12073-peteritv "View peteritv's Profile")**
- [![peteritv's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12073-peteritv "View peteritv's Profile") Topic Author
- [ Offline](/forum/user/12073-peteritv)

Less More

- Posts: 21
- Thank you received: 0
-
-

13 years 7 months ago [\#95615](#95615) by [peteritv](/forum/user/12073-peteritv "View peteritv's Profile")  Replied by *[peteritv](/forum/user/12073-peteritv "View peteritv's Profile")* on topic *[User ID for autologin](/forum/2-general-talk-about-hikashop/79499-user-id-for-autologin#95615 "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")*

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-&gt;id or $customer-&gt;user_cms_id;

Thanx for your help!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NDk5LXVzZXItaWQtZm9yLWF1dG9sb2dpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.189 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
