HikaShop group plugin

  • Posts: 9
  • Thank you received: 1
4 years 4 months ago #322056

-- HikaShop version -- : 4.3.0

In the plugin: "HikaShop group plugin" from the latest version of Hikashop 4.3.0, an event handler has appeared:

function onBeforeCheckoutViewDisplay ($layout, &$view) {
if ($layout! = 'login')
return;
$order = $view->checkoutHelper->getCart();

if ($this-> checkGuest ($order))
return true;

$view->options['registration_guest'] = false;
}
If the user is already authorized, then layout = 'login' is not displayed, but this handler still processes this layout and a message appears:
"You cannot proceed to a guest checkout as some of the products in your cart require a registration to our website. Please register an account or remove these products from your cart in order to proceed"

To fix this, I added:
if ($order-> user_id! = 0) return;
after
$order = $view->checkoutHelper->getCart();

Is this enough to fix this error, or is there another solution?

Last edit: 4 years 4 months ago by nicolas.

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
4 years 4 months ago #322073

Hello,

Hard to answer you directly like this, we will need to better understand the context because we process some tests on our side without have this error message.
Can we see your relative screenshots configuration ?
We need to fully understand why this error message have been displayed, and then we will be able to better understand if your fix is enough.
Regards

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

  • Posts: 9
  • Thank you received: 1
4 years 4 months ago #322144

All products "User group after purchase" value "Custom"
Chekout on one page:



Without fix, message appears:
"You cannot proceed to a guest checkout as some of the products in your cart require a registration to our website. Please register an account or remove these products from your cart in order to proceed".
Even when the user is logged in

When Login layout on other page, all good.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 4 months ago #322162

Hi,

Thanks for the details.
We'll indeed need to add some code for that.
However, I think this code instead is better:

		$user = JFactory::getUser();
		if(empty($user->guest))
			return true;
That's the patch we'll add on our end for the next release.

The following user(s) said Thank You: bvitl

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

Time to create page: 0.066 seconds
Powered by Kunena Forum