Preconditions and environment
Tested on this version(s):
Magento Version: dev-2.4-develop
Indexer Mode: Update By schedule (Use cron run for partial indexing)
Issue Description:
Consider a configurable product with two simple product variants having different prices — for example:
- Variant A: Price 500 (in stock)
- Variant B: Price 100 (out of stock)
Since Variant B has the lower price, it initially determines the configurable product's displayed "As low as" price. When Variant B is set to Out of Stock from the admin panel, the configurable product correctly starts showing Variant A's price (100) as the lowest price.
However, when Variant B is set back to In Stock via the REST API (PUT rest/V1/products/{sku}/stockItems/{id}) instead of the admin panel, the price index does not get updated correctly during partial reindexing. As a result, the configurable product page continues to show the wrong variant's price (100) instead of falling back to the actual lowest price (50) from Variant B.
Screenshot-1: Configurable product with two variants and different prices
Screenshot-2: Variant B marked Out of Stock from admin panel
Screenshot-3: Storefront price after Variant B is Out of Stock (showing 500, as expected)
Screenshot-4: REST API request setting Variant B back to In Stock
Screenshot-5: Storefront price after partial reindex — incorrect price still shown
Steps to reproduce:
- Take 2.4-develop branch clone.
- Set all indexers to Update by Schedule mode and run cron so that partial (scheduled) indexing is triggered.
- Create a configurable product with two variants having different prices (Screenshot-1).
- Set the lower-priced variant to Out of Stock using the admin panel (Screenshot-2).
- Wait for/trigger partial indexing and confirm the storefront now shows the higher-priced variant's price (Screenshot-3).
- Set the same variant back to In Stock using the REST API:
PUT rest/V1/products/{sku}/stockItems/{id} (Screenshot-4).
- Allow partial indexing to complete.
- Reload the product page on the storefront and observe the displayed price (Screenshot-5).
Expected results:
the configurable product should display the correct lowest price among all in-stock variants
Actual results:
After setting the variant back to In Stock via the REST API, the configurable product continues to display the price of the other (higher-priced) variant instead of updating to reflect the actual lowest price, even after partial indexing has completed
Additional Information:
While saving a product from the admin panel, that product is added to the indexing backlog. This is related to the changes introduced in this commit:
1984c61
This commit made changes to the entity date handling and to the price mview table, so that on admin save, the product is correctly added to the price indexer backlog (catalog_product_price_indexer backlog / changelog table) for partial reindexing.
However, when the stock status is updated via REST API (PUT rest/V1/products/{sku}/stockItems/{id}), the product is not added to this indexing backlog. As a result, the price index is never refreshed for that product during partial (scheduled) indexing.
This explains the observed behavior:
- When the variant is set to Out of Stock from the admin panel, the product save flow correctly adds it to the backlog, and partial indexing removes its price row from
catalog_product_index_price — so the configurable product correctly falls back to the other variant's price.
- When the variant is set back to In Stock via the REST API, the product is not added to the backlog, so partial indexing never re-inserts its price row into
catalog_product_index_price. The configurable product therefore continues to show the wrong (other variant's) price, since the correct variant's price row is missing from the index.
Release note
No response
Triage and priority
Preconditions and environment
Tested on this version(s):
Magento Version: dev-2.4-develop
Indexer Mode: Update By schedule (Use cron run for partial indexing)
Issue Description:
Consider a configurable product with two simple product variants having different prices — for example:
Since Variant B has the lower price, it initially determines the configurable product's displayed "As low as" price. When Variant B is set to Out of Stock from the admin panel, the configurable product correctly starts showing Variant A's price (100) as the lowest price.
However, when Variant B is set back to In Stock via the REST API (PUT rest/V1/products/{sku}/stockItems/{id}) instead of the admin panel, the price index does not get updated correctly during partial reindexing. As a result, the configurable product page continues to show the wrong variant's price (100) instead of falling back to the actual lowest price (50) from Variant B.
Screenshot-1: Configurable product with two variants and different prices
Screenshot-2: Variant B marked Out of Stock from admin panel
Screenshot-3: Storefront price after Variant B is Out of Stock (showing 500, as expected)
Screenshot-4: REST API request setting Variant B back to In Stock
Screenshot-5: Storefront price after partial reindex — incorrect price still shown
Steps to reproduce:
PUT rest/V1/products/{sku}/stockItems/{id}(Screenshot-4).Expected results:
the configurable product should display the correct lowest price among all in-stock variants
Actual results:
After setting the variant back to In Stock via the REST API, the configurable product continues to display the price of the other (higher-priced) variant instead of updating to reflect the actual lowest price, even after partial indexing has completed
Additional Information:
While saving a product from the admin panel, that product is added to the indexing backlog. This is related to the changes introduced in this commit:
1984c61
This commit made changes to the entity date handling and to the price
mviewtable, so that on admin save, the product is correctly added to the price indexer backlog (catalog_product_price_indexerbacklog / changelog table) for partial reindexing.However, when the stock status is updated via REST API (
PUT rest/V1/products/{sku}/stockItems/{id}), the product is not added to this indexing backlog. As a result, the price index is never refreshed for that product during partial (scheduled) indexing.This explains the observed behavior:
catalog_product_index_price— so the configurable product correctly falls back to the other variant's price.catalog_product_index_price. The configurable product therefore continues to show the wrong (other variant's) price, since the correct variant's price row is missing from the index.Release note
No response
Triage and priority