Closed
Description
During initialization of priceBox the following code is executed:
this._setDefaultsFromPriceConfig();
this._setDefaultsFromDataSet();
However _setDefaultsFromPriceConfig
relies on this.options.productId
. This value is set in setDefaultsFromDataSet
here.
Current sequence of function calls leaves this.options.productId
always empty in this._setDefaultsFromPriceConfig()
.
I stumbled upon this issue while trying to add a custom price type and configuring priceBox to render it. With the current sequence of calls priceBox seem to ignore the configuration of the price types.
Preconditions
No pre-conditions. Just debug the function using browser developer tools.
Steps to reproduce
- Create a product which has a price.
- Navigate to the product details page
- Using your JS debugger set the breakpoint on https://github.com/magento/magento2/blob/develop/app/code/Magento/Catalog/view/base/web/js/price-box.js#L206
Expected result
- The line should be executed.
Actual result
- This line never gets called.