-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 #9924, prefill prefix and suffix in checkout shipping address #9925
Conversation
/** | ||
* @return null|string | ||
*/ | ||
protected function getDefaultPrefix() |
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.
Magento does not encourage usage of protected
methods.
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.
Good to know. Because of plugins right?
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.
Because we do not encourage inheritance-based API. So composition in favor of inheritance. It's easier to maintain and reuse.
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.
Ah yes of course. That makes sense.
@@ -316,20 +316,19 @@ protected function getMultilineFieldConfig($attributeCode, array $attributeConfi | |||
protected function getDefaultValue($attributeCode) | |||
{ | |||
switch ($attributeCode) { |
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.
Wouldn't it be better if you return null
straight away, at the beginning of the method in case where there is no customer? I guess it should reduce complexity that way, since you would not have to check for customer every time.
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.
Hahaha, brilliant... I guess programming for 12 hours straight is not paying off ;)
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.
Correction, $this->directoryHelper->getDefaultCountry()
doesn't need a customer. Let me draft up a commit.
@ishakhsuvarov how about this? |
…-9924 * upstream/develop: (60 commits) Fix typo in comment Move prefix and suffix default values to a new PR MAGETWO-68877: Issue magento#7988 Typo changed also added comments for each index, getters and setters. magento#9484 Revert "MAGETWO-69728: Fixes layered navigation options being cached using the wrong store id. magento#9873" MAGETWO-67500: setup:di:compile returns exit code 0 if errors are found magento#7780 Fix prefix, middle name and suffix were not prefilled in the checkout add middle name to checkout address html templates magento#8878 Using Command output as message which actually provides more information for debugging than just the path Handling CLI error as a failure when validating composer.json file MAGETWO-69805: Return array of blocks as items instead of array of arrays magento#9157 MAGETWO-69666: Return array of pages as items instead of array of arrays magento#9823 MAGETWO-69723: Email to a Friend feature magento#9824 MAGETWO-69539: PHP "soap" extension is not declared in composer.json but can be used by Magento modules MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-63054: [Catalog] MSRP field is not displayed for bundle products with fixed price MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories ...
Description
Prefill prefix and suffix in the checkout if they are present on a logged in customer.
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist