How to Use “checkout_type_multishipping_create_orders_single” Event in Magento 2

How to Use "checkout_type_multishipping_create_orders_single" Event in Magento 2

In a Magento 2 store, the admin may want to configure multiple shipping addresses that allows customers to have their orders delivered to more than one address on the checkout page. Admin may need to add a custom field in multi shipping of the checkout page in Magento 2 store, i.e., Extra Fee.

While adding a custom field, it requires adding its value to the sales_order_table to validate that value. In that case, you need to override the event and observer. Events in Magento 2 are dispatched based on an action performed, and it passes data to the observer. Observers are Magento classes that are executed when an event is dispatched.

In that scenario, you need to use “checkout_type_multishipping_create_orders_single” event in Magento 2.

Method to Use “checkout_type_multishipping_create_orders_single” Event in Magento 2

  1. Create event.xml file at Vendor\Module\etc

  2. Create MultiSurchargeOrder.php file at Vendor\Module\Observer

Follow these steps and enhance the customer experience!

Doubts will be entertained in the Comments section below. Also, let me know how have you used this order data for the betterment.

I would be happy to help.

Feel free to share the solution with Magento Community via social media.

Thank You.

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

(based on 2 Reviews)

Krishna is a Magento developer at Meetanshi. She is always ready to learn new things. Apart from work, she likes to read books and spend time with family.

Leave a reply:

Your email address will not be published.