From 52fb4720a95efc10f73dc4e6ff67c09016ab2d04 Mon Sep 17 00:00:00 2001 From: Mathieu Gauthier Date: Tue, 4 Apr 2017 16:19:57 -0400 Subject: [PATCH] Add options in Backend / Order detail page / Email --- .../Sales/Model/Order/Item.php | 37 +++++++++++++++++++ .../SimpleConfigurableProducts/etc/config.xml | 5 +++ 2 files changed, 42 insertions(+) create mode 100644 app/code/community/OrganicInternet/SimpleConfigurableProducts/Sales/Model/Order/Item.php diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Sales/Model/Order/Item.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Sales/Model/Order/Item.php new file mode 100644 index 0000000..590d985 --- /dev/null +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Sales/Model/Order/Item.php @@ -0,0 +1,37 @@ +_getData('product_options')) { + $options = unserialize($options); + + // If options not found, fetch them from super attribute + if(!isset($options['attributes_info']) && isset($options['info_buyRequest']['super_attribute'])){ + $storeId = Mage::app()->getStore()->getId(); + $info = array(); + foreach($options['info_buyRequest']['super_attribute'] as $k => $v){ + $attributeModel = Mage::getModel('eav/entity_attribute')->load($k); + + $info[] = array( + 'label' => $attributeModel->getStoreLabel($storeId), + 'value' => $attributeModel->getSource()->getOptionText($v) + ); + } + + if(!empty($info)) { + $options['attributes_info'] = $info; + } + } + + return $options; + } + return array(); + } + +} diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml index 1e692c1..022abf3 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml @@ -55,6 +55,11 @@ OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price + + + OrganicInternet_SimpleConfigurableProducts_Sales_Model_Order_Item + +