Author Topic: cart wont update if user is not logged in  (Read 347 times)

kiasati

  • Jr. Member
  • **
  • Posts: 102
    • JoomlaJoy
cart wont update if user is not logged in
« 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

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1720
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: cart wont update if user is not logged in
« Reply #1 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
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

kiasati

  • Jr. Member
  • **
  • Posts: 102
    • JoomlaJoy
Re: cart wont update if user is not logged in
« Reply #2 on: July 03, 2018, 14:39:12 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...

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1720
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: cart wont update if user is not logged in
« Reply #3 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
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26992
  • Always on vacation
    • Jenkin Hill Internet
Re: cart wont update if user is not logged in
« Reply #4 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
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.0.9935 on Joomla 3.8.12 PHP 7.0.31
Testing VM 3.4.0.9941 on Joomla 3.8.12

Jumbo!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 655
  • Full-stack Web Developer
    • www.virtueplanet.com
  • VirtueMart Version: Always latest
Re: cart wont update if user is not logged in
« Reply #5 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?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3386
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: cart wont update if user is not logged in
« Reply #6 on: July 03, 2018, 23:18:46 pm »
It sounds like a cache issue. Have you enabled "System - Page Cache" plugin or using any other page cache extension?
+1

aftertaf

  • Jr. Member
  • **
  • Posts: 206
    • sO couture
  • VirtueMart Version: 3.2.14
Re: cart wont update if user is not logged in
« Reply #7 on: July 04, 2018, 00:03:50 am »
i gather its better to disable system cache, page cache etc with virtuemart..., right ?
Webmaster for my wife (link in my profile ;)
Extensions / plugins : POSForWebshops, TemplatecreatorCK ,MaximenuCK, and PageBuilderCK, VM BatchEdit Pro, VM CustomFilters Pro, Awocoupon Pro, slogin, supersaas,  among other things...
Joomla! 3.8.6//VM 3.2.14//PHP7.0.18 & mariadb 10.1.22 on Debian
big up to notepad++!!!!

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3386
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: cart wont update if user is not logged in
« Reply #8 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.

kiasati

  • Jr. Member
  • **
  • Posts: 102
    • JoomlaJoy
Re: cart wont update if user is not logged in
« Reply #9 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.