Skip to main content

HikaShop group plugin

More
6 years 2 months ago - 6 years 2 months ago #322056 by bvitl
HikaShop group plugin was created by bvitl
-- 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:
Code:
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: 6 years 2 months ago by nicolas.

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

More
6 years 2 months ago #322073 by Philip
Replied by Philip on topic HikaShop group plugin
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.

More
6 years 2 months ago #322144 by bvitl
Replied by bvitl on topic HikaShop group plugin
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.

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

More
6 years 2 months ago #322162 by nicolas
Replied by nicolas on topic HikaShop group plugin
Hi,

Thanks for the details.
We'll indeed need to add some code for that.
However, I think this code instead is better:
Code:
$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.191 seconds
Powered by Kunena Forum