Skip to content

Commit 5ca9ea7

Browse files
committed
#22998 : failing order creation with api when no address email is provided
1 parent 4b2bbc7 commit 5ca9ea7

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)