I have a product with several user options that customers can select. Examples:
Product: Flower basket of 10 colors (SKU 100) Custom options:
Qty red roses: reset from 0 to 10 (each with SKU 200)
Qty purple roses: reset from 0 to 10 (each with SKU 300)
Qty pink tulips: drop from 0 to 10 (each with SKU 400)
Thus, the customer can build their own basket. However, now I have to export my orders to the warehouse system, and I need to specify the Custom Option SKU with the value (qty). Although I can get the label and value from the Order Item. No SKU.
I get my stuff like this:
$orders = Mage::getModel('sales/order')->getCollection() ->addAttributeToFilter('status', array('eq' => 'processing')); foreach ($orders as $order) { foreach ($order->getAllItems() as $order_item) { $optionsArr = $order_item->getProductOptions(); if (count($optionsArr['options']) > 0) { foreach ($optionsArr['options'] as $option) { $optionTitle = $option['label']; $optionId = $option['option_id']; $optionValue = $option['value'];
Any ideas on how to get an SKU for each custom option selected?
Micor source share