Magento Asked by Marceli Po on December 30, 2021
I would like to post some data in admin order create form and check if it exists and is set if not throw an exception.
I was thinking about adminhtml_sales_order_create_process_data
event, but it is called several times. I think it would be nice to have some sort of event before the admin order is saved and check if this data exists.
Create a plugin for Sales/Model/Order by putting smth like this in your module, in di.xml
<type name="MagentoSalesModelOrder">
<plugin name="YOUR NAME" type="Your-ModuleSalesPluginSalesModelOrder" sortOrder="10" disabled="false"/>
</type>
Then, in Order.php create
public function beforeSave(MagentoSalesModelOrder $subject)
{
$subject->getData()
// this is your order Data before saving it
}
Answered by Andrei Dinu on December 30, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP