Skip to content

msrp module error breaks the swatches on product configuration page #23832

@drabikowy

Description

@drabikowy

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%202019-07-23%20at%2010.00.31%20AM.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: StoreIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: 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 developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions