counter shopping cart doesn't ad up the total products constantly

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
3 years 11 months ago #317828

-- url of the page with the problem -- : janjongerius.nl/
-- HikaShop version -- : 4.2.3
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.3.x
-- Error-message(debug-mod must be tuned on) -- : no message

Hello,
We encountered the following problem:
The counter of the shopping cart doesn't ad up the total products constantly. sometimes it says 6 while in the cart e.g. 9 products are.
how can we make it work correctly all the time??

Attachments:

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
3 years 11 months ago #317830

Hi,

That's likely a caching issue.
Please try to turn off any caching you might have on your website.

I checked on your website but I wasn't able to reproduce the problem. The cart module always had the correct quantity as far as I could see. Are you able to reproduce the issue on several browsers ?

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
3 years 11 months ago #317866

we reproduced the problem in all browser you can think off and is not working correctly.. we will try to exclude this from the caching.. i will let you know if it works.. :)

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
3 years 11 months ago #317871

we have exclude the caching for the module and path to cart.. but still after adding multiple products the after 5 or sometimes 10 products the counter will not add a new product to the cart..
So what can it be if it is not the caching.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
3 years 11 months ago #317886

Hi,

You have a caching on the whole page.
For example, if I access just now the page janjongerius.nl/aanbiedingen
I see 25 products in the cart, but I never added that much products in your website:
monosnap.com/file/1ZSx6t4oLVADbWLGdS7oV1Nj6haT0e
And if I then access the page janjongerius.nl/boodschappen I see only 4 products in the cart:
monosnap.com/file/mL429FZhChK4H5O2fecQhZTIVqJS8B
And if I then go back to the janjongerius.nl/aanbiedingen page I see 25 products again.
But if I go to the contact page, I get 0 products:
monosnap.com/file/iY4C7ak183Z4YIr7glVmuy1Y1FfQcw
So this indicates that the whole page is cached for different users of the website and the value I see there is the value of someone else that was calculated when he go to display the page and it wasn't yet cached.
So you would need to modify the caching system you're using to only cache pages "per user session" or not cache the whole pages at all.

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
3 years 11 months ago #318253

Hello,
We have looked at the cache of the pages and per user session, tried different ways. But in our test environment, we set all cache off in the joomla configuration then it looks like it goes well but then after adding 8 products it will stuck on counting 7 products. after putting another product in it the counter then will jump to 9.
Do you have another idea to solve this issue?

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

  • Posts: 4491
  • Thank you received: 609
  • MODERATOR
3 years 10 months ago #318257

Hello,

Unfortunatelly if we aren't able to reproduce and see your issue, solve it will be difficult.
We process some tests from this Url ( janjongerius.nl/aanbiedingen ).

And everything seems to works as expected, so in order to progress can you precise :
- The navigator you use for your test
- A step by step and details how did you succeed to reproduce the issue

Awaiting any elements to progress on your subject.
Regards

Last edit: 3 years 11 months ago by Philip.

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
3 years 10 months ago #318323

Hello to reproduce the problem.. and see that the counter is at an certain moment not counting we did the following.
3 products from this link:
https://janjongerius/aanbiedingen
no problem detected yet,
But when i go to :
janjongerius.nl/boodschappen/aardappel-r...gory/250-aardappelen
Put some more products in the cart the counter will then hesitate to add the next product counter remains e.g. 3 while 6 products are added. After adding again a product counter will count up to e.g. 7 products.
When then to another product group:
janjongerius.nl/boodschappen/koek-snoep-...ategory/311-toastjes
and put more products in it then the same will happen..
This also can happen after adding 20 products, so it is not really stable and all cache is disabled?
Hope you understand..
We tested this in firefox, chrome, opera and edge.
Regards.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
3 years 10 months ago #318332

Hi,

Well, checking the situation on your website, it looks much better than before.
Before, When I went to other pages, I could see numbers not correlated at all to what I really had added to my cart.
Now, it's always the correct number.
So turning off the caching on your pages really did help.
I now only see a small glitch as you explain in your last message, whereby sometimes when I click on the add to cart button, the number in the cart module doesn't refresh but if I try another add to cart, or go to another page it is properly updated.
But that only happens on the second and third link you gave, not the first one.
And on the first one, I can see the popup of the add to cart, but I don't see it on the two others after the add to cart.
I think this is linked to the customization you did on the add to cart button of these two other pages.
There, the attribute data-addToCart of the a tag has been changed to data-addtocart. Because of that, the add to cart cannot be done in ajax anymore and it works in degraded mode, redirecting the whole page to the add to cart controller, and then redirecting to the checkout. And to avoid going to the checkout, as you didn't want that, you cheated and added a window.location.reload() on the span around the img tag of the add to cart link so that it stays on the current page.
I would recommend to remove that, and fix the case of the attribute of the add to cart link. That should then work with the ajax mode and the cart module should then refresh properly, like on your first link.

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

Time to create page: 0.081 seconds
Powered by Kunena Forum