VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: marvays on December 11, 2019, 05:01:49 AM

Title: Some items are missing in the cart
Post by: marvays on December 11, 2019, 05:01:49 AM
Hello,
I picked up the goods and put them in the basket. then I select other goods and put them in the basket. When everything is done, I open the basket and see that some of the items in the basket have disappeared. Where is the problem? Cache?

VirtueMart 3.4.2
Joomla! 3.9.13
Title: Re: Some items are missing in the cart
Post by: jenkinhill on December 11, 2019, 10:09:29 AM
No URL, but I wonder if this is another issue with older VM versions on J3.9 - or a JS problem.

(https://i.ibb.co/w7wYKRw/342.png) (https://ibb.co/nBnRDbn)
Title: Re: Some items are missing in the cart
Post by: marvays on December 11, 2019, 10:15:23 AM
ou, sorry. I forgot to mention the url of the shop :(
It is an archery shop in the Czech Republic (https://www.lukysipy.cz)
Title: Re: Some items are missing in the cart
Post by: jenkinhill on December 12, 2019, 12:48:18 PM
Seemed to work OK for me. I did not see any JS errors.  Maybe you do need to clear your caches, especially if using Chrome.
Title: Re: Some items are missing in the cart
Post by: marvays on December 12, 2019, 13:14:10 PM
The problem happens once a week. Now before Christmas there are more orders, twice a week. Will more frequent clearing of the cache with Regular Labs Cache Cleaner help? Or should I install the JotCache component?
Title: Re: Some items are missing in the cart
Post by: Studio 42 on December 12, 2019, 15:01:29 PM
Do not use page cache, only module cache else you can see cart or orders form other users !
Jot cache can work, but you have to set it right
Title: Re: Some items are missing in the cart
Post by: marvays on December 12, 2019, 15:49:48 PM
Quote from: Studio 42 on December 12, 2019, 15:01:29 PM
Do not use page cache, only module cache else you can see cart or orders form other users !
I don't understand it :( what do you mean?
Title: Re: Some items are missing in the cart
Post by: jenkinhill on December 13, 2019, 11:17:00 AM
I would turn off all caching on the site, as long as it does not get stupidly slow. See if that removes the problem, but things that happen only occasionally are so difficult to pin down.
Title: Re: Some items are missing in the cart
Post by: marvays on December 13, 2019, 11:24:11 AM
Quote from: Studio 42 on December 12, 2019, 15:01:29 PM
only module cache else you can see cart or orders form other users !

Does the cart module work with cookies? Or cache?
And I cant see any cache setup in cart module :(
Title: Re: Some items are missing in the cart
Post by: jenkinhill on December 13, 2019, 12:13:51 PM
No, the cart is not cached. Realistically I don't understand how sometimes a product is removed from the cart, but the cache is the first place I would start. Check what is on the Joomla Maintenance: Clear Cache page.
Title: Re: Some items are missing in the cart
Post by: marvays on December 13, 2019, 12:23:32 PM
So, disabled joomla site cache for good work VirtueMart is your standard procedure? Hosting got fast.
Title: Re: Some items are missing in the cart
Post by: jenkinhill on December 13, 2019, 13:46:00 PM
I have a very fast cloud server so usually do not worry about caching.  VM cache information is here:  http://docs.virtuemart.net/manual/general-concepts/223-caches.html
Title: Re: Some items are missing in the cart
Post by: marvays on December 13, 2019, 14:10:06 PM
thx
Title: Re: Some items are missing in the cart
Post by: Studio 42 on December 13, 2019, 18:15:10 PM
The problem is simple.
If you add a product to your cart as anonymous and use page cache, then other user see same cart/page
If you use cahce for modules, then other user see same module content, if the module support cache.
Title: Re: Some items are missing in the cart
Post by: marvays on December 13, 2019, 18:20:57 PM
Quote from: Studio 42 on December 13, 2019, 18:15:10 PM
The problem is simple.
If you add a product to your cart as anonymous and use page cache, then other user see same cart/page
If you use cahce for modules, then other user see same module content, if the module support cache.
So you also agree that virtuemart needs cache disabled?
Title: Re: Some items are missing in the cart
Post by: Studio 42 on December 14, 2019, 01:48:10 AM
I never use Joomla page cache, in a shop.
Title: Re: Some items are missing in the cart
Post by: marvays on December 14, 2019, 08:13:07 AM
Quote from: Studio 42 on December 14, 2019, 01:48:10 AM
I never use Joomla page cache, in a shop.
thank you for your valuable advice. And do you use jotcache?
Title: Re: Some items are missing in the cart
Post by: pinochico on December 14, 2019, 19:44:26 PM
Translate for others:

Hi Martin,

the issue of using Joomla's cache related to VirtueMart is even more complicated than Patrick and Jenkhill wrote.
Yes Patrick is right that joomla uses a page-wide and module-level cache.

How Virtuemart works with cache is described on a link from jenkhill - unfortunately this article is old and outdated.
It supposes to disable the use of the cache at the basket module level.

Yes Patrick and Jenkhill do not use Joomla cache or VirtueMart cache because they use super fast hosting servers. However, this is not possible for your clients who pay only a small amount for joomla sites and work on shared Czech hosting. None of your clients pay 20-100 EUR / month for super fast hosting for one e-shop. Therefore, when you disable the cache on joomla and VirtueMart, as you advise, the site will load on this type of hosting 12-18 seconds, which is the standard time for Joomla site. Absolutely unusable on mobile.

At EasySoftware we spent many years developing VirtueMart e-shops in great detail and also developing cache usage (joomla cache, virtuemart cache, jotcache). When you use the joomla cache for the whole page, the cart will stop working, the product detail display will no longer work and the functionality of shopping will be dropped with a minimum quantity, pagination and pagination links will no longer work on the category list,
We solved all these problems because we try to offer solutions at the level of www.alza.cz or www.notino.cz but based on Joomla / VirtueMart.

Jotcache is a partial solution, you need to know how to set up correctly, but unfortunately it cannot work at the level of tag placement in the code (for example, on the product detail to display the number of pieces in stock). We left this solution as inappropriate after two years.

So after years of development and use of VirtueMart e-shops now:
- We use joomla cache with the cart module cache disabled and with our own VirtueMart dynamic cache content plugins - storage, adding to the cart with minimum quantity, paginations ... - we do not offer these plugins for sale.
- We use disabled joomla cache but with virtuemart cache enabled (again our ustom plugins) with the cart module cache disabled and with our own VirtueMart dynamic cache content plugins (also for retrieving information from an online SAP connected system).
- We use (just like Patrick and Jenkhill) disabled joomla cache completely, because we also use super fast servers for some clients.

Unfortunately, even if we sometimes use super fast servers, our clients do not want to wait even 1-2 seconds to load the page. And yet they have 200,000 products on the e-shop and use complex filtering with parameters. That's why we use other content retrieval systems that are not affordable for your client type and we don't offer them for sale:
- We use virtuemart cache (similar to jotcache), on super fast servers with specially modified installation and apache architecture.


To solve this problem, turn off the use of cache. At least for the basket or completely. If you need to have the cache turned on (you need to load the eshop faster) you will also have to solve not only the problem with virtuemart basket, but also generate the cache before displaying it to customers (for example using cron and browsing the whole web content at night). Or move on super fast servers.

Rudolf

Czech only for marvays:

Ahoj Martine,

problematika používání cache na Joomla ve spojení s VirtueMart je ještě trochu složitější než píše Patrick a Jenkhill.
Ano Patrick má pravdu v tom, že joomla používá cache pro celou stránku a cache na úrovni modulů.

Jak pracuje s cache Virtuemart je popsáno na odkazu od jenkhill - bohužel tento článek je starý a neaktuální.
Předpokládá vypnutí použití cache na úrovni modulu košík, nyní nic takové není a je třeba doplnit do nastavení modulu a do kódu.

Ano Patrick a Jenkhill nepoužívají cache pro Joomla nebo jen cache pro VirrtueMart, protože používají super rychlé servery pro hosting. To ale u Vašich klientů, kteří zaplatí za výrobu joomla stránek jen velmi malý obnos a fungují na sdíleném hostingu není možné. Nikdo z vašich klientů pro jeden eshop neplatí 50-100 EUR/měsíc za super rychlý hosting. Proto po vypnutí cache na joomla a VirtueMart, jak Vám radí, se Vám stránky budou načítat na tomto typu hostingu 16-18 sekund, což je standardní doba pro Joomla stránky. Na mobilu absolutně nepoužitelné.

Ve firmě EasySoftware jsme se věnovali mnoho let vývoji eshopů na VirtueMart velice detailně a také vývoji použití cache (joomla cache, jotcache). Jakmile použijete cache joomla pro celou stránku, absolutně přestane fungovat košík, na detailu produktu přestane fungovat zobrazení počtu kusů skladem a vypadne funkcionalita nakupování po minimálním množství, na výpise kategorie přestane fungovat paginace a odkazy v paginaci, zobrazení počtu ks produktů a další problémy
Všechny tyto problémy jsme řešili, protože se snažíme nabízet řešení na úrovni www.alza.cz nebo www.notino.cz, ale založené na Joomla/VirtueMart.

Jotcache je částečné řešení, musíte umět správně nastavit, bohužel neumí pracovat na úrovni umístění značky v kódu (například na detailu produktu pro zobrazení počtu ks na skladě). Toto řešení jsme po dvou letech opustili jako nevhodné.

Takže po letech vývoje a používání eshopů na VirtueMart nyní:
- Používáme zapnutou stránkovou joomla cache s vypnutou cache pro modul košík a s vlastními pluginy pro dynamický obsah VirtueMart - skladovost, přidání do košíku po minimálním množství, paginace... - tyto pluginy nenabízíme k prodeji.
- Používáme vypnutou joomla cache se zapnutou virtuemart cache (opět vlastní pluginy) s vypnutou cache pro modul košík a s vlastními pluginy pro dynamický obsah VirtueMart (také pro načítání informací z online napojeného systému SAP).
- Používáme (stejně jako Patrick a Jenkhill) vypnutou joomla cache úplně, protože také používáme u některých klientů super rychlé servery.

Bohužel i když používáme někdy super rychlé servery, naši klienti nechtějí čekat ani 1-2 sekundy na načtení stránky. A přitom mají na eshopu 200 000 produktů a používají složité filtrování s parametry. Proto používáme i další systémy pro urychlení načtení obsahu, které jsou ale pro Váš typ klientů cenově nedostupné a my je nenabízíme k prodeji:
- Používáme zapnutou virtuemart cache (obdoba jotcache), na super rychlých serverech se speciálně upravenou instalací a architekturou apache.


Pro Vaše řešení problému je vypnout použití cache. Minimálně pro košík nebo úplně. V případě nutnosti mít cache zapnutou (potřebujete načítat eshop rychleji) budete muset také řešit nejenom problém s virtuemart košíkem, ale i vygenerování cache před zobrazením pro zákazníky (například pomocí cronu a procházení celého obsahu webu v nočních hodinách).
Title: Re: Some items are missing in the cart
Post by: marvays on December 14, 2019, 21:32:06 PM
Vyčerpávající zpověď. Díky za objasnění situace.

Jako ideální řešení mi vyšlo vypnutí cache v joomle. Pro eshopy už dávno nepoužívám wedos, tak mi ve výsledku web běží stejně rychle, jako když byla zapnutá. Stejně si myslím, že zrovna u VM je důležitá spíš rychlost databáze.
Title: Re: Some items are missing in the cart
Post by: Studio 42 on December 14, 2019, 23:38:56 PM
pinochico, i run shops without cache and don't need more then 500ms to render a page with 10€ hosting maximum per momnth.
For little shop i use hosting for 5€
This is possible using PHP7 + and a good hosting.

For very big shops having more then 100 orders / day, i use cloud servers for 50€ and cloud flare and load in 300ms.
I never have shop that cost more then 1 or 2% of the estimate customer profit.
Title: Re: Some items are missing in the cart
Post by: pinochico on December 15, 2019, 06:56:26 AM
Patrick, can you send me sample pls?

Thanks

Rudolf
Title: Re: Some items are missing in the cart
Post by: Studio 42 on December 15, 2019, 20:27:13 PM
A sample of what ?
Title: Re: Some items are missing in the cart
Post by: pinochico on December 16, 2019, 05:12:44 AM
Quotepinochico, i run shops without cache and don't need more then 500ms to render a page

QuoteFor very big shops having more then 100 orders / day, i use cloud servers for 50€ and cloud flare and load in 300ms.

A sample eshop which render 300-500ms of page :)
Title: Re: Some items are missing in the cart
Post by: Studio 42 on December 16, 2019, 13:15:47 PM
for eg. https://pieces-rieju.com/
It run on a 5€ server and load in 500 to 900ms and have many customers, 9206 products and 4240 categories.
Title: Re: Some items are missing in the cart
Post by: marvays on December 16, 2019, 14:09:07 PM
Very fast! But "welcome back in the nineties" template :)
Title: Re: Some items are missing in the cart
Post by: Studio 42 on December 16, 2019, 17:00:10 PM
Quote from: marvays on December 16, 2019, 14:09:07 PM
Very fast! But "welcome back in the nineties" template :)
I never chose the design, i'm coder not designer. But i have customer with design from the 80s(And some are not responsive), i advise the customers, but i respect customer choices.
Title: Re: Some items are missing in the cart
Post by: marvays on December 16, 2019, 18:11:38 PM
joke
Title: Re: Some items are missing in the cart
Post by: pinochico on December 16, 2019, 19:41:27 PM
Patrick:

Thanks, I put this eshop and my eshop to test, but I can't find load in to 900ms. Is my test wrong?
Title: Re: Some items are missing in the cart
Post by: Studio 42 on December 16, 2019, 23:54:11 PM
How you test it ?
If you use a test a european site from australia. You get 3 to 10 Secondes more to load
Same from america Europa 1 to 5 secondes more.
So use a proper test tools. it's not slow, but not optimised(i dont full manage it)
Your test is about page loading or page speed ? Because page speed have nothing to do with the hoster
If you want a real fast site, check my own shop.
Title: Re: Some items are missing in the cart
Post by: Studio 42 on December 17, 2019, 00:07:55 AM
Attached same test from pingdom australia.