magento2: Admin Loads and Saves Bundle Product Child Items Price if Set to $0 - Incorrectly Inflates Product Price
Summary of Issue
When a child item of a bundle product has a price of $0.00
, editing the parent bundle product in the admin sets the child items as their product price. Then when you save the parent bundle product, those child product prices are saved and overwrites the $0.00
set to them. This results in an undesired inflation of the parent bundle product price.
To avoid this you have to manually set the child item price to $0.00
prior to saving.
This issue did not exist in v2.4.1. It was added by a code addition in v2.4.2.
Preconditions (*)
- Magento version 2.4.2 (not present in version 2.4.1)
- Magento Admin
Steps to reproduce (*)
- Create a bundle product
- Set at least one Bundle Item to the product using the Add Option button with the following configuration:
- Input Type: Checkbox
- Required: Yes
- Is Default: Yes
- Price: $0.00
- Price Type: Fixed
- Default Quantity: 1
- Save product
- Note that the price of that child item is not set to $0.00 like was set in step 2
- Query this product in the database in table
catalog_product_bundle_selection
and notice that theselection_price_value
column is set to0.0000
- Save the product
- Query this product in the database in table
catalog_product_bundle_selection
and notice that theselection_price_value
column is NOT set to0.0000
- instead it’s set to the price of the child product
- Query this product in the database in table
Expected result (*)
- A price of
$0.00
should be respected and not overridden by the child products price
Actual result (*)
- The product price is saved - overriding the
$0.00
and thus un-intentionally inflating the product price.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (3 by maintainers)
The bug is here:
The comparator should be just
<
- not<=
.So the code should be: