![]() That's fine, only that 'CacheContext' should be 'forced' to get the configurable product id too. Those 2 rows contain only the simple associated product id. \Magento\CatalogInventory\Observer\SubtractQuoteInventoryObserver and \Magento\CatalogInventory\Observer\ReindexQuoteInventoryObserver When a product is purchased and goes out of stock after checkout, in cataloginventory_stock_cl there are 2 rows inserted because of the quantity subtraction that happens here: What happens specifically with Mview enabled, see bellow. In Magento\CatalogInventory\Model\Indexer\Stock\AbstractAction::_reindexRows add to $productIds the configurable product ids just before the line:Īctually there is the variable '$processIds' that already contain the parents ids beside initial $productIds. Same thing, categories pages blocks contain in identities only configurable products ids (no associated product ids). The categories pages are not cache cleaned too. Magento\PageCache\Observer\FlushCacheByTags never gets a configurable product id (in the case - checkout with a product). ![]() ![]() $this->cacheContext->registerEntities(Product::CACHE_TAG, $productIds) Why after 1-3 minutes: to give time to Magento cron to run the cron task: Come back after (1-3 minutes) on configurable product page and refresh the page.Loading before checkout the configurable product page into full page cache type is important to demonstrate this issue. ![]() Please note that by doing this you also load the configurable product page to full page cache. Login as customer and add to cart this associated product from configurable product page.Clear cache and reindex all from console to make a clean test.With swatches you can actually visually see when an option is not available (product is out of stock). This configurable product has swatches but the issue is the same to configurable products without swatches. I use a simple product associated of configurable product SKU 'WT09' in Magento 2.1.3 with sample. Set quantity 1 to a simple product that is associated to a configurable product in admin.The issue should happen when using Varnish too. I used in this test 'built-in full page cache'. Have all cache types enabled in admin (including full page cache). Set indexer mode to 'Update by Schedule' / Mview enabled Use Magento CE 2.1.3 with or without sample.Same behavior for categories pages that this product is assigned to. On short, the configurable product page is not cache cleaned. Only the parent configurable product ids are in identities. But in Magento 2.1.3 these ids are no longer included in these identities. In Magento 2.1.2 the blocks of configurable product page had identities (cache identities, function getIdentities()) containing ids of simple associated products too. Sends to 'CacheContext' the product ids of the simple associated product. This issue is introduced into Magento 2.1.3 because Magento\CatalogInventory\Model\Indexer\Stock\AbstractAction::_reindexRows The cache (full page cache type) is not cleaned, especially when indexer mode is set to 'Update by Schedule'/MView is enabled. When a associated product goes out of stock the product page of the configurable product is not updated.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |