Access forbidden - Updating Cart Quantities

  • Posts: 41
  • Thank you received: 4
11 months 1 week ago #351627

-- HikaShop version -- : 4.7.2
-- Joomla version -- : 3.10
-- PHP version -- : 7.4.33
-- Browser(s) name and version -- : Edge 113.0.1774.35

Hello Hikashop!

I'm having a little trouble with my checkout. Whenever I change the quantities in the checkout and press the 'refresh' button I get an access forbidden error.




I've searched your forum for an answer but I was unable to find a thread on the matter.

I was just wondering if it was something you've encountered before?

Sorry in advance, I'm just unable to pinpoint the issue.

Attachments:

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

  • Posts: 41
  • Thank you received: 4
11 months 1 week ago #351628

Also, apologies Just realized this is in the wrong section.
I intended to post in checkout!

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
11 months 1 week ago #351636

Hi,

I'm not able to reproduce the issue on your website.
I suppose it's because you left your browser tab opened for too long and your user session expired so the server doesn't recognize your browser when you try that operation.

What I can see though on your checkout is that each time I click somewhere I get an javascript error in the console of my browser:
i.imgur.com/KdmAF90.png
The error message points at the line 1823, it seems to come from some custom javascript code which shouldn't be added to the page when the user is on the checkout:
i.imgur.com/nJS8k8p.png

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

  • Posts: 41
  • Thank you received: 4
11 months 1 week ago #351646

Hey Nicolas.

Thanks for the quick response.

I have tried no on 4 different devices, 3 different browsers (chrome, edge, safari) and different networks, however I always get access forbidden when I try to update the quantity.

When I change the quantity and click 'Next' However, the cart and prices will update as you would expect if you pressed 'refresh'.

I'm sure it couldn't be a session issue, as I have tried so many different sessions and devices.

Thank you for pointing out those errors, I have fixed the issues that were causing them. (was running the code for booking a viewing site wide for some reason. My bad.)

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

  • Posts: 41
  • Thank you received: 4
11 months 1 week ago #351647

Hey Nicolas!

Sorry to waste your time!

I found a few view modifications that I hadn't noticed on "show_block_cart"

I've removed those and the cart updates as you change the value now, which is ideal.

If you manage to click update before it finishes refreshing then you still get the "access forbidden" error, but this should be good enough for me to be fair.

Sorry to waste your time!

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
11 months 1 week ago #351648

Hi,

I've looked deeper into it. I'm now able to reproduce the issue. It only happens if you click on the quantity input field, enter something in it, and then click on the refresh button directly without clicking elsewhere before.
If you use the + or - and then click on the refresh button, or if you change the quantity in the input field and then press enter and then click on the refresh button, or if you change the quantity in the input field and click elswhere on the page and then click on the refresh button, it works fine.
That's why I wasn't able to reproduce it before on your website.

Now, I'm still not able to reproduce the issue on my test website. And I'm not sure why.
I've made a patch which should prevent the issue, providing that you don't have view overrides for checkout / show_block_cart and layouts / quantity on your website.
Download again the install package of HikaShop on our website and install it on yours. It will add the patch and it should hopefully work better.

The following user(s) said Thank You: jasmine247

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

  • Posts: 41
  • Thank you received: 4
11 months 1 week ago #351689

Hey!

I've applied that patch and it seems to be working fine, thank you for that!

I have double checked and I do not have any modifications to 'checkout / show_block_cart' or 'layouts / quantity', not sure if there are other views that could affect things in this way, but I'm going to do a bit sort out of the modifications and try and get rid of any that I'm not requiring anymore.

Thank you again for looking into this!

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

Time to create page: 0.083 seconds
Powered by Kunena Forum