Skip to content

Custom Option with Percent price is converted to a currency twice #26432

Closed
@wintermute-84

Description

@wintermute-84

Preconditions (*)

  1. Magento 2.4-develop
  2. PHP 7.2

Steps to reproduce (*)

  1. Add custom option of type Field, Radio, Checkbox or Date to a product
  2. Set price to be of type percent
  3. Add another currency to a shop
  4. On a product page change a currency to different from shops base currency so that magento converts the prices.

Expected result (*)

  1. Price of custom option should be a percent of products price but in current currency.

Actual result (*)

  1. Percent price is converted twice.

Magento\Catalog\Pricing\Price\CustomOptionPriceCalculator::getOptionPriceByPriceCode():
in case of a percent, is getting price from product's PriceInfo which is converted to a selected currency.
However then on a block levels there different methods for different types of custom options, that end up in CustomOptionPrice::getCustomAmount() that does convertAndRound on already converted amount in case of percent custom option price.

Additional information

-detailed steps with screens #26432 (comment)

Metadata

Metadata

Assignees

Labels

Area: FrontendComponent: PricingEvent: dmcdindia2020Event: mm20inIssue: 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.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S1Affects critical data or functionality and forces users to employ a workaround.Triage: DoneHas been reviewed and prioritized during Triage with Product Managers

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions