VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: kiasati on July 03, 2018, 12:04:45 PM

Title: cart wont update if user is not logged in
Post by: kiasati on July 03, 2018, 12:04:45 PM
Hi

a user goes to an product detail page and adds the product to cart,
but when user opens the cart, there is no item in it,
when the user logs in, then can see the product or products that he/she has added to cart.

why this happens?!!
how can i solve it??

i'm using joomla 3.8.10 and VirtueMart 3.2.14
Title: Re: cart wont update if user is not logged in
Post by: Jörgen on July 03, 2018, 13:17:33 PM
Not enough information.

Broken template, added module, added plugin, PHP update, Joomla Update, VM update, JS conflict, take Your pick.

Jörgen @ Kreativ Fotografi
Title: Re: cart wont update if user is not logged in
Post by: kiasati on July 03, 2018, 14:39:12 PM
Quote from: Jörgen on July 03, 2018, 13:17:33 PM
Not enough information.

Broken template, added module, added plugin, PHP update, Joomla Update, VM update, JS conflict, take Your pick.

Jörgen @ Kreativ Fotografi

i deleted "com_virtuemart" folder in template overrides, but still the problem remained.
i'm using php 7.
JS conflict is possible. how can i find out if there is?

on localhost it works fine...
Title: Re: cart wont update if user is not logged in
Post by: Jörgen on July 03, 2018, 14:57:06 PM
Check you debugger, F12 in some browsers.
PHP 7.2 dose not go well with VM.

Find out what the difference is between Your local host and your webhost and You may have Your answer.

Jörgen @ Kreativ Fotografi
Title: Re: cart wont update if user is not logged in
Post by: jenkinhill on July 03, 2018, 15:03:24 PM
Similar to this thread:  http://forum.virtuemart.net/index.php?topic=140003  this was a http/https issue
Title: Re: cart wont update if user is not logged in
Post by: Jumbo! on July 03, 2018, 19:41:51 PM
It sounds like a cache issue. Have you enabled "System - Page Cache" plugin or using any other page cache extension?
Title: Re: cart wont update if user is not logged in
Post by: Studio 42 on July 03, 2018, 23:18:46 PM
Quote from: Jumbo! on July 03, 2018, 19:41:51 PM
It sounds like a cache issue. Have you enabled "System - Page Cache" plugin or using any other page cache extension?
+1
Title: Re: cart wont update if user is not logged in
Post by: aftertaf on July 04, 2018, 00:03:50 AM
i gather its better to disable system cache, page cache etc with virtuemart..., right ?
Title: Re: cart wont update if user is not logged in
Post by: Studio 42 on July 04, 2018, 03:13:23 AM
Cart use session, so if you have cache active, the page is not updated with user session data(cart)
This problem is same with any cart system, it's not specific to Virtuemart.
If you want use a cache you need a more advanced cache manager but this can slowdown your site, if you have to many cases to handel(because
disk writing).
So page cache should never be used for a shop, modules can in some case be cached(menu for eg., categories ...) my own category module can use a static cache that never expire for eg.(can be cleared with joomla cache handler)
Virtuemart do not use advanced caching rules, so the caching fails because session values. Eg currrency changes,language changes are value in session but virtuemart have never added this in the cache key, so you cannot add it in cache.
But other datas can change the display as promotions, stock changes, so it's not easy to write a specific cache system for a shop.
Title: Re: cart wont update if user is not logged in
Post by: kiasati on July 04, 2018, 06:56:22 AM
PROBLEM SOLVED.

I use all of these for caching:
1. Conservative caching -enabled in global configuration
2. System - Page Cache
3. System - JCH Optimize Pro
4. cloudflare

I'd had excluded cart page in jch before,
problem was made by "System - Page Cache"
excluded cart page in it and then problem solved.

Thanks a lot guys.