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

Bugfix > Adding Success Message > Recent Ordered #9852

Merged
merged 5 commits into from Jul 10, 2017

Conversation

rafaelstz
Copy link
Member

@rafaelstz rafaelstz commented Jun 5, 2017

Adding a Success message

Description

I've fixed the issue with success message when the customer adds a product to the cart using the sidebar "Recent Ordered" like that image:

image

Manual testing scenarios

  1. Buy some items.
  2. Access your Customer Account page.
  3. Select a product in Recent Ordered products listed.
  4. Click Add to Cart button.
  5. The success message not will show.

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)

@miguelbalparda miguelbalparda self-assigned this Jun 6, 2017
@miguelbalparda miguelbalparda added this to the June 2017 milestone Jun 6, 2017
@miguelbalparda
Copy link
Contributor

@rafaelstz I'll be reviewing this, will get back to you in case we have any questions or feedback. Thanks for the contribution!

@miguelbalparda
Copy link
Contributor

@rafaelstz I checked the code and all the tests are passing. The only thing I saw is that Magento escapes the name of the product. Can you add that to the PR so we maintain the same code style?

@rafaelstz
Copy link
Member Author

Done @miguelbalparda 👍

@@ -53,13 +59,15 @@ public function __construct(
\Magento\Checkout\Model\Session $checkoutSession,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator,
CustomerCart $cart
CustomerCart $cart,
Escaper $escaper
Copy link
Contributor

Choose a reason for hiding this comment

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

Your change is not backward compatible. Could you make it optional with fallback to get this object from object manager?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not really sure using the OM is the right approach, @rafaelstz thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you have some time to work on this @rafaelstz? Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Not yet @miguelbalparda 😞

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @rafaelstz Please, review this document: http://devdocs.magento.com/guides/v2.0/contributor-guide/backward-compatible-development/#adding-a-constructor-parameter

There is an example how to add new constructor argument in a backward compatible way (mentioned by @ihor-sviziev)

@@ -53,13 +59,15 @@ public function __construct(
\Magento\Checkout\Model\Session $checkoutSession,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator,
CustomerCart $cart
CustomerCart $cart,
Escaper $escaper
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @rafaelstz Please, review this document: http://devdocs.magento.com/guides/v2.0/contributor-guide/backward-compatible-development/#adding-a-constructor-parameter

There is an example how to add new constructor argument in a backward compatible way (mentioned by @ihor-sviziev)

@okorshenko
Copy link
Contributor

@rafaelstz please let me know if you need some help

@rafaelstz
Copy link
Member Author

@okorshenko I did right?

@miguelbalparda
Copy link
Contributor

There are some code style tests failing now, more details here.

) {
$this->_formKeyValidator = $formKeyValidator;
$this->_scopeConfig = $scopeConfig;
$this->_checkoutSession = $checkoutSession;
$this->_storeManager = $storeManager;
$this->cart = $cart;
$this->cart = $cart;
$this->escaper = $escaper ?: \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Framework\Escaper::class);
Copy link
Contributor

Choose a reason for hiding this comment

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

looks good

@@ -31,6 +32,7 @@ public function __construct(
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator,
\Magento\Checkout\Model\Cart $cart,
\Magento\Framework\Escaper $escaper,
Copy link
Contributor

Choose a reason for hiding this comment

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

this argument must be optional according to parent class.
Please update all other child classes of \Magento\Checkout\Controller\Cart with new optional argument

@okorshenko
Copy link
Contributor

Hi @rafaelstz you fixed the constructor correctly. Please look at my review comments
Thank you

@okorshenko okorshenko modified the milestones: June 2017, July 2017 Jul 2, 2017
@okorshenko okorshenko self-assigned this Jul 7, 2017
@magento-team magento-team merged commit 58ee67d into magento:develop Jul 10, 2017
magento-team pushed a commit that referenced this pull request Jul 10, 2017
magento-team pushed a commit that referenced this pull request Jul 10, 2017
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

5 participants