I created an observer on checkout_onepage_controller_success_action
event, I want to get selected custom options values for this particular order. How can I do this please help? Please check the following code:
public function execute(Observer $observer) {
$order_id = $observer->getEvent()->getOrderIds()[0];
// \Magento\Sales\Api\OrderRepositoryInterface
$order = $this->_orderRepositoryInterface->get($order_id);
$order_items = $order->getItems();
foreach ($order_items as $order_item) {
//Here I want to get selected custom options values for each item
//With other fields like product name, price and other product related data
}
}