Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect min price calculation for products with custom options. #7740

Closed
PiimegaOy opened this issue Dec 9, 2016 · 2 comments
Closed

Incorrect min price calculation for products with custom options. #7740

PiimegaOy opened this issue Dec 9, 2016 · 2 comments
Labels
bug report Component: Catalog Component: Tax Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@PiimegaOy
Copy link

Preconditions

  1. Magento 2.1
  2. PHP 7.0.8 & MySQL 5.6.31-0ubuntu0.14.04.2

Steps to reproduce

  1. Make product with custom options set as required, where you have both free and non free options available

Expected result

  1. The minimal price in catalog_product_options_type_price should be the base price without the custom option price added. (Since even though the custom option is required there is free option available for customer to choose)

Actual result

  1. The minimal price in catalog_product_options_type_price has the custom option price included.

I got this explanation of the issue from one of our developers:

When saving product with options, Magento saves prices of these options in the table ‘catalog_product_options_type_price’. Code for this operation can be found in \Magento\Catalog\Model\ResourceModel\Product\Option\Value method _saveValuePrices. On the line 98, it check condition “$object->getPrice() $priceType“ and saves price only if it is true. Because for a free options price is zero, it causes that prices for free options are not saved in the table.

When reindexing product prices, prices of custom options are applied in the Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice method _applyCustomOption. At the line 457 it join the table ‘catalog_product_options_type_price’ in order to get minimal values of prices. Because originally this table does not contain zero prices, they are not applied to the minimal price calculation and, thus, not-minimal value of price is used instead.

@vityakopin
Copy link

Unfortunately, I could not reproduce the issue as you described it. Can you reproduce this issue on latest version of Magento?

@magento-engcom-team magento-engcom-team added 2.1.x bug report Component: Catalog Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update Component: Tax Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch labels Sep 11, 2017
@magento-engcom-team
Copy link
Contributor

@PiimegaOy we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Component: Tax Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests

4 participants