0

Default values are not rendering on wishlist product edit page

Steps to generate the issue:

  1. Navigate to any configurable product page on the frontend.
  2. Select the dropdown options and add the product to wishlist.
  3. Navigate to My Wishlist page.
  4. Click on Edit link given in wishlist item.

enter image description here

Expected Result:

It should auto-select the dropdown options on wishlist product edit page.

enter image description here

Actual Result:

It doesn't auto-select the dropdown options.

enter image description here

Additional note: When I flush the cache and then click on Edit link, it auto-select the options.

I have checked it in Magento 2.2.2 and 2.2.4

1 Answer 1

0

Try below code for fix Auto-select the dropdown options on wishlist product edit page.

Rewrite options-updater.js file and add below fix.

File path:

magento/vendor/magento/module-configurable-product/view/frontend/web/js/options-updater.js

Find below line from options-updater.js

$(selectors.formSelector).on(this.eventName, function () {

and add this.updateOptions(); after complete that funtion.

Before fix issue:

$(selectors.formSelector).on(this.eventName, function () {
    this.setProductOptions(cartData());
    this.updateOptions();
}.bind(this));

After fix issue:

$(selectors.formSelector).on(this.eventName, function () {
    this.setProductOptions(cartData());
    this.updateOptions();
}.bind(this));
this.updateOptions();

Hope it help!

Let me know if any issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.