Hi,
I already accomplished this:
http://www.awesomescreenshot.com/image/2506685/e9d19b6e328c88bb5fc9995950017bee
which is at http://localhost:81/tastyigniter/admin/orders/edit?id=20010
I want the option names to appear side by side in the order so it's easier to prepare. I'll paste the code of how I did it:
admin/controllers/Orders.php
[php] if (!empty($menu_options)) {
foreach ($menu_options as $menu_option) {
if ($cart_item['order_menu_id'] === $menu_option['order_menu_id']) {
$options_for_item = $this->Menu_options_model->getMenuOptions($menu_option['menu_id']);
foreach($options_for_item as $single_option) {
if($single_option['menu_option_id'] == $menu_option['order_menu_option_id']) {
$category = $single_option['option_name'];
break;
}
}
$option_data[] = '<small>' . $category . '</small>: ' . $menu_option['order_option_name'] . $this->lang->line('text_equals') . $this->currency->format($menu_option['order_option_price']);
}
}
}[/php]
It works, but looping through every single option and comparing seems to be wasteful. I was looking for a function from the Menu_options_model to retrieve the option_name but I couldn't find any.
Is this the only way to retrieve it?
Thanks in advance.