Wrong behavior in the Checkout procedure

  • Posts: 152
  • Thank you received: 11
1 year 3 months ago #349435

-- url of the page with the problem -- : hikashop4.cloudaccess.host/
-- HikaShop version -- : 4.7.1.
-- Joomla version -- : 4.2.8
-- PHP version -- : 8.0.27
-- Browser(s) name and version -- : Chrome

hikashop4.cloudaccess.host/

I go to the FRENCH EBOOK page and add the Candide product to the cart



I click on PROCEED TO CHECHOUT and I find myself on the CARS page



Delete the product by clicking on X, I obviously remain on the CARS page and see all of his products




But I was on the FRENCH EBOOK page because I'm interested in those products !!??

Attachments:
Last edit: 1 year 3 months ago by gerryna09.

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

  • Posts: 81853
  • Thank you received: 13143
  • MODERATOR
1 year 3 months ago #349436

Hi,

In the Checkout tab of the HikaShop configuration you have a setting called "force menu on checkout". There, you can select a menu item to be used for the checkout.
If no menu item is selected there, I think it should stay on the current menu item.
If a menu item is selected there but it is invalid, the system will try to select a menu item of HikaShop randomly.
If a menu item is selected there and is valid, the system will use it on the checkout.

Similarly, when the cart is emptied, the system will use the "URL where to redirect when cart is empty" setting under the main tab of the HikaShop configuration to redirect where you want. If that setting is empty, it will select a random menu item of HikaShop to redirect to.

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

  • Posts: 152
  • Thank you received: 11
1 year 3 months ago #349459

As soon as you can, go to hikashop4.cloudaccess.host and repeat what I did
You will notice that from the menu item FRENCH EBOOK you will find yourself in the menu item CARS

Attachments:
Last edit: 1 year 3 months ago by gerryna09.

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

  • Posts: 81853
  • Thank you received: 13143
  • MODERATOR
1 year 3 months ago #349467

Hi,

I had already reproduced what you had described on your website. But I was not able to reproduce the issue on my local test website.
That's why I had concluded at an issue with that setting.
So today, I took another look. I actually noticed on your website that if I refresh the current page after I add the product to the cart, the checkout link's behavior is correct in the cart module.
And so, it means that the problem happens only when the cart module is being refreshed in AJAX and only with some menu item configuration.
So I looked further into it on my end and found that the problem would only happen with some menu items, not the one I was testing with.
Based on all of this, I found that the issue comes from the URL to refresh the cart module which is missing the current Itemid parameter. This leads to the system auto selecting a random menu item for the checkout link.
So I've made a patch to fix this. Since I was now able to reproduce the issue on my local website, I was able to confirm the patch fixes the problem for me.
Change the line:

window.hikashop.xRequest("<?php echo hikashop_completeLink('product&task=cart&module_id='.$module_id . '&module_type='.$this->cart_type, true, false, true); ?>", {update: el, mode:'POST', data:'return_url=<?php echo urlencode(base64_encode(hikashop_currentURL('return_url'))); ?>'}, function(xhr){
to:
window.hikashop.xRequest("<?php echo hikashop_completeLink('product&task=cart&module_id='.$module_id . '&module_type='.$this->cart_type.$this->url_itemid, true, false, true); ?>", {update: el, mode:'POST', data:'return_url=<?php echo urlencode(base64_encode(hikashop_currentURL('return_url'))); ?>'}, function(xhr){
in the file components/com_hikashop/views/product/tmpl/cart.php and it should fix the problem for your website too.
We'll include the fix on our end. Thanks for your report of the issue.

The following user(s) said Thank You: gerryna09

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

  • Posts: 152
  • Thank you received: 11
1 year 3 months ago #349479

Thank you for your patience in replying to each post.

It's thanks because you always solve :)

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

Time to create page: 0.077 seconds
Powered by Kunena Forum