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

#   Card empty after registration

##

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

Less More

- Posts: 228
- Thank you received: 8
-
-

9 years 9 months ago [\#262388](#262388) by [theguy](/forum/user/32584-theguy "View theguy's Profile")  Replied by *[theguy](/forum/user/32584-theguy "View theguy's Profile")* on topic *[Card empty after registration](/forum/27-checkout/888505-card-empty-after-registration?start=20#262388 "As a guest user I add some product to the card. It direct to checkout and ask for personal data. I press the registration button. After this I'm redirected to the main page of the shop (product listings) and the cart is empty. The user sync plugin is published. Session management is set to database 30 min. I don't use SSL at all. If I log out and then add the product to the cad again and then login with my user the cart is cleared again. If I add something to the card when I'm logged in than it remembers. I log out, and log in again and it is in the cart. It is OK like this.  I think if there is something in the card the registration should preserve it.")*

Hi Nicolas,

Once again, thank you for the quick replay.

1. I've gone through the new user process once more. Made sure the user is not in the system (under user management in Joomla and under customers in Hikashop - see attached screen shot) and still got the empty cart error. I've prepared a video so you can see the error yourself:
[ drive.google.com/open?id=0B6Nv482xa\_RDSEFpeGJZeHg4Yzg](https://drive.google.com/open?id=0B6Nv482xa_RDSEFpeGJZeHg4Yzg)

2. I've opened a new thread with the bug report.

As for the bugs I'm getting, I wouldn't mind contributing and informing of this bugs just not on a client's website ![;)](/media/kunena/emoticons/24.png ";)")

Thank you,

Guy.

- [ ![users.jpg](/forum/attachment/36351) ](/forum/attachment/36351 "users.jpg") [ ](/forum/attachment/36351?download=1 "users.jpg")

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 9 months ago [\#262442](#262442) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Card empty after registration](/forum/27-checkout/888505-card-empty-after-registration?start=20#262442 "As a guest user I add some product to the card. It direct to checkout and ask for personal data. I press the registration button. After this I'm redirected to the main page of the shop (product listings) and the cart is empty. The user sync plugin is published. Session management is set to database 30 min. I don't use SSL at all. If I log out and then add the product to the cad again and then login with my user the cart is cleared again. If I add something to the card when I'm logged in than it remembers. I log out, and log in again and it is in the cart. It is OK like this.  I think if there is something in the card the registration should preserve it.")*

Hi,

In the file "components/com_hikashop/controllers/checkout_legacy.php", please replace Code:

$cartClass = hikashop_get('class.cart'); $cartClass-&gt;get('reset_cache'); $this-&gt;initCart(true); $this-&gt;cart_update = true; $userClass = hikashop_get('class.user'); $user_id = $userClass-&gt;getID($user-&gt;get('id')); if(!empty($user_id)) { $app-&gt;setUserState(HIKASHOP_COMPONENT.'.user_id', $user_id); }

By Code:

$userClass = hikashop_get('class.user'); $user_id = $userClass-&gt;getID($user-&gt;get('id')); if(!empty($user_id)) { $app-&gt;setUserState(HIKASHOP_COMPONENT.'.user_id', $user_id); $hk_user = hikashop_loadUser(true, true); } $cartClass = hikashop_get('class.cart'); $cartClass-&gt;get('reset_cache'); $this-&gt;initCart(true); $this-&gt;cart_update = true;

It should force the cleaning of the user in the session before the reloading of the cart.
Because the function "initCart" can redirect you to the page with the message "empty cart" ; we have to be sure that HikaShop can load correctly the user cart.

We also submitted a patch recently in the plugin "system / hikashopuser" ; it could avoid issues with the reloading of the cart just after a login is performed.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 228
- Thank you received: 8
-
-

9 years 9 months ago [\#262520](#262520) by [theguy](/forum/user/32584-theguy "View theguy's Profile")  Replied by *[theguy](/forum/user/32584-theguy "View theguy's Profile")* on topic *[Card empty after registration](/forum/27-checkout/888505-card-empty-after-registration?start=20#262520 "As a guest user I add some product to the card. It direct to checkout and ask for personal data. I press the registration button. After this I'm redirected to the main page of the shop (product listings) and the cart is empty. The user sync plugin is published. Session management is set to database 30 min. I don't use SSL at all. If I log out and then add the product to the cad again and then login with my user the cart is cleared again. If I add something to the card when I'm logged in than it remembers. I log out, and log in again and it is in the cart. It is OK like this.  I think if there is something in the card the registration should preserve it.")*

I'll give it a shot. Thank you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4ODUwNS1jYXJkLWVtcHR5LWFmdGVyLXJlZ2lzdHJhdGlvbj9zdGFydD0yMCZ0bXBsPW1hcmtkb3du) 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.062 seconds

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