Skip to content

Commit 3f7b080

Browse files
authored
ENGCOM-5312: #22998 : failing order creation with api when no address email is provided #23048
2 parents 1c65a63 + 299036a commit 3f7b080

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/code/Magento/Sales/Model/Order/Address.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,5 +730,16 @@ public function setExtensionAttributes(\Magento\Sales\Api\Data\OrderAddressExten
730730
return $this->_setExtensionAttributes($extensionAttributes);
731731
}
732732

733+
/**
734+
* @inheritdoc
735+
*/
736+
public function beforeSave()
737+
{
738+
if ($this->getEmail() === null) {
739+
$this->setEmail($this->getOrder()->getCustomerEmail());
740+
}
741+
return parent::beforeSave();
742+
}
743+
733744
//@codeCoverageIgnoreEnd
734745
}

0 commit comments

Comments
 (0)