magento2: msrp module error breaks the swatches on product configuration page
Preconditions (*)
- Magento 2.3.1 Theme Luma
- Msrp module is disabled
Steps to reproduce (*)
- Add a configurable product
- Create a configurations for product:
- add two new attributes: color swatch + text swatch
- add separate pictures eg. for color variants
- apply same price to all skus
- apply same quantity to all skus
- Go to created product’s pdp, select color swatch + text swatch and add it to cart
- Open minicart and click “edit” button to go to product configuration page
Expected result (*)
- Previously selected configuration should be saved and swatches should be selected
- Click on the swatch should change the product image (if configured)
Actual result (*)
In console there is an msrp module error which breaks the swatches functionallity:
- preselection of previously selected configuration does not work
- if you configured swatches to change product gallery - this stops working, too
Here is the error that appears:
https://d2aztkdj0ezvrk.cloudfront.net/items/2X3y2T3r163y0i232k16/Image 2019-07-23 at 10.00.31 AM.png
And form my investigation, error is triggered in swatches-renderer.js
OnClick method, where below logic triggers the “updateMsrpPriceBlock” event:
$(document).trigger('updateMsrpPriceBlock',
[
parseInt($this.attr('index'), 10) + 1,
$widget.options.jsonConfig.optionPrices
]);
On regular PDP, msrp module does not listen to this event, while on product configuration page it does - even if msrp is disabled. Either msrt should not listen here, too or wrong data is passed to this event and it breaks.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (10 by maintainers)
Hello!
Actually it was disabled by default on provided instance.
I mean in stores->configuration->sales->minimum advertised price - I didn’t touch this settings
W dniu wt., 23.07.2019 o 13:10 Robert Turchyn notifications@github.com napisał(a):