Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout cart totals.js throws an error when estimating shipping #5358

Closed
ghost opened this issue Jun 29, 2016 · 2 comments
Closed

Checkout cart totals.js throws an error when estimating shipping #5358

ghost opened this issue Jun 29, 2016 · 2 comments
Assignees
Labels
bug report Component: Checkout Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@ghost
Copy link

ghost commented Jun 29, 2016

Steps to reproduce

  1. Add a product to the cart
  2. Make sure you have at least one Shipping Method active (e.g. Flat Rate)
  3. Navigate to Shopping Cart page
  4. Observe the result

Expected result

  1. Shipping should be estimated without errors

Actual result

  1. Loading indicator keeps spinning
  2. There is an exception thrown in IE console "Object doesn't support this action"

Observations

Reproduceable when using Internet Explorer 9+ browser.
It happens because in the file "magento/module-checkout/view/frontend/web/js/view/cart/totals.js" there are two calls to instantiate event by using new Event('resize') which is not supported by Internet Explorer.
One possible fix would be to refactor the event dispatch calls to something like below:

initialize: function () {
    this._super();
    var self = this;
    totalsService.totals.subscribe(function () {
        self._dispatchEvent();
    });
    shippingService.getShippingRates().subscribe(function () {
        self._dispatchEvent();
    });
},
_dispatchEvent: function () {
    // backward compatibility with IE
    var event = document.createEvent('Event');
    event.initEvent('resize', true, true);
    window.dispatchEvent(event);
}

Magento Versions

Magento 2.1 and develop branch.

@sdzhepa
Copy link
Contributor

sdzhepa commented Jul 6, 2016

@alexgifts Thank you for reporting this issue. We have created an internal ticket MAGETWO-55115 to fix the problem.

@sdzhepa sdzhepa added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report labels Jul 6, 2016
@vkorotun vkorotun removed the CS label Aug 4, 2016
@olysenko
Copy link

hi, fix was delivered in develop branch, see commit. Closed as fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Checkout Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

5 participants