Hello
i have a problem with cart module
https://www.loom.com/share/1f7d49fe2e8e4527bddf03bba39212b3
user add some product
user deonnect
user reconnect cart is empty ...
i try to disable all plugins nothing more
i try to change template no more ...
VirtueMart 3.8.8 10472
any idea ?
That looks like JavaScript issue. Post the site link so we can review it.
thanks for helping you can see here
https://www.maisondelapresse-rabastens.fr/catalogue
Quote from: berges on November 26, 2021, 17:44:34 PM
thanks for helping you can see here
https://www.maisondelapresse-rabastens.fr/catalogue
No, there is no JS error on your site.
I tried to test by log-in into your site, but I could not create an account as new user registration is presently disabled on your site.
here you can test
i create an acconut for you
virtuetest
virtuetest
thanks
is problem with cache
Don't use cache for e-commerce website
i didn't use any cache (no joomla cache, no gzip, no jch) where did you see it ? maybe a cache on hoster ?
Have You disabled the Joomla cache plugin ?
Check for cache from host.
Jörgen
If you disable Joomla cache, then VM still use cache - then we use plugin OPC stop browser cache
The VM cache does not affect the cart/checkout .. only views like category
some other idea ?
Ok, I see video.
So If I understand right - the normal (standard) is
- login
- add something to cart
- logout
- login
- see the same before logout in the cart
That is standard what we want from e-commerce solution, isn't it? :)
But your shop is not function as standard == cart is empty after second login.
I don't know exactly right, but I think in new version VM (from version then cart remember products after logout/login) the info about cart is saved in DB (not in session).
You have to check if really saved in DB and exist BD table - first option
So if is right what wrote Jumbo:
QuoteI tried to test by log-in into your site, but I could not create an account as new user registration is presently disabled on your site.
then logic you don't have DB table for saving cart to user == then you can't load full cart with all product's after logout.
I think - logic will be enable registration on site, that do you mean?
sorry i am not agree, if you have a account try any e commerce
1 login
2 add product in cart
3 log out
4 login
=> last cart is loaded, old version of virtuemart works like this, in my cas nothing was write in bd table ...
I'm sorry, I don't think you understand my English and I don't understand yours :)
lol, y try to fhight with beguinner level
but in fact on old vrtuemart that work you can create a cart as a logged user, deconnect it, relogging and your cart is here not empty ... nothing was save in bd table .. i try to find any option in configuration but nothing ...
In the cart helper components\com_virtuemart\helpers\cart.php
public function storeCart($cartDataToStore = false)
there is
//quorvia dont store non completed carts for logged in users
$Cartsdontsave = VmConfig::get('CartsDontSave', 0 );
if ($Cartsdontsave){
return;
}
//quorvia dont store non completed cart data for shoppergroup
$CartsdontsaveShopperGroup = VmConfig::get('CartsDontSaveByshoppergroup', 0 );
if ($CartsdontsaveShopperGroup > 0 ){
if(!empty($this->user->shopper_groups) AND in_array($CartsdontsaveShopperGroup, $this->user->shopper_groups)) {
return;
}
}
hard to believe but check you have no entries for these 2 parameters in the VM config
if no entries then these default to false and the cart should be saved IF the user is logged in
administrator\components\com_virtuemart\virtuemart.cfg
hello
yes in virtuemart.cfg i didn't have CartsDontSave entry
can i add it directly ?
Tryy in Joomla config to change session method : PHP <> database
It is not a cache or session-related issue. For the logged-in users, VirtueMart is not saving the cart session to the #__virtuemart_carts table due to some unknown reason. Everything else seems to be working fine.
You need to investigate the storeCart function in - components/com_virtuemart/helpers/cart.php to know the actual reason. If you want, you can PM me the FTP Access and Joomla Super Admin Access credentials of your site so that I can investigate the issue.
i test without user logged cart is "saved" in session ... incredible problem
=> @jumbo! thanks i can send you on mp ?
Quote
Jumbo! wrote:
VirtueMart is not saving the cart session to the #__virtuemart_carts table due to some unknown reason.
is the same info from me (maybe wrong translate but the some idea) :)
Quote
Rudolf wrote:
I don't know exactly right, but I think in new version VM (from version then cart remember products after logout/login) the info about cart is saved in DB (not in session).
You have to check if really saved in DB and exist DB table - first option
go on...
as i says, #__virtuemart_carts is empty
Quoteas i says, #__virtuemart_carts is empty
Yes? where? :)
Im old man and don't see as before :)
sorry i din't explain so much => i checked cart bd table is empty
Quote from: berges on December 01, 2021, 08:56:12 AM
i test without user logged cart is "saved" in session ... incredible problem
=> @jumbo! thanks i can send you on mp ?
Yes, you can send PM to me now.
I have fixed the issue. The site is working fine now.
It is a minor bug. The saved cart does not get loaded after log-in in the existing system if the user does not make changes to the cart session before that. For example, if the user first adds a product to the cart and then log-in to the site, it loads the saved cart. But if the user log-in to the site immediately after visiting the site, it will not load the saved cart. I could also reproduce this issue on my local development site.
I made the following change to fix it.
In file - components/com_virtuemart/helpers/cart.php
Original codes between lines 222 to 225:
if(empty(JFactory::getUser()->guest) and !empty($sessionCart->_guest)){
self::$_cart->loadCart(self::$_cart);
self::$_cart->_guest = 0;
}
$sessionCart->_guest property does not exist until some changes are made to the cart session. So I replaced the above code with the following -
if (!property_exists(self::$_cart, '_guest')) {
self::$_cart->_guest = true;
}
if (empty(JFactory::getUser()->guest) and !empty(self::$_cart->_guest)) {
self::$_cart->loadCart(self::$_cart);
self::$_cart->_guest = false;
}
That's it. :)
Many thanks !!!! a million !
Quote
Jumbo says:
I have fixed the issue.
So, it's VM bug from DEV team and will be fixed in next version by added this fix in core?