Skip to content

[Forwardport] [FIX]: Recent orders are not filtered per store at the customer account page #14910

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

Conversation

rostyslav-hymon
Copy link
Contributor

Original Pull Request

#13257

Description

Hello,

In this PR I provide fix for filtering recent orders block where previously orders were not filtered by store. You can have account and orders from two different stores and when you logged-in to one of those stores you will see recent orders but it is possible to see orders from all stores belong to a website.

Main changes:

  1. Magento\Sales\Block\Order\Recent
  • Move recent orders select to separate method
  • Filter selected collection by current store
  1. Magento\Sales\Test\Unit\Block\Order\RecentTest
  • Change test according to the class method changes
  1. app/code/Magento/Sales/view/frontend/templates/order/recent.phtml
  • Change sizeof() to count() and execute it only once instead of double call

Best regards,
Alex

Fixed Issues (if relevant)

N/A

Manual testing scenarios

  1. Create 2 stores on one website
  2. Create account.
  3. Place orders for two different store
  4. Log In to previously created account for which you created orders and check Recent Orders section. It will show orders for all stores

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)

/**
* Get recently placed orders. By default they will be limited by 5.
*/
protected function getRecentOrders()
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @rostyslav-hymon , due to Magento backward compatibility we can't introduce new public and protected methods. Please change it to private.
Backward compatible development

@VladimirZaets
Copy link
Contributor

Hi @rostyslav-hymon , any updates?

@rostyslav-hymon
Copy link
Contributor Author

Hi @VladimirZaets , 2bb9b69

@VladimirZaets
Copy link
Contributor

@rostyslav-hymon thanks

@magento-engcom-team magento-engcom-team merged commit 2bb9b69 into magento:2.3-develop May 6, 2018
magento-engcom-team pushed a commit that referenced this pull request May 6, 2018
@magento-engcom-team
Copy link
Contributor

Hi @rostyslav-hymon. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

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.

4 participants