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

Check for new session messages after cart totals have been processed. #17126

Conversation

navarr
Copy link
Member

@navarr navarr commented Jul 25, 2018

Useful for third party modules that may perform operations during totals calculation (e.g. third party tax services)

Description

This change asks customerData to reload its messages after the cart's default totals processor has completed (success or failure).

Fixed Issues (if relevant)

Resolves BUNDLE-1495

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Useful for third party modules that may calculate totals.
@magento-engcom-team
Copy link
Contributor

Hi @navarr. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@osrecio
Copy link
Member

osrecio commented Jul 26, 2018

Hi @navarr , Thanks for your contribution. Can you check the Travis Errors ?

@osrecio osrecio self-assigned this Jul 26, 2018
@osrecio
Copy link
Member

osrecio commented Jul 27, 2018

Thanks @navarr , now looks like ok. I will test ASAP and I will proceed to process.

@@ -61,6 +61,8 @@ define([
}).always(function () {
// Stop loader for totals block
totalsService.isLoading(false);
// Check for new session messages
customerData.reload('messages');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such changes will add one more request to the server on every totals calculation request. I think it's not optimal way for define extension points. Messages should be reloaded only in cases when needed (by additinal handlers in 3d party extensions).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. #17127 takes care of that.

Only concern at this point is that there's no way for one module to know if another has decided to do that, but I think it'll be fine. I'll retract this PR then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants