Skip to content

Commit 299036a

Browse files
ENGCOM-5312: #22998 : failing order creation with api when no address email is provided #23048
- Merge Pull Request #23048 from Wirson/magento2:22998-order-create-api-failure - Merged commits: 1. 5ca9ea7
2 parents ef49ac6 + 5ca9ea7 commit 299036a

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)