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

Fix Translation of error message on cart for deleted bundle option. #16777

Conversation

swnsma
Copy link
Contributor

@swnsma swnsma commented Jul 13, 2018

Description

  • fix not working translation on Cart Page for error message.

Manual testing scenarios

Pre-conditions

  1. Enabled Inline Translates.
  2. Bundle product #P1 - visible and saleable.
  3. Enabled multishipping.

Steps To Reproduce

  1. Go to Frontend.
  2. Add bundle product to cart.
  3. Go to cart page.
  4. Go to admin panel.
  5. Find bundle product #P1 in Products -> Catalog.
  6. Edit options (e.g. change order of items) and save the product.
  7. Flush cache (System -> Tools -> Cache Management -> Flush Magento Cache).
  8. Go to frontend.
  9. Refresh the page.

Expected Result:

  1. Error messages are shown.
  2. All messages are translatable.

Actual Result:

  1. Error messages are shown.
  2. The message 'The required options you selected are not available.' is not inline translatable.

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)

@magento-engcom-team magento-engcom-team added Partner: ISM eCompany Pull Request is created by partner ISM eCompany partners-contribution Pull Request is created by Magento Partner labels Jul 13, 2018
@magento-engcom-team
Copy link
Contributor

Hi @swnsma. 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

@@ -43,6 +43,6 @@
<plugin name="multishipping_session_mapper" type="Magento\Multishipping\Model\Checkout\Type\Multishipping\Plugin" sortOrder="50" />
</type>
<type name="Magento\Checkout\Controller\Cart">
<plugin name="multishipping_clear_addresses" type="Magento\Multishipping\Model\Cart\Controller\CartPlugin" />
<plugin name="multishipping_clear_addresses" type="Magento\Multishipping\Model\Cart\Controller\CartPlugin" sortOrder="50" />
Copy link
Contributor

Choose a reason for hiding this comment

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

@swnsma, looks pretty unreliable to me. Can you describe what is going on and maybe we will try to elaborate a robust fix together?

Copy link
Contributor Author

@swnsma swnsma Jul 13, 2018

Choose a reason for hiding this comment

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

Hi @orlangur !
In two words, Inline Translate Phrase renderer loads later than error message Phrase become rendered.

The error message source.

__('The required options you selected are not available.')

error message source trace

Rendered become loaded deep in Magento\Framework\App\Action\Plugin\Design plugin call.
The plugin has sort order 30.

<plugin name="designLoader" type="Magento\Framework\App\Action\Plugin\Design" sortOrder="30"/>

renderer load trace

As alternative, sort order for this plugin could be set to 0, to prevent possible issue in future.

…ted bundle option.

- change plugin sort order in case to prevent loading of not translatable messages for Localized exception in beforeDispatch plugin.
@magento-engcom-team
Copy link
Contributor

Hi @swnsma. Thank you for your contribution.
We will aim to release these changes as part of 2.2.7.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Multishipping Component: Store Partner: ISM eCompany Pull Request is created by partner ISM eCompany partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants