Public Member Functions | |
copyQuoteFilesToOrderFiles ($observer) |
Definition at line 34 of file Observer.php.
copyQuoteFilesToOrderFiles | ( | $ | observer | ) |
Copy quote custom option files to order custom option files
Varien_Object | $observer |
Definition at line 42 of file Observer.php.
00043 { 00044 /* @var $quoteItem Mage_Sales_Model_Quote_Item */ 00045 $quoteItem = $observer->getEvent()->getItem(); 00046 00047 if (is_array($quoteItem->getOptions())) { 00048 foreach ($quoteItem->getOptions() as $itemOption) { 00049 $code = explode('_', $itemOption->getCode()); 00050 if (isset($code[1]) && is_numeric($code[1]) && ($option = $quoteItem->getProduct()->getOptionById($code[1]))) { 00051 if ($option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_FILE) { 00052 /* @var $_option Mage_Catalog_Model_Product_Option */ 00053 try { 00054 $group = $option->groupFactory($option->getType()) 00055 ->setQuoteItemOption($itemOption) 00056 ->copyQuoteToOrder(); 00057 00058 } catch (Exception $e) { 00059 continue; 00060 } 00061 } 00062 } 00063 } 00064 } 00065 return $this; 00066 }