Checkout-Form problems

  • Posts: 26
  • Thank you received: 0
11 years 5 months ago #10321

Hello,


1) I observed that the option in configuration / checkout / registration => no registration does not show a checkout-form without a registration. It shows the "simplified registration" form.

2) If a anonym customer add product to the cart and is going to register the first time from within the chekout-form, then after registration the cart is empty and the customer has to buy again.

3) If a customer add a product to the cart and login from within the checkout-form, all added products are lost and under some circumstances he will see other products from an unfinished shopping he made earlier. In example: customer logged in, add products to the cart, does not finish the checkout and klick logout instead. Next time he is shopping without being logged in, add products to the cart, go to the checkout-form and login now. All added products are lost and in the checkout-form he will see the products from his last unfinished shopping.


Thanks

Andreas

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

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 5 months ago #10324

Hi,

1. The "no registration" and "simplified registration" forms are the same. That's normal. The difference between both is that with the simplified registration, an account is automatically created for you and an email with the account information is sent to you. If you don't want at all to handle users and addresses (addresses are linked to the users), you can remove the views "login_address_" from the checkout workflow. That will have several drawbacks though: your users won't get any email from hikashop, they won't be able to access their order details page, and you won't know their address.
Note that the "no registration" and "simplified registration" forms only have the email field, if you want to personalized the address fields, you need to go in the menu Display->Custom fields. The login form can be removed with some CSS if not needed.

2. and 3. That shouldn't be the case, unless you unpublished the user synchronization plugin which helps keeping the cart in the session while the user is logged in. Please make sure that this plugin is published.

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

  • Posts: 26
  • Thank you received: 0
11 years 5 months ago #10329

Hello,

thank you for your quick response.
Unfortuanetly I've forgotten to enable the Sync-Plugin.

Regarding topic 1 again.
I talked with the shop owner and he wants to offer an order-form / checkout-form with registration and optional without registration. If a customer add products and finally go to checkout, the customer should have the option to fill out a adress form, email, no password and that's it.

It is for spontaneously shopping. In my opinion it makes sense to keep such spontaneously customer records in a separate table. This gives the shop owner the opportunity to clear the table if spam happened.

Do you see a chance to improve HikaShop for that?

Meanwhile, which module (.PHP file) is responsible if we decide to modify the php code to get this to work.

Thanks again

Andreas

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

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 5 months ago #10330

Well, HikaShop uses the MVC pattern so you pieces of the code handling that in several files.

First, in the file components/com_hikashop/controllers/checkout.php, you have the code which handles the login or registration control. In the file administrator/components/com_hikashop/classes/user.php, you have the code which handles the registration.
In the files of the folders components/com_hikashop/views/checkout and components/com_hikashop/views/registration and its subfolders, you have the files for the views of the registration form.

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

  • Posts: 16
  • Thank you received: 0
11 years 5 months ago #10572

There is another bug we found. It's a little bit tricky and seems like a small sidekick.
Here comes the history for that:

  • I bought stuff, moved to checkout and loged in -> my cart was attached to my login at first time.
  • I logged out before I finished the checkout and the cart were cleared (that's ok).
  • I bought new stuff and logged in at checkout with another user -> the cart is empty!
  • I bought stuff with my second login without checkout and logged out (cart is empty after logout).
  • I filled my cart again with stuff and move to checkout, logged in with my second account, cart is now filled with stuff i bought when I was logged in as second user, everything else I selected after logout is vanished again.
  • Same goes for first login or any other existing login.

This seems to me that the function to attach cart entries to the login has a bug itself.

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

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 5 months ago #10598

We cannot reproduce the problem on our end. When we login the current cart is always kept in our session. Do you have some specific user plugins ? Or maybe it comes from the way your session data is handled ? I remember that in some cases, changing the session handler option in the config of joomla helped solve issues with session stuff. Could you try that ?

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

  • Posts: 16
  • Thank you received: 0
11 years 5 months ago #10666

Good morning,
i found another thread about login/logout and cart shop and looked into the file that was mentioned in this thread. (see www.hikashop.com/en/support/forum/3-bug-...art-loginlogout.html )

Is this the function where the cart is attached to the user who logged in (plugin/user/hikashop.php)

function onLoginUser($user, $options){
		$app =& JFactory::getApplication();
		$cart = $app->getUserState('com_hikashop.cart_id',0);
		if(empty($cart) && !empty($this->cart)){
			$app->setUserState('com_hikashop.cart_id',$this->cart);
		}
		$entries = $app->getUserState('com_hikashop.entries_fields',null);
		if(empty($entries) && !empty($this->entries)){
			$app->setUserState('com_hikashop.entries_fields',$this->entries);
		}
	}

If so, you must reproduce the problem as this code only attaches the new cart values when the cart of the user is/was empty. Or do I miss something?

Last edit: 11 years 5 months ago by tecnet.

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

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 5 months ago #10669

When you login, the function onLoginUser is triggered by joomla. At that point, the cart in the session is always empty since a new session has just been created by joomla, so HikaShop is putting back the cart_id from the previous session in the new session.

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

  • Posts: 16
  • Thank you received: 0
11 years 5 months ago #10671

Ok, I set the session handler to none (from database) now (I was not sure if this is the correct value as you mentioned) and it is working different now. The current cart will now be set to the user who logged in. If the user logged out with a cart the cart is cleared. I think that is ok and can be handled by our customers.

Thank you for your help and time ;)

Last edit: 11 years 5 months ago by tecnet.

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

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 5 months ago #10672

Maybe we should change the code:
if(empty($cart) && !empty($this->cart)){
to:
if( !empty($this->cart)){

in order to always set the current cart. Could you try with this modification an the session handler being database ?
Does it work now ?

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

  • Posts: 16
  • Thank you received: 0
11 years 5 months ago #10673

I changed the code and tested it. As the same bug occured as before I started to debug it:

$this->cart is NULL in the function onLoginUser() when Session handler is set to database. I try to figure out where the data about the current cart is stored in this case.

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

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 5 months ago #10675

$this->cart is loaded when the user plugin is initialized.
Maybe that's already too late is your case ?
It would mean that we would have to transform the user plugin into a system plugin maybe ?

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

Time to create page: 0.093 seconds
Powered by Kunena Forum