Skip to content

Commit

Permalink
merge with 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
solwininfotech committed Nov 20, 2019
1 parent ab86799 commit 74cfd18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions app/code/Magento/Sales/Model/AdminOrder/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -2038,11 +2038,11 @@ protected function _validate()
protected function _getNewCustomerEmail()
{
$email = $this->getData('account/email');

if ($email || $this->isEmailRequired()) {
return $email;
}

return $this->generateEmail();
}

Expand All @@ -2055,7 +2055,8 @@ private function isEmailRequired(): bool
{
return (bool)$this->_scopeConfig->getValue(
self::XML_PATH_EMAIL_REQUIRED_CREATE_ORDER,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
$this->_session->getStore()->getId()
);
}

Expand All @@ -2075,7 +2076,7 @@ private function generateEmail(): string
$account = $this->getData('account');
$account['email'] = $email;
$this->setData('account', $account);

return $email;
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Sales/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</dev>
<customer>
<create_account>
<email_required_create_order>0</email_required_create_order>
<email_required_create_order>1</email_required_create_order>
</create_account>
</customer>
</default>
Expand Down

0 comments on commit 74cfd18

Please sign in to comment.