VirtueMart Forum

VirtueMart 2 + 3 + 4 => Frontend Modules => Topic started by: artonweb on August 14, 2023, 11:27:50 AM

Title: Problem with number of products in cart
Post by: artonweb on August 14, 2023, 11:27:50 AM
Hello.
I am using Joomla 4.3.3 and Virtuemart  4.2.0 10905
I observe a strange problem.
I add to the cart 1 product, then I add another one.
When I am clicking on "ΑΡΧΙΚΗ" then I see 1 product in the cart.
When I am clicking to another menu item I see 2 products in the cart.

Website url is https://autochaniotakis.gr/joomla4

I had the same issue with Joomla 3, add I solve the problem with a change from /plugins/system/cache/cache.php on line 121 if ($caching && $user->get('guest') && $this->app->input->getMethod() == 'GET')
{
$this->_cache->setCaching(true);


to

if ($caching && $user->get('guest') && $this->app->input->getMethod() == 'GET')
{
$this->_cache->setCaching(false);

Now the code is different.
Thank you in advance
Title: Re: Problem with number of products in cart
Post by: Jumbo! on August 15, 2023, 20:24:26 PM
First of all, that is not a problem. You can not use the "System - Page Cache" plugin on a VirtueMart site where the page contents are dynamic. The page cache plugin is designed for static content websites like blogs, business portals etc. You will face many problems using this plugin on a VirtueMart website.

Secondly, the code you changed utterly turns off all caching functionality of the plugin. Therefore, turning off the plugin would be more logical than deactivating it through codes.
Title: Re: Problem with number of products in cart
Post by: artonweb on August 15, 2023, 22:13:31 PM
Thank you for your answer.
By mistake, I have deleted page cache plugin.
How can I turn off the cache in order to resolve the issue .
Thank you in advance.
Title: Re: Problem with number of products in cart
Post by: GJC Web Design on August 16, 2023, 11:14:46 AM
just extract the plugin from the installer and ftp it back -- might need "discovering" in Joomla but probably not
Title: Re: Problem with number of products in cart
Post by: artonweb on August 16, 2023, 17:32:18 PM
I can't found the Page cache plugin, even after a reinstall joomla core files.
However, I'm guessing the problem is somewhere else rather than the missing plugin.