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 #9924, prefill prefix and suffix in checkout shipping address #9925

Merged
merged 5 commits into from
Jun 15, 2017

Conversation

AntonEvers
Copy link
Contributor

@AntonEvers AntonEvers commented Jun 13, 2017

Description

Prefill prefix and suffix in the checkout if they are present on a logged in customer.

Fixed Issues (if relevant)

  1. Prefix and suffix are not prefilled in the quote shipping address #9924 : Prefix and suffix are not prefilled in the quote shipping address

Manual testing scenarios

  1. start an order, using an existing account with a prefix and a suffix
  2. visit the shipping address step in the checkout
  3. prefix and suffix should be prefilled in the shipping address form for customers without an address
  4. prefix and suffix should be prefilled in the NEW shipping address form for customers with addresses

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)

@ishakhsuvarov ishakhsuvarov self-assigned this Jun 13, 2017
@ishakhsuvarov ishakhsuvarov added this to the June 2017 milestone Jun 13, 2017
/**
* @return null|string
*/
protected function getDefaultPrefix()
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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 ;)

Copy link
Contributor Author

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.

@AntonEvers
Copy link
Contributor Author

@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
  ...
@magento-team magento-team merged commit 322c357 into magento:develop Jun 15, 2017
magento-team pushed a commit that referenced this pull request Jun 15, 2017
magento-team pushed a commit that referenced this pull request Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants