-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Improvement: Magento\Sales\Helper\Guest refactoring and bugfix #12893
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
Improvement: Magento\Sales\Helper\Guest refactoring and bugfix #12893
Conversation
…d with interceptor type
Hello @orlangur ! Thank you for your attention to my PR and self-assigned. Could you please update me with a possible date when you will have time to check it? Looking forward to your reply, |
Hi @orlangur , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @coderimus,
- Moved $this->hasPostDataEmptyFields($post) to ternary operator because this is good to have all conditions according to order in one place.
This changed logic a bit actually loading from cookie when it didn't load from cookie before but I didn't find any negative consequences of this.
No objections from implementation side, LGTM, small note on
Those changes didn't change business logic. Only code improvement and, as a result, no manual testing scenarios.
actually, we need to perform manual testing to assure the changes didn't change the logic unless we determined it is covered with some automated tests.
Hi @orlangur, thank you for the review. |
Dear Magento2,
This PR consists of several improvements and bug fixes. The main goal of it is to increase performance and logic side of the Magento\Sales\Helper\Guest. Please, review Description section for more information.
Looking forward to your reply,
Alex
Description
The main improvements here are in the
Magento\Sales\Helper\Guest::getOrderRecord($incrementId)
Added
store_id
as filter to search criteria to improve logic/performance and due to this fact theMagento\Sales\Helper\Guest::validateOrderStoreId($orderStoreId)
can be removed.Replaced
with
This allows Magento to reduce the number of database queries because every time when the
getTotalCount()
is called it initiates thegetSize()
method which checks the$this->_totalRecords
value but in this case it equals tonull
every new call because every new call begins after page load.Moved
$this->hasPostDataEmptyFields($post)
to ternary operator because this is good to have all conditions according to order in one place.Fixed typo
compareSoredBillingDataWithInput
tocompareStoredBillingDataWithInput
Removed underscore
private $_storeManager;
toprivate $storeManager;
(PSR-2: Property names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility.)Fixed Issues (if relevant)
No relevant issue.
Manual testing scenarios
Those changes didn't change business logic. Only code improvement and, as a result, no manual testing scenarios.
Contribution checklist