I want to get details of custom options which selected whenever customer choose at order time.
Thanks
Please try this:
foreach ($order->getAllItems() as $item) {
$options = $item->getProductOptions();
if (isset($options['options']) && !empty($options['options'])) {
foreach ($options['options'] as $option) {
var_dump($option); //Look into the dump data for what you are looking for.
}
}
}