Netgo_Prohistory - Version 1.0.0

Version Notes

First Preview Release

Download this release

Release Info

Developer NetGo
Extension Netgo_Prohistory
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Netgo/Prohistory/Block/Adminhtml/Catalog/Product/Edit/Tab/Order.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** Product Order History Extension ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Prohistory
9
+ * @author Vipin
10
+ * @dev 77vips@gmail.com
11
+ *
12
+ */
13
+ class Netgo_Prohistory_Block_Adminhtml_Catalog_Product_Edit_Tab_Order extends Mage_Adminhtml_Block_Widget_Grid{
14
+ /**
15
+ * @access Public
16
+ * @author Vipin
17
+ * @dev 77vips@gmail.com
18
+ * @output NA
19
+ */
20
+ public function __construct(){
21
+ parent::__construct();
22
+
23
+ }
24
+
25
+ /**
26
+ * @access Public
27
+ * @author Vipin
28
+ * @dev 77vips@gmail.com
29
+ * @output Return the product orders
30
+ */
31
+ protected function _prepareCollection() {
32
+ $this->unsetChild('reset_filter_button');
33
+ $this->unsetChild('search_button');
34
+
35
+ $collection = Mage::getModel('sales/order')->getCollection();
36
+ $collection->getSelect()
37
+ ->join(
38
+ array('itemz' => Mage::getSingleton('core/resource')->getTableName('sales/order_item')),
39
+ 'main_table.entity_id = itemz.order_id',
40
+ array('itemz.*')
41
+ );
42
+
43
+ $collection->addAttributeToFilter('itemz.sku', $this->getProduct()->getSku());
44
+ $this->setCollection($collection);
45
+ parent::_prepareCollection();
46
+ return $this;
47
+ }
48
+
49
+ /**
50
+ * @access Public
51
+ * @author Vipin
52
+ * @dev 77vips@gmail.com
53
+ */
54
+ protected function _prepareMassaction(){
55
+ return $this;
56
+ }
57
+
58
+ /**
59
+ * @access Public
60
+ * @author Vipin
61
+ * @dev 77vips@gmail.com
62
+ * @output Prepare the column in gird
63
+ */
64
+ protected function _prepareColumns(){
65
+
66
+ $this->addColumn('order_incre', array(
67
+ 'header'=> Mage::helper('prohistory')->__('Order Id'),
68
+ 'align' => 'left',
69
+ 'index' => 'increment_id',
70
+ 'filter' => false,
71
+ ));
72
+ $this->addColumn('contest_name', array(
73
+ 'header'=> Mage::helper('prohistory')->__('Ordered Qty'),
74
+ 'align' => 'right',
75
+ 'index' => 'qty_ordered',
76
+ 'filter' => false,
77
+ ));
78
+ $this->addColumn('base_grand_total', array(
79
+ 'header'=> Mage::helper('prohistory')->__('Grand Total'),
80
+ 'align' => 'right',
81
+ 'type' => 'price',
82
+ 'index' => 'base_grand_total',
83
+ 'filter' => false,
84
+ 'currency_code' => Mage::app()->getStore()->getCurrentCurrencyCode()
85
+ ));
86
+ $this->addColumn('createddate', array(
87
+ 'header'=> Mage::helper('prohistory')->__('Created At '),
88
+ 'align' => 'right',
89
+ 'filter' => false,
90
+ 'type' => 'datatime',
91
+ 'index' => 'created_at',
92
+ ));
93
+
94
+ $this->addColumn('action', array(
95
+ 'header'=> Mage::helper('prohistory')->__('Action'),
96
+ 'index' => 'action',
97
+ 'filter' => false,
98
+ 'width' => '410px',
99
+ 'renderer' => 'Netgo_Prohistory_Block_Adminhtml_Catalog_Product_Renderer_Action',
100
+ ));
101
+ }
102
+
103
+ /**
104
+ * @access Public
105
+ * @author Vipin
106
+ * @dev 77vips@gmail.com
107
+ * @output Gird row URL
108
+ */
109
+ public function getRowUrl($item){
110
+ return 'javascript:void(0)';
111
+ }
112
+
113
+ /**
114
+ * @access Public
115
+ * @author Vipin
116
+ * @dev 77vips@gmail.com
117
+ * @output Gird row URL
118
+ */
119
+ public function getGridUrl(){
120
+ return $this->getUrl('*/*/ordersGrid', array(
121
+ 'id'=>$this->getProduct()->getId(),
122
+ 'class'=>'viin'
123
+ ));
124
+ }
125
+
126
+ /**
127
+ * @access Public
128
+ * @author Vipin
129
+ * @dev 77vips@gmail.com
130
+ * @output Return current product info
131
+ */
132
+ public function getProduct(){
133
+ return Mage::registry('current_product');
134
+ }
135
+
136
+ }
app/code/community/Netgo/Prohistory/Block/Adminhtml/Catalog/Product/Renderer/Action.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** Product Order History Extension ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Prohistory
9
+ * @author Vipin
10
+ * @dev 77vips@gmail.com
11
+ *
12
+ */
13
+ class Netgo_Prohistory_Block_Adminhtml_Catalog_Product_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
14
+ {
15
+
16
+ /**
17
+ * @access Public
18
+ * @author Vipin
19
+ * @dev 77vips@gmail.com
20
+ * @output return the button for grid
21
+ */
22
+ public function render(Varien_Object $row)
23
+ {
24
+ $this->getColumn()->setColumnCssClass('new-order');
25
+ $orderData = $row->getData();
26
+ $adminUrl = Mage::getBaseUrl();
27
+
28
+ $invoice_link = Mage::helper('adminhtml')->getUrl('adminhtml/sales_order_invoice/start/order_id/'.$orderData['entity_id'].'/');
29
+ $shipment_link = Mage::helper('adminhtml')->getUrl('adminhtml/sales_order_shipment/start/order_id/'.$orderData['entity_id'].'/');
30
+ $reorder_link = Mage::helper('adminhtml')->getUrl('adminhtml/sales_order_create/reorder/order_id/'.$orderData['entity_id'].'/');
31
+ $order_link = Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view/order_id/'.$orderData['entity_id'].'/');
32
+
33
+ $button1 = '<button id="id_'.$orderData['entity_id'].'" title="Reset" type="button" class="scalable " onclick="quickView(\''.$adminUrl.'\',\''.$orderData['entity_id'].'\')" style=""><span><span><span>Quick View</span></span></span></button>';
34
+
35
+ $button2 = '<span><span><span><a id="id_in_'.$orderData['entity_id'].'" class="form-button scalable go" style="color:#fff;text-decoration:none;" href="'.$invoice_link.'">Invoice</a></span></span></span>';
36
+ $button3 = '<span><span><span><a id="id_ship_'.$orderData['entity_id'].'" style="color:#fff;text-decoration:none;" href="'.$shipment_link.'" class="form-button scalable go" >Ship</a></span></span></span>';
37
+ $button4 ='<span><span><span><a class="form-button scalable go" id="id_reorder_'.$orderData['entity_id'].'" style="color:#fff;text-decoration:none;" href="'.$reorder_link.'">Reorder</a></span></span></span></button>';
38
+ $button5 = '<span><span><span><a id="id_go_to_'.$orderData['entity_id'].'" title="Go To Order" style="color:#fff;text-decoration:none;" href="'.$order_link.'" class="form-button scalable go">Go to order</a></span></span></span>';
39
+
40
+ return $button1.' '.$button2.' '.$button3.' '.$button4.' '.$button5;
41
+
42
+ }
43
+
44
+ }
app/code/community/Netgo/Prohistory/Block/Adminhtml/Order.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** Product Order History Extension ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Prohistory
9
+ * @author Vipin
10
+ * @dev 77vips@gmail.com
11
+ *
12
+ */
13
+ class Netgo_Prohistory_Block_Adminhtml_Order extends Mage_Sales_Block_Order_Item_Renderer_Default{
14
+
15
+ /**
16
+ * @access Public
17
+ * @author Vipin
18
+ * @dev 77vips@gmail.com
19
+ * @output Return order obj by ID
20
+ */
21
+ public function getOrder() {
22
+ $order_id = $this->getRequest()->getParam('id');
23
+ $orderObj = Mage::getModel('sales/order')->load($order_id);
24
+ return $orderObj;
25
+ }
26
+
27
+ /**
28
+ * @access Public
29
+ * @author Vipin
30
+ * @dev 77vips@gmail.com
31
+ * @output Return order items
32
+ */
33
+ public function getItemsCollection()
34
+ {
35
+ return $this->getOrder()->getItemsCollection();
36
+ }
37
+
38
+ /**
39
+ * @access Public
40
+ * @author Vipin
41
+ * @dev 77vips@gmail.com
42
+ * @output Return order items
43
+ */
44
+ public function getOrderItem()
45
+ {
46
+ if ($this->getItem() instanceof Mage_Sales_Model_Order_Item) {
47
+ return $this->getItem();
48
+ } else {
49
+ return $this->getItem()->getOrderItem();
50
+ }
51
+ }
52
+
53
+ /**
54
+ * @access Public
55
+ * @author Vipin
56
+ * @dev 77vips@gmail.com
57
+ * @output Return order items options
58
+ */
59
+ public function getItemOptions()
60
+ {
61
+ $result = array();
62
+ if ($options = $this->getOrderItem()->getProductOptions()) {
63
+ if (isset($options['options'])) {
64
+ $result = array_merge($result, $options['options']);
65
+ }
66
+ if (isset($options['additional_options'])) {
67
+ $result = array_merge($result, $options['additional_options']);
68
+ }
69
+ if (isset($options['attributes_info'])) {
70
+ $result = array_merge($result, $options['attributes_info']);
71
+ }
72
+ }
73
+ return $result;
74
+ }
75
+
76
+ }
app/code/community/Netgo/Prohistory/Helper/Data.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** Product Order History Extension ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Prohistory
9
+ * @author Vipin
10
+ * @dev 77vips@gmail.com
11
+ *
12
+ */
13
+ class Netgo_Prohistory_Helper_Data extends Mage_Core_Helper_Abstract{
14
+ /**
15
+ * @access Public
16
+ * @author Vipin
17
+ * @dev 77vips@gmail.com
18
+ * @output Order url
19
+ */
20
+ public function getOrdersUrl(){
21
+ return Mage::getUrl('prohistory/order/index');
22
+ }
23
+ }
app/code/community/Netgo/Prohistory/Model/Adminhtml/Observer.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** Product Order History Extension ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Prohistory
9
+ * @author Vipin
10
+ * @dev 77vips@gmail.com
11
+ *
12
+ */
13
+ class Netgo_Prohistory_Model_Adminhtml_Observer{
14
+ /**
15
+ * @access Public
16
+ * @author Vipin
17
+ * @dev 77vips@gmail.com
18
+ * @output Add tab in product edit page
19
+ */
20
+ protected function _canAddTab($product){
21
+ if ($product->getId()){
22
+ return true;
23
+ }
24
+ if (!$product->getAttributeSetId()){
25
+ return false;
26
+ }
27
+ $request = Mage::app()->getRequest();
28
+ if ($request->getParam('type') == 'configurable'){
29
+ if ($request->getParam('attribtues')){
30
+ return true;
31
+ }
32
+ }
33
+ return false;
34
+ }
35
+
36
+ /**
37
+ * @access Public
38
+ * @author Vipin
39
+ * @dev 77vips@gmail.com
40
+ * @output Add tab in product edit page
41
+ */
42
+ public function addOrderBlock($observer){
43
+ //Check module enable or not
44
+ $configValue = Mage::getStoreConfig('prohistory_option/order_config/status');
45
+ if($configValue){
46
+ $block = $observer->getEvent()->getBlock();
47
+ $product = Mage::registry('product');
48
+ if ($block instanceof Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs && $this->_canAddTab($product)){
49
+ $block->addTab('orders', array(
50
+ 'label' => Mage::helper('prohistory')->__('Order History'),
51
+ 'url' => Mage::helper('adminhtml')->getUrl('adminhtml/prohistory_order_catalog_product/orders', array('_current' => true)),
52
+ 'class' => 'ajax',
53
+ ));
54
+ }
55
+ }
56
+ return $this;
57
+ }
58
+ }
app/code/community/Netgo/Prohistory/controllers/Adminhtml/Prohistory/Order/Catalog/ProductController.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** Product Order History Extension ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Prohistory
9
+ * @author Vipin
10
+ * @dev 77vips@gmail.com
11
+ *
12
+ */
13
+ require_once ("Mage/Adminhtml/controllers/Catalog/ProductController.php");
14
+ class Netgo_Prohistory_Adminhtml_Prohistory_Order_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController{
15
+ /**
16
+ * @access Public
17
+ * @author Vipin
18
+ * @dev 77vips@gmail.com
19
+ * @output NA
20
+ */
21
+ protected function _construct(){
22
+ $this->setUsedModuleName('Netgo_Prohistory');
23
+ }
24
+
25
+ /**
26
+ * @access Public
27
+ * @author Vipin
28
+ * @dev 77vips@gmail.com
29
+ * @output Set tab data
30
+ */
31
+ public function ordersAction(){
32
+ $this->_initProduct();
33
+ $this->loadLayout();
34
+ $this->getLayout()->getBlock('product.edit.tab.order')
35
+ ->setProductOrders($this->getRequest()->getPost('product_orders', null));
36
+ $this->renderLayout();
37
+ }
38
+
39
+ /**
40
+ * @access Public
41
+ * @author Vipin
42
+ * @dev 77vips@gmail.com
43
+ * @output NA
44
+ */
45
+ public function quickorderAction(){
46
+ $this->loadLayout();
47
+ $this->renderLayout();
48
+ }
49
+ }
app/code/community/Netgo/Prohistory/etc/adminhtml.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** Product Order History Extension ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Prohistory
10
+ * @author Vipin
11
+ * @dev 77vips@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <acl>
17
+ <resources>
18
+ <admin>
19
+ <children>
20
+ <system>
21
+ <children>
22
+ <config>
23
+ <children>
24
+ <prohistory_option>
25
+ <title>Prohistory</title>
26
+ </prohistory_option>
27
+ </children>
28
+ </config>
29
+ </children>
30
+ </system>
31
+ </children>
32
+ </admin>
33
+ </resources>
34
+ </acl>
35
+ </config>
app/code/community/Netgo/Prohistory/etc/config.xml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** Product Order History Extension ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Prohistory
10
+ * @author Vipin
11
+ * @dev 77vips@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <modules>
17
+ <Netgo_Prohistory>
18
+ <version>0.0.1</version>
19
+ </Netgo_Prohistory>
20
+ </modules>
21
+ <default>
22
+ <prohistory_option>
23
+ <contest>
24
+ <enable>1</enable>
25
+ </contest>
26
+ </prohistory_option>
27
+ </default>
28
+ <global>
29
+ <blocks>
30
+ <prohistory>
31
+ <class>Netgo_Prohistory_Block</class>
32
+ </prohistory>
33
+ </blocks>
34
+ <helpers>
35
+ <prohistory>
36
+ <class>Netgo_Prohistory_Helper</class>
37
+ </prohistory>
38
+ </helpers>
39
+ <models>
40
+ <prohistory>
41
+ <class>Netgo_Prohistory_Model</class>
42
+ <resourceModel>prohistory_resource</resourceModel>
43
+ </prohistory>
44
+ </models>
45
+ </global>
46
+ <adminhtml>
47
+ <layout>
48
+ <updates>
49
+ <alfasft_prohistory>
50
+ <file>netgo_prohistory.xml</file>
51
+ </alfasft_prohistory>
52
+ </updates>
53
+ </layout>
54
+ <events>
55
+ <core_block_abstract_prepare_layout_after>
56
+ <observers>
57
+ <contest>
58
+ <type>singleton</type>
59
+ <class>prohistory/adminhtml_observer</class>
60
+ <method>addOrderBlock</method>
61
+ </contest>
62
+ </observers>
63
+ </core_block_abstract_prepare_layout_after>
64
+ </events>
65
+ </adminhtml>
66
+ <admin>
67
+ <routers>
68
+ <adminhtml>
69
+ <args>
70
+ <modules>
71
+ <Netgo_Prohistory before="Mage_Adminhtml">Netgo_Prohistory_Adminhtml</Netgo_Prohistory>
72
+ </modules>
73
+ </args>
74
+ </adminhtml>
75
+ </routers>
76
+ </admin>
77
+
78
+ </config>
app/code/community/Netgo/Prohistory/etc/system.xml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** Product Order History Extension ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Prohistory
10
+ * @author Vipin
11
+ * @dev 77vips@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <tabs>
17
+ <prohistory translate="label" module="prohistory">
18
+ <label>Netgo</label>
19
+ <sort_order>2000</sort_order>
20
+ </prohistory>
21
+ </tabs>
22
+ <sections>
23
+ <prohistory_option translate="label" module="prohistory">
24
+ <class>separator-top</class>
25
+ <label>Product Order History</label>
26
+ <tab>prohistory</tab>
27
+ <frontend_type>text</frontend_type>
28
+ <sort_order>100</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>1</show_in_website>
31
+ <show_in_store>1</show_in_store>
32
+ <groups>
33
+ <order_config translate="label" module="prohistory">
34
+ <label>Product Order History</label>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>10</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <fields>
41
+ <status translate="label" module="prohistory">
42
+ <label>Disable/Enable</label>
43
+ <frontend_type>select</frontend_type>
44
+ <source_model>adminhtml/system_config_source_yesno</source_model>
45
+ <sort_order>10</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>1</show_in_store>
49
+ </status>
50
+ </fields>
51
+ </order_config>
52
+ </groups>
53
+ </prohistory_option>
54
+ </sections>
55
+ </config>
app/design/adminhtml/default/default/layout/netgo_prohistory.xml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** Product Order History Extension ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Prohistory
10
+ * @author Vipin
11
+ * @dev 77vips@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <layout>
16
+ <adminhtml_prohistory_order_catalog_product_orders>
17
+ <block type="core/text_list" name="root" output="toHtml">
18
+ <block type="prohistory/adminhtml_catalog_product_edit_tab_order" name="product.edit.tab.order"/>
19
+ <block type="adminhtml/widget_grid_serializer" name="contest_grid_serializer">
20
+ <reference name="contest_grid_serializer">
21
+ <action method="initSerializerBlock">
22
+ <grid_block_name>product.edit.tab.order</grid_block_name>
23
+ <data_callback>getSelectedOrders</data_callback>
24
+ <hidden_input_name>orders</hidden_input_name>
25
+ <reload_param_name>product_orders</reload_param_name>
26
+ </action>
27
+ <action method="addColumnInputName">
28
+ <input_name>position</input_name>
29
+ </action>
30
+ </reference>
31
+ </block>
32
+ </block>
33
+ </adminhtml_prohistory_order_catalog_product_orders>
34
+
35
+ <adminhtml_catalog_product_edit>
36
+ <reference name="head">
37
+ <action method="addJs"><script>prohistory/function.js</script></action>
38
+ </reference>
39
+ </adminhtml_catalog_product_edit>
40
+
41
+
42
+ <adminhtml_prohistory_order_catalog_product_quickorder>
43
+ <block type="prohistory/adminhtml_order" name="root" output="toHtml" template="prohistory/quick_order.phtml" />
44
+ </adminhtml_prohistory_order_catalog_product_quickorder>
45
+ </layout>
app/design/adminhtml/default/default/template/prohistory/quick_order.phtml ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** Product Order History Extension ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Prohistory
9
+ * @author Vipin
10
+ * @dev 77vips@gmail.com
11
+ *
12
+ */
13
+ ?>
14
+ <?php $_order = $this->getOrder(); ?>
15
+ <br/>
16
+ <div class="entry-edit">
17
+ <div class="entry-edit-head">
18
+ <h4 class="icon-head head-products">Quick Order Information : #<?php echo $_order->getIncrementId(); ?></h4>
19
+ </div>
20
+ </div>
21
+ <div class="grid1 np">
22
+ <div class="hor-scroll">
23
+ <table cellspacing="0" class="data order-tables">
24
+ <col />
25
+ <col width="1" />
26
+ <col width="1" />
27
+ <col width="1" />
28
+ <col width="1" />
29
+ <col width="1" />
30
+ <col width="1" />
31
+ <col width="1" />
32
+ <col width="1" />
33
+ <col width="1" />
34
+ <thead>
35
+ <tr class="headings">
36
+ <th><?php echo $this->helper('sales')->__('Product') ?></th>
37
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Original Price') ?></span></th>
38
+ <th><?php echo $this->helper('sales')->__('Price') ?></th>
39
+ <th class="a-center"><?php echo $this->helper('sales')->__('Qty') ?></th>
40
+ <th><?php echo $this->helper('sales')->__('Subtotal') ?></th>
41
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Tax Amount') ?></span></th>
42
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Tax Percent') ?></span></th>
43
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Discount Amount') ?></span></th>
44
+ <th class="last"><span class="nobr"><?php echo $this->helper('sales')->__('Row Total') ?></span></th>
45
+ </tr>
46
+ </thead>
47
+ <?php $_items = $_order->getAllItems(); ?>
48
+ <tbody class="<?php echo $i%2?'even':'odd' ?>">
49
+ <?php $i=0;foreach ($_items as $_item):?>
50
+ <?php
51
+ if ($_item->getParentItem()) continue; else $i++;?>
52
+ <tr class="border">
53
+ <td><?php echo $_item->getName();//$itemsData[0]['name']; ?></td>
54
+ <td><?php echo Mage::helper('core')->currency($_item->getBaseOriginalPrice(), true, false); ?></span></td>
55
+ <td><?php echo Mage::helper('core')->currency($_item->getBasePrice(), true, false); ?></td>
56
+ <td class="a-center"><?php echo round($_item->getQtyOrdered()); ?></td>
57
+ <td><?php echo Mage::helper('core')->currency($_item->getBaseRowTotal(), true, false); ?></td>
58
+ <td><span class="nobr"><?php echo Mage::helper('core')->currency($_item->getTaxAmount(), true, false); ?></span></td>
59
+ <td><span class="nobr"><?php echo round($_item->getTaxPercent()); ?>%</span></td>
60
+ <td><span class="nobr"><?php echo Mage::helper('core')->currency($_item->getDiscountAmount(), true, false); ?></span></td>
61
+ <td class="last"><span class="nobr"><?php echo Mage::helper('core')->currency($_item->getBaseRowTotal(), true, false); ?></span></td>
62
+ <tr>
63
+ <?php endforeach; ?>
64
+ </tbody>
65
+ </table>
66
+ </div>
67
+ </div>
68
+ <br />
69
+
70
+
71
+ <!--info section start-->
72
+ <div class="box-left">
73
+ <!--Order Information-->
74
+ <!--Account Information-->
75
+ <div class="entry-edit">
76
+ <div class="entry-edit-head">
77
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Account Information') ?></h4>
78
+ <div class="tools"><?php echo $this->getAccountEditLink()?></div>
79
+ </div>
80
+ <div class="fieldset">
81
+ <div class="hor-scroll">
82
+ <table cellspacing="0" class="form-list">
83
+ <tr>
84
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date');//echo '<pre>';print_r($_order->getData()); ?></label></td>
85
+ <td class="value"><strong><span id="order_status"><?php echo $_order->getCreatedAt() ?></span></strong></td>
86
+ </tr>
87
+
88
+ <tr>
89
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Name') ?></label></td>
90
+ <td class="value">
91
+ <?php if ($_customerUrl=$this->getCustomerViewUrl()) : ?>
92
+ <a href="<?php echo $_customerUrl ?>" target="_blank"><strong><?php echo $this->escapeHtml($_order->getCustomerName()) ?></strong></a>
93
+ <?php else: ?>
94
+ <strong><?php echo $this->escapeHtml($_order->getCustomerName()) ?></strong> (<?php echo $_order->getCustomerEmail() ?>)
95
+ <?php endif; ?>
96
+ </td>
97
+ </tr>
98
+ <tr>
99
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Status') ?></label></td>
100
+ <td class="value"><strong><span id="order_status"><?php echo $_order->getStatusLabel() ?></span></strong></td>
101
+ </tr>
102
+ </table>
103
+ </div>
104
+ </div>
105
+
106
+ </div>
107
+ <div class="entry-edit">
108
+ <div class="entry-edit-head">
109
+ <h4 class="icon-head head-payment-method">Payment Information</h4>
110
+ </div>
111
+ <fieldset><?php echo $_order->getPayment()->getMethodInstance()->getTitle(); ?></fieldset>
112
+ </div>
113
+
114
+
115
+ </div>
116
+ <div class="box-right entry-edit">
117
+ <div class="entry-edit">
118
+ <div class="entry-edit-head">
119
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
120
+ </div>
121
+ <fieldset>
122
+ <?php if ($_order->getTracksCollection()->count()) : ?>
123
+ <a href="#" id="linkId" onclick="popWin('<?php echo Mage::App()->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
124
+ <br/>
125
+ <?php endif; ?>
126
+ <table cellspacing="0" class="form-list">
127
+ <tr>
128
+ <td class="value"><strong><span id="order_status"><?php
129
+ echo $_order->getShippingDescription().' '.Mage::helper('core')->currency($_order->getShippingAmount(), true, false); ?></span></strong></td>
130
+ </tr>
131
+ </table>
132
+
133
+ </fieldset>
134
+ </div>
135
+
136
+ <div class="entry-edit-head"><h4>Order Totals</h4></div>
137
+ <div class="order-totals">
138
+ <table cellspacing="0" width="100%" >
139
+ <tbody style="background: none;">
140
+ <tr class="0">
141
+ <td class="label">Subtotal</td>
142
+ <td><span class="price"><?php echo Mage::helper('core')->currency($_order->getBaseSubtotal(), true, false); ?></span></td>
143
+ </tr>
144
+ <tr class="0">
145
+ <td class="label">Shipping & Handling</td>
146
+ <td><span class="price"><?php echo Mage::helper('core')->currency($_order->getShippingAmount(), true, false); ?></span></td>
147
+ </tr>
148
+ <tr class="0">
149
+ <td class="label">
150
+ <strong>Grand Total</strong>
151
+ </td>
152
+ <td class="emph">
153
+ <strong><span class="price"><?php echo Mage::helper('core')->currency($_order->getGrandTotal(), true, false); ?></span></strong>
154
+ </td>
155
+ </tr>
156
+
157
+
158
+ </table>
159
+ </div>
160
+ </div>
161
+ <style>
162
+ .grid .box-left tbody{ background: none !important;}
163
+ .grid .box-left table td{ border:none !important; }
164
+ .grid .box-left tr{ background: none !important;}
165
+ .grid tr .form-list tr{ background: none !important;}
166
+ .grid .box-right table td{ border:none !important; }
167
+ .grid tbody { background: none !important; }
168
+ </style>
169
+
170
+
171
+
172
+
app/etc/modules/Netgo_Prohistory.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** Product Order History Extension ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Prohistory
10
+ * @author Vipin
11
+ * @dev 77vips@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <modules>
17
+ <Netgo_Prohistory>
18
+ <active>true</active>
19
+ <codePool>community</codePool>
20
+ <depends>
21
+ <Mage_Core />
22
+ </depends>
23
+ </Netgo_Prohistory>
24
+ </modules>
25
+ </config>
js/prohistory/function.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************
2
+ *** Product Order History Extension ***
3
+ ***************************************
4
+ *
5
+ * @copyright Copyright (c) 2015
6
+ * @company NetAttingo Technologies
7
+ * @package Netgo_Prohistory
8
+ * @author Vipin
9
+ * @dev 77vips@gmail.com
10
+ *
11
+ */
12
+
13
+ function quickView(url, order_id){
14
+
15
+ if($$('.order_info').size()){
16
+ $$('.order_info').first().remove();
17
+ }
18
+ if(!$('order_id_'+order_id)){
19
+ new Ajax.Request(url+'admin/prohistory_order_catalog_product/quickorder/id/'+order_id, {
20
+ onSuccess: function(response) {
21
+ $('id_'+order_id).up(2).insert("<tr class='order_info' id='order_id_"+order_id+"'><td colspan='5'>"+response.responseText+"</td></tr>");
22
+ $('order_id_'+order_id).scrollTo();
23
+ }
24
+ });
25
+ }
26
+ }
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Netgo_Prohistory</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Product Order History</summary>
10
+ <description>The default functionality of Magento supports order wise history which is a good approach but seems messy if we are focusing on consistent customer as well as if we desire to get the sell information of a particular product. So to overcome such flaw,we developed PRODUCT ORDER HISTORY extension,which helps to get product wise history.&#xD;
11
+ &#xD;
12
+ This product wise history can be found under every product i.e. by just knowing the name of product you can get of all the orders associated with it by going to Order history tab under each product.</description>
13
+ <notes>First Preview Release</notes>
14
+ <authors><author><name>Vipin</name><user>Netgo</user><email>77vips@gmail.com</email></author></authors>
15
+ <date>2015-07-21</date>
16
+ <time>13:28:43</time>
17
+ <contents><target name="magecommunity"><dir name="Netgo"><dir name="Prohistory"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Order.php" hash="3ef98804127fa482fe51deaafc3d6450"/></dir></dir><dir name="Renderer"><file name="Action.php" hash="2050e349ccac229aec472965618e4e32"/></dir></dir></dir><file name="Order.php" hash="4060ddbae898851195be88c8afdb6c30"/></dir></dir><dir name="Helper"><file name="Data.php" hash="cae3907de293dfa95879ed3ee9350f1a"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Observer.php" hash="4cb7b5459e518b86a749fbd2fc037b2d"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Prohistory"><dir name="Order"><dir name="Catalog"><file name="ProductController.php" hash="740902d44d61a5efacca5036cbb10779"/></dir></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="73b44642bdde6b0b2af212e425cc0fdb"/><file name="config.xml" hash="4e83ebdba9ec1b55db138b27e148d3c1"/><file name="system.xml" hash="155f5f21261f47ad470a3366c753c6b0"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="netgo_prohistory.xml" hash="f79b35846ed239d57bba2cf6f0dc0293"/></dir><dir name="template"><dir name="prohistory"><file name="quick_order.phtml" hash="baa0a957210f81ed1bbca3e0798c97c2"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Netgo_Prohistory.xml" hash="811e462c3b85f03b2d3ba1a95c49be36"/></dir></target><target name="mage"><dir name="js"><dir name="prohistory"><file name="function.js" hash="dad90a80b7cc2b02edab289df3fbfef5"/></dir></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
20
+ </package>