View Issue Details

IDProjectCategoryView StatusLast Update
0006250OXID eShop (all versions)4.08. Cachepublic2024-03-06 08:37
Reporterelisabeth_heckmann Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version4.8.6 / 5.1.6 
Summary0006250: Content Cache: each order resets whole cache if oxstock of parent article is 0
DescriptionIf you use Dynamic Content Caching together with active stock management every order of a variant leads to a call
$oCache->reset();
if stock of parent product is 0.
This is (in most cases) independent from Delivery Status (oxstockflag), buyable/not buyable parent product, and also independent from variant stock.

The reason is
application/models/oxarticle.php:4870 (EE 5.1.6)
if ($this->oxarticles__oxstockflag->value == 2 && $iOldStock xor $iStock)
leads (for example) to true and calls $this->_onChangeResetCounts if
oxstockflag != 2
iOldStock (oxstock from parent) = 0
iStock (oxvarstock from parent) > 0
this leads in a 5.1.6 to $oCache->reset();

In my opinion this statement doesn't make sense. This statement results in TRUE if:
$iStock is true
and
($this->oxarticles__oxstockflag->value == 2 && $iOldStock) is false

or
$iStock is false
and
($this->oxarticles__oxstockflag->value == 2 && $iOldStock) is true


I think a cache reset in case of not buyable parent should only take place if
oxstockflag == 2
and
iStock = 0
independent from parent stock
Steps To Reproduce- enable Dynamic Content Cache
- enable stock management
- set oxstock 0 for a parent article
- leave oxstockflag
- navigate in shop to get some pages cached- enable Dynamic Content Cache
- enable stock management
- set oxstock 0 for a parent article
- leave oxstockflag for example "Standard"
- navigate in shop to get some pages cached
- Buy a variant product where parent has oxstock 0
- after order finishing whole cache is reseted
This behavior could also be reproduced in a EE 5.2.5 reason seems to be the same but code in $this->_onChangeResetCounts is different.
- Buy a varinat product where parent has oxstock 0
- after order finishing whole cache is reseted
TagsCache, EE
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

elisabeth_heckmann

2015-10-30 11:17

reporter   ~0011291

Just another point, also if iOldStock and iStock are > 0 the statement leads to true and to a cache reset if oxstockflag != 2