magento2: msrp module error breaks the swatches on product configuration page

Preconditions (*)

  1. Magento 2.3.1 Theme Luma
  2. Msrp module is disabled

Steps to reproduce (*)

  1. Add a configurable product
  2. 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
  1. Go to created product’s pdp, select color swatch + text swatch and add it to cart
  2. Open minicart and click “edit” button to go to product configuration page

Expected result (*)

  1. Previously selected configuration should be saved and swatches should be selected
  2. 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)

Most upvoted comments

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):

Hi, @drabikowy https://github.com/drabikowy ! How did you disable the Msrp module? Because when i turned it off my magento stopped working: [image: wowowo] https://user-images.githubusercontent.com/51680850/61707469-3aafc780-ad53-11e9-82b2-b5e6d3aeef16.png Frontent doesn’t work either.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/23832?email_source=notifications&email_token=AFKUNBLMDMQPPSVFLFJPRQLQA3RK3A5CNFSM4IGBQRK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2SYP5Y#issuecomment-514164727, or mute the thread https://github.com/notifications/unsubscribe-auth/AFKUNBOCHKC5QPLMC4X3YCLQA3RK3ANCNFSM4IGBQRKQ .