Mage_Catalog_Model_Product_Option_Observer Class Reference

List of all members.

Public Member Functions

 copyQuoteFilesToOrderFiles ($observer)


Detailed Description

Definition at line 34 of file Observer.php.


Member Function Documentation

copyQuoteFilesToOrderFiles ( observer  ) 

Copy quote custom option files to order custom option files

Parameters:
Varien_Object $observer
Returns:
Mage_Catalog_Model_Product_Option_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     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:41 2009 for Magento by  doxygen 1.5.8