How to get addons per item
-
Hi, first I have to say is congratulations for your plugin, it is great. I would appreciate if you could help me with this issue: I am trying to get the addons per item for an order so that I am using the following code:
foreach ($order->get_items() as $item_id => $item_data) {
$product_name = $item_data[‘name’];
$item_quantity = $order->get_item_meta($item_id, ‘_qty’, true);
$item_addons = $order->get_item_meta($item_id, ‘_zaddon_values’, true);$orderdetails = $item_quantity . ‘ x ‘ . $product_name . $item_addons . ‘<br>’ .”\r\n” . $orderdetails;
}Unfortunately what I am getting for the addons is:
{“1”:{“1”:{“value”:[1,2],”type”:”checkbox”}}}
So could you tell how to properly get the addons per item, or what would be the right way to use this function?:
$item_addons = $order->get_item_meta($item_id, ‘_zaddon_values’, true);
Thank you! ??
- The topic ‘How to get addons per item’ is closed to new replies.