This topic has 6 replies, 2 voices, and was last updated 8 years ago ago by Olga Barlow
Hello,
The cart does the show the wrong cart value for 500-1500ms, before the AJAX then kicks in and changes the cart value to the correct one for that user. It does look very dangerous for customers to see the cart total jump up and down when browsing from page to page and will put off customers greatly….
There is very major problem, but simple though so will have been easy to miss. Can this be fixed ASAP?
I checked this with you guys before starting and I think it is nearly ok, but it needs an important tweak. We had chatted about our hosting provider saying that we can only use templates that use AJAX to show the cart or there will be caching issues that will show the price of a completely different users cart(!). This seems to be a normal point with any decent WP hoster so the template really needs to account for that to be usable.
Many thanks,
Richard
My thinking if it helps:
I guess the CSS needs to make it display:none until the AJAX kicks in (easy enough to DIY here), but the important problem that stops us from this DIY fix is that the AJAX would need to make it display:visible right after updating the value…
I should also add that the prob is not always there. I guess it will completely depend on what is being cached by the WP server and then in the browser in that particular moment.
I can be sure that it is definitely happening because 1) in one woocommerce guest session there was a £x total and 2) another woocommerce guest session running in incognito mode flashed up the other session’s £x total briefly before the AJAX showed the correct £y total.
Hello,
Unfortunately, this is how ajax refresh works. You can enable even official WooCommerce theme – Storefront and check. You’ll see the same situation.
Regards
I might have fixed it with the below CSS…. not really tested this properly though but it seems to work like a failsafe mechanism.
It’s just a quick hack to fade in the element, which from what I can see never get’s a change anyway because the AJAX is faster. The AJAX seems to trigger way before this fadein is relevant and make the cart total properly visible when the AJAX is ready.
Again, it’s just a quick hack, I think…….
/* fadein cart widget total to get rid of server caching vs ajax problem */
.shopping-cart-widget .shop-text .amount{
-webkit-transition: opacity 20s 10s ease;
-moz-transition: opacity 20s 10s ease;
-ms-transition: opacity 20s 10s ease;
-o-transition: opacity 20s 10s ease;
transition: opacity 20s 10s ease;
}
Hello,
Yes, it can be used as a quick hack.
Regards
You must be logged in to reply to this topic.Log in/Sign up