Skip to content

Commit 74cfd18

Browse files
author
solwininfotech
committed
merge with 2.3
1 parent ab86799 commit 74cfd18

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/code/Magento/Sales/Model/AdminOrder/Create.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,11 +2038,11 @@ protected function _validate()
20382038
protected function _getNewCustomerEmail()
20392039
{
20402040
$email = $this->getData('account/email');
2041-
2041+
20422042
if ($email || $this->isEmailRequired()) {
20432043
return $email;
20442044
}
2045-
2045+
20462046
return $this->generateEmail();
20472047
}
20482048

@@ -2055,7 +2055,8 @@ private function isEmailRequired(): bool
20552055
{
20562056
return (bool)$this->_scopeConfig->getValue(
20572057
self::XML_PATH_EMAIL_REQUIRED_CREATE_ORDER,
2058-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
2058+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
2059+
$this->_session->getStore()->getId()
20592060
);
20602061
}
20612062

@@ -2075,7 +2076,7 @@ private function generateEmail(): string
20752076
$account = $this->getData('account');
20762077
$account['email'] = $email;
20772078
$this->setData('account', $account);
2078-
2079+
20792080
return $email;
20802081
}
20812082

app/code/Magento/Sales/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
</dev>
114114
<customer>
115115
<create_account>
116-
<email_required_create_order>0</email_required_create_order>
116+
<email_required_create_order>1</email_required_create_order>
117117
</create_account>
118118
</customer>
119119
</default>

0 commit comments

Comments
 (0)