Skip to content

Wrong price indexed for configurable/composite products #24953

Open
@ilnytskyi

Description

@ilnytskyi

Preconditions (*)

magento 2.3

Steps to reproduce (*)

  1. Edit price or special_price on configurable product from mass action grid or saving attribute via resource model $this->productResource->saveAttribute($product, 'price'); or
    $this->productResource->saveAttribute($product, 'special_price');
  2. Run reindex from cron (mb. CLI reindex as well)
  3. See the price from attributes appeared on product grid
  4. See the price from attributes in columns price and final_price in the table catalog_product_index_price
  5. Then save configurable product from admin edit page
  6. See null value saved for price attribute in catalog_product_entity_decimal
  7. Wait for price reindex from cron (mb. CLI reindex as well)
  8. Repeat step 4 and see 0 saved in columns price and final_price for edited configurable product

to find prices saved for configurable product use this SQL

SELECT decimal2.*
FROM catalog_product_entity
       inner join catalog_product_entity_decimal decimal2 on catalog_product_entity.entity_id = decimal2.entity_id and
                                                             attribute_id in (SELECT attribute_id
                                                                              from eav_attribute
                                                                              where attribute_code in
                                                                                    ('price', 'special_price'))
where type_id = 'configurable';

Expected result (*)

  1. Price never saved for a configurable product in catalog_product_entity_decimal table from any save point e.g. resource model, repository
  2. Price indexed correctly in catalog_product_index_price (data for composite products should be calculated based on child products) e.g. final_price = min_price, price = max_price attribute values from catalog_product_entity_decimal should be ignored

Actual result (*)

  1. Still possible to save price and special_price for configurable/composite product in catalog_product_entity_decimal table
  2. Wrong calculation of columns price and final_price in the catalog_product_index_price table

Metadata

Metadata

Assignees

Labels

Component: ConfigurableProductComponent: EavComponent: IndexerComponent: PricingEvent: Global-Contribution-DayIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Priority: P3May be fixed according to the position in the backlog.Progress: PR in progressReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

Status

Pull Request In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions