HikaShop group plugin

  • Posts: 3
  • Thank you received: 1
3 weeks 4 days 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: 3 weeks 9 hours ago by nicolas.

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

  • Posts: 2647
  • Thank you received: 348
  • MODERATOR
3 weeks 3 days 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: 3
  • Thank you received: 1
3 weeks 1 day 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: 70194
  • Thank you received: 10508
  • MODERATOR
3 weeks 9 hours 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.060 seconds
Powered by Kunena Forum