Registering during checkout clears cart

  • Posts: 94
  • Thank you received: 5
  • Hikashop Business
3 weeks 2 days ago #316258

-- HikaShop version -- : 4.2.3
-- Joomla version -- : 3.9.15
-- PHP version -- : 7.3.15
-- Browser(s) name and version -- : any
-- Error-message(debug-mod must be tuned on) -- : none

I was getting complaints from random users that when they checked out, the transaction was processed but they got a blank page.

So not knowing where to look, I started trying to replicate the situation, but I made things worse somehow and I don't know where to look.

Now, when I try to register a new account during checkout, the cart is emptied and I"m directed to the Hikashop product listing (ctrl=products&task=listing) which shows nothing.

I know I did this, but I don't know how. All that I was doing is running test orders through and registering new accounts with each order.

Our checkout workflow hasn't changed. I have tried changing the options. When I searched the forums I found older references to the Joomla! user sync, but that plugin doesn't exist now (4.2.3?). I can log in and checkout and I can checkout as a guest just fine, it only happens with the registration during checkout (have switched to simple/etc to no avail).

The only server logs show up during this time look like

[06-Mar-2020 05:45:05 UTC] PHP Warning:  Invalid argument supplied for foreach() in /.../administrator/components/com_hikashop/helpers/checkout.php on line 394
[06-Mar-2020 05:45:05 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /...l/administrator/components/com_hikashop/helpers/checkout.php on line 463

I disabled cache during my testing.

This message contains confidential information

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

  • Posts: 68452
  • Thank you received: 10203
  • MODERATOR
3 weeks 2 days ago #316292

Hi,

I see that you've configured the "registration" setting of the HikaShop configuration to "guest" and in that case, there is no registration anymore on the checkout.
And I've tested your checkout, and it works fine like this.
Also, I've checked your settings and I found that in the options of the Joomla user manager, you've activated the "recaptcha" plugin of Joomla. However, this means that the registration will be refused if the captcha is not filled or missing, and on the HikaShop registration form, the Joomla captcha doesn't display. So that would explain why it doesn't let you register.
I would recommend to disable that option and instead install and configure the HikaShop ReCaptcha plugin which will work for both Joomla's registration form and HikaShop's:
www.hikashop.com/support/documentation/7...-with-recaptcha.html

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

  • Posts: 94
  • Thank you received: 5
  • Hikashop Business
3 weeks 2 days ago #316295

The users are getting registered, they just can't check out because the page is redirected and the cart contents are removed.

I had installed the Hika recaptcha but removed it when I started investigating the original problem (I wish I had just told the users they were imagining things and let it go!). I also disabled the other recaptchas that are base Joomla.

Again the users are being registered properly and receiving the email notice with their email and password. I have placed the hika recaptcha back and published it. Same result. Guest checkout works, but new users can't check out.

I am using the Improved Ajax Login/Register component, and always have. I had a custom override to display their login and offered the option for existing customers to log in. I removed all my overrides because during the research of this issue, I saw that they were from older version (3.x) of Hikashop, so I just decided to try and go base HIkashop, no mods, etc.

I can't track down why Hikashop is leaving the page. I am using the ajax checkout and that appears to be okay. I'm not getting any console errors on the client side. I have even disabled IAL, but same results.

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

  • Posts: 94
  • Thank you received: 5
  • Hikashop Business
3 weeks 2 days ago #316297

Okay, it just helps knowing that I'm not alone in trying to fix things I break. Thank you Nicolas. As I was typing my reply about users getting registered, I walked back each of my steps so I could document what I did to see what I broke. When I went in to re-install Hikashop's recaptcha and looked at the plugins, I had the Improved Ajax Login Profile plugin disabled (because why? I dunno). I may have 'unplugged' it trying to fix the registration redirect, I'm not sure.

In any case, even though I am using HIkashop for both User Registration and Edit Profile, you HAVE to have the IAL profile plugin enabled for some reason, or it breaks the Hikashop registration through checkout process. It has to be a bug, the plugin is only used in place of either the Joomla Profile plugin or a 3rd party user profile redirect like Hika.

Thanks for listening and being there! Sorry to have taken your time.

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

  • Posts: 60
  • Thank you received: 2
  • Hikashop Business
2 weeks 2 days ago #316500

Hello,
I have the same problem.
Users can registrate, they receive email to activate their account.
But if a new user prepare a cart and and registrate during checkout, when he is back with the activation link received, registration is ok but his cart is empty.
Very annoying !

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

  • Posts: 94
  • Thank you received: 5
  • Hikashop Business
2 weeks 2 days ago #316514

I thought I had my problems fixed but found they returned. I have a 3rd party plugin (Improved Ajax Login) that I thought was the issue. when I had enabled register on checkout the cart was cleared after registration and login (note that we don’t use the activation process, accounts are automatically authorized). But I had IAL use the Hikashop registration and when I disabled that in favor of the default Joomla registration I got it to work. Then reports came in later that day that it was still happening. I disabled cache temporarily and tried alternating browsers to no avail.

I have gone back to guest checkout only and have a custom html box with instructions/links for logging in or registering a new account which links them to the J! Registration directly. It seems (at least up to this point in troubleshooting) that if they register on a different page, the cart remains intact.

I have tried enabling the activation process, and that didn’t help.

I have a couple of other things to look at. For example we don’t use username, we use email only so I am going to see if some of our other plugins that we use to log the use in are to blame. Note though that logging in an existing user from the cart works fine everytime...its just the register during checkout that doesn’t work for me.

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

  • Posts: 68452
  • Thank you received: 10203
  • MODERATOR
2 weeks 2 days ago #316502

Hi,

This issue of loosing the cart after the activation link is clicked on would usually happen if you actually open the activation link with another browser than the one you used for registration.
We actually made a improvement to the system with HikaShop 4.2.3 to attach the cart to the user account directly after the creation of the user account so that if there is a user activation via email done via another browser, the cart is not lost.
So if you don't have HikaShop 4.2.3, I would recommend updating.
If not, then your problem is different. We would need a link to your shop in that case to be able to check on the situation.

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

  • Posts: 60
  • Thank you received: 2
  • Hikashop Business
2 weeks 1 day ago #316542

Thank you Nicolas.
In fact, this issue of loosing the cart happens even when the activation link is opened with the same browser than the one you used for registration.
I'm using HikaShop Business 4.2.3.

This message contains confidential information

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

  • Posts: 94
  • Thank you received: 5
  • Hikashop Business
2 weeks 1 day ago #316544

And for us, again, we don't use the 2-step registration link, so that isn't the issue for us. Users are automatically logged in after registration.

Thierry, is your site set up to automatically log the user in after activation? If so, maybes its the auto-login process that is losing the connection to the original cart.

Since our users don't leave the browser since there is no activation link to click on, etc., the cart is still gone from the session (it remains in the database). Note that when we implemented an external (external to Hiikashop) registration link...the visitor leaves the cart page to fill in the registration...when they complete the registration and are automatically logged in the cart is intact. In tests, if we don't use the register process of hikashop, everything works perfectly.

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

  • Posts: 60
  • Thank you received: 2
  • Hikashop Business
2 weeks 1 day ago #316547

Thierry, is your site set up to automatically log the user in after activation?

No, we use activation link.

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

  • Posts: 68452
  • Thank you received: 10203
  • MODERATOR
1 week 6 days ago #316578

Hi,

Thank you for the additional information on the issue.
Thanks to that, I was able to reproduce the issue and found the solution.
I've added a patch on our end for it.
Download the install package of the 4.2.3 on our website and install it on yours and you'll get the fix.

The following user(s) said Thank You: stratacorps, Thierry H.

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

  • Posts: 60
  • Thank you received: 2
  • Hikashop Business
1 week 6 days ago #316580

Well done, Thanks Nicolas !

I've downloaded the patched 4.2.3 and it works now. The cart is kept when the user is back with the activation link.

Last edit: 1 week 6 days ago by Thierry H..
The following user(s) said Thank You: Philip

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

  • Posts: 94
  • Thank you received: 5
  • Hikashop Business
1 week 6 days ago #316597

I too can confirm that my site is working as well. I re-enabled the IAL (ajax login/register 3rd party) and it works with Hikashop Registration too. Thanks again for your help. As I may have said before, its nice when people still listen to you even if they think you are crazy :silly:

Last edit: 1 week 6 days ago by stratacorps.
The following user(s) said Thank You: Thierry H.

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

Time to create page: 0.084 seconds
Powered by Kunena Forum