Galaxy_Unsold - Version 1.0.1

Version Notes

updated files

Download this release

Release Info

Developer Vivek
Extension Galaxy_Unsold
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/local/Galaxy/Unsoldproduct/Block/Adminhtml/Unsoldproduct.php CHANGED
@@ -1,5 +1,32 @@
1
- <?php
2
- class Galaxy_Unsoldproduct_Block_Adminhtml_Unsoldproduct extends Mage_Adminhtml_Block_Template
3
- {
4
-
5
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct Block
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */
29
+ class Galaxy_Unsoldproduct_Block_Adminhtml_Unsoldproduct extends Mage_Adminhtml_Block_Template
30
+ {
31
+
32
+ }
app/code/local/Galaxy/Unsoldproduct/Block/Unsoldproduct.php CHANGED
@@ -1,17 +1,44 @@
1
- <?php
2
- class Galaxy_Unsoldproduct_Block_Unsoldproduct extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getUnsoldproduct()
10
- {
11
- if (!$this->hasData('unsoldproduct')) {
12
- $this->setData('unsoldproduct', Mage::registry('unsoldproduct'));
13
- }
14
- return $this->getData('unsoldproduct');
15
-
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
1
+ <?php
2
+ /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct Block
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */
29
+ class Galaxy_Unsoldproduct_Block_Unsoldproduct extends Mage_Core_Block_Template
30
+ {
31
+ public function _prepareLayout()
32
+ {
33
+ return parent::_prepareLayout();
34
+ }
35
+
36
+ public function getUnsoldproduct()
37
+ {
38
+ if (!$this->hasData('unsoldproduct')) {
39
+ $this->setData('unsoldproduct', Mage::registry('unsoldproduct'));
40
+ }
41
+ return $this->getData('unsoldproduct');
42
+
43
+ }
44
  }
app/code/local/Galaxy/Unsoldproduct/Helper/Data.php CHANGED
@@ -1,6 +1,32 @@
1
- <?php
2
-
3
- class Galaxy_Unsoldproduct_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  }
1
+ <?php
2
+ /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct Helper
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */
29
+ class Galaxy_Unsoldproduct_Helper_Data extends Mage_Core_Helper_Abstract
30
+ {
31
+
32
  }
app/code/local/Galaxy/Unsoldproduct/Model/Mysql4/Unsoldproduct.php CHANGED
@@ -1,10 +1,36 @@
1
- <?php
2
-
3
- class Galaxy_Unsoldproduct_Model_Mysql4_Unsoldproduct extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the unsoldproduct_id refers to the key field in your database table.
8
- $this->_init('unsoldproduct/unsoldproduct', 'unsoldproduct_id');
9
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
1
+ <?php
2
+ /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct Resource Model
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */
29
+ class Galaxy_Unsoldproduct_Model_Mysql4_Unsoldproduct extends Mage_Core_Model_Mysql4_Abstract
30
+ {
31
+ public function _construct()
32
+ {
33
+ // Note that the unsoldproduct_id refers to the key field in your database table.
34
+ $this->_init('unsoldproduct/unsoldproduct', 'unsoldproduct_id');
35
+ }
36
  }
app/code/local/Galaxy/Unsoldproduct/Model/Mysql4/Unsoldproduct/Collection.php CHANGED
@@ -1,10 +1,36 @@
1
- <?php
2
-
3
- class Galaxy_Unsoldproduct_Model_Mysql4_Unsoldproduct_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('unsoldproduct/unsoldproduct');
9
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
1
+ <?php
2
+ /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct Resource Colection Model
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */
29
+ class Galaxy_Unsoldproduct_Model_Mysql4_Unsoldproduct_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
30
+ {
31
+ public function _construct()
32
+ {
33
+ parent::_construct();
34
+ $this->_init('unsoldproduct/unsoldproduct');
35
+ }
36
  }
app/code/local/Galaxy/Unsoldproduct/Model/Unsoldproduct.php CHANGED
@@ -1,31 +1,57 @@
1
- <?php
2
-
3
- class Galaxy_Unsoldproduct_Model_Unsoldproduct extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('unsoldproduct/unsoldproduct');
9
- }
10
- // get unsold products lists
11
- public function getUnsoldproductslists($datefrom,$dateto)
12
- {
13
- $date=explode("/",$datefrom);
14
-
15
- $newdatefrom=$date[2]."-".$date[0]."-".$date[1];
16
-
17
- $date1=explode("/",$dateto);
18
-
19
- $newdateto=$date1[2]."-".$date1[0]."-".$date1[1];
20
-
21
- $resource = Mage::getSingleton('core/resource');
22
- $catalogtableName = $resource->getTableName('catalog/product');
23
-
24
- $tableNameSales = $resource->getTableName('sales_flat_order_item');
25
-
26
- $query="SELECT e.entity_id as id FROM $catalogtableName e WHERE e.entity_id NOT IN (SELECT s1.product_id FROM $tableNameSales s1 where s1.created_at BETWEEN '".$newdatefrom." 00:00:00' AND '".$newdateto." 23:59:59') GROUP BY e.entity_id";
27
- $data = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($query);
28
- //echo $query;
29
- return $data;
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
1
+ <?php
2
+ /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct Model
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */
29
+ class Galaxy_Unsoldproduct_Model_Unsoldproduct extends Mage_Core_Model_Abstract
30
+ {
31
+ public function _construct()
32
+ {
33
+ parent::_construct();
34
+ $this->_init('unsoldproduct/unsoldproduct');
35
+ }
36
+ // get unsold products lists btween given date
37
+ public function getUnsoldproductslists($datefrom,$dateto)
38
+ {
39
+ $date=explode("/",$datefrom);
40
+
41
+ $newdatefrom=$date[2]."-".$date[0]."-".$date[1];
42
+
43
+ $date1=explode("/",$dateto);
44
+
45
+ $newdateto=$date1[2]."-".$date1[0]."-".$date1[1];
46
+
47
+ $resource = Mage::getSingleton('core/resource');
48
+ $catalogtableName = $resource->getTableName('catalog/product');
49
+
50
+ $tableNameSales = $resource->getTableName('sales_flat_order_item');
51
+
52
+ $query="SELECT e.entity_id as id FROM $catalogtableName e WHERE e.entity_id NOT IN (SELECT s1.product_id FROM $tableNameSales s1 where s1.created_at BETWEEN '".$newdatefrom." 00:00:00' AND '".$newdateto." 23:59:59') GROUP BY e.entity_id";
53
+ $data = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($query);
54
+ //echo $query;
55
+ return $data;
56
+ }
57
  }
app/code/local/Galaxy/Unsoldproduct/controllers/Adminhtml/IndexController.php CHANGED
@@ -1,28 +1,55 @@
1
- <?php
2
-
3
- class Galaxy_Unsoldproduct_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
4
- {
5
- public function indexAction()
6
- {
7
- $this->loadLayout()->renderLayout();
8
- }
9
- public function postAction()
10
- {
11
- $flag=true;
12
- $from = $this->getRequest()->getParam('report_from');
13
- $to = $this->getRequest()->getParam('report_to');
14
- if($from=="")
15
- {
16
- $flag=false;
17
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('unsoldproduct')->__('Please select date From'));
18
- }
19
- if($to=="")
20
- {
21
- $flag=false;
22
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('unsoldproduct')->__('Please select date To'));
23
- }
24
-
25
- $this->loadLayout();
26
- $this->renderLayout();
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
1
+ <?php
2
+ /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct Indexcontroller admin panel
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */
29
+ class Galaxy_Unsoldproduct_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
30
+ {
31
+ public function indexAction()
32
+ {
33
+ $this->loadLayout()->renderLayout();
34
+ }
35
+ //form submit handler of amdin panel
36
+ public function postAction()
37
+ {
38
+ $flag=true;
39
+ $from = $this->getRequest()->getParam('report_from');
40
+ $to = $this->getRequest()->getParam('report_to');
41
+ if($from=="")
42
+ {
43
+ $flag=false;
44
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('unsoldproduct')->__('Please select date From'));
45
+ }
46
+ if($to=="")
47
+ {
48
+ $flag=false;
49
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('unsoldproduct')->__('Please select date To'));
50
+ }
51
+
52
+ $this->loadLayout();
53
+ $this->renderLayout();
54
+ }
55
  }
app/code/local/Galaxy/Unsoldproduct/controllers/IndexController.php CHANGED
@@ -1,47 +1,37 @@
1
- <?php
2
- class Galaxy_Unsoldproduct_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- /*
8
- * Load an object by id
9
- * Request looking like:
10
- * http://site.com/unsoldproduct?id=15
11
- * or
12
- * http://site.com/unsoldproduct/id/15
13
- */
14
- /*
15
- $unsoldproduct_id = $this->getRequest()->getParam('id');
16
-
17
- if($unsoldproduct_id != null && $unsoldproduct_id != '') {
18
- $unsoldproduct = Mage::getModel('unsoldproduct/unsoldproduct')->load($unsoldproduct_id)->getData();
19
- } else {
20
- $unsoldproduct = null;
21
- }
22
- */
23
-
24
- /*
25
- * If no param we load a the last created item
26
- */
27
- /*
28
- if($unsoldproduct == null) {
29
- $resource = Mage::getSingleton('core/resource');
30
- $read= $resource->getConnection('core_read');
31
- $unsoldproductTable = $resource->getTableName('unsoldproduct');
32
-
33
- $select = $read->select()
34
- ->from($unsoldproductTable,array('unsoldproduct_id','title','content','status'))
35
- ->where('status',1)
36
- ->order('created_time DESC') ;
37
-
38
- $unsoldproduct = $read->fetchRow($select);
39
- }
40
- Mage::register('unsoldproduct', $unsoldproduct);
41
- */
42
-
43
-
44
- $this->loadLayout();
45
- $this->renderLayout();
46
- }
47
  }
1
+ <?php
2
+ /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct Indexcontroller front
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */
29
+ class Galaxy_Unsoldproduct_IndexController extends Mage_Core_Controller_Front_Action
30
+ {
31
+ public function indexAction()
32
+ {
33
+
34
+ $this->loadLayout();
35
+ $this->renderLayout();
36
+ }
 
 
 
 
 
 
 
 
 
 
37
  }
app/code/local/Galaxy/Unsoldproduct/etc/config.xml CHANGED
@@ -1,115 +1,142 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Galaxy_Unsoldproduct>
5
- <version>0.1.0</version>
6
- </Galaxy_Unsoldproduct>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <unsoldproduct>
11
- <use>standard</use>
12
- <args>
13
- <module>Galaxy_Unsoldproduct</module>
14
- <frontName>unsoldproduct</frontName>
15
- </args>
16
- </unsoldproduct>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <unsoldproduct>
21
- <file>unsoldproduct.xml</file>
22
- </unsoldproduct>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <global>
27
- <models>
28
- <unsoldproduct>
29
- <class>Galaxy_Unsoldproduct_Model</class>
30
- <resourceModel>unsoldproduct_mysql4</resourceModel>
31
- </unsoldproduct>
32
- <unsoldproduct_mysql4>
33
- <class>Galaxy_Unsoldproduct_Model_Mysql4</class>
34
- <entities>
35
- <unsoldproduct>
36
- <table>unsoldproduct</table>
37
- </unsoldproduct>
38
- </entities>
39
- </unsoldproduct_mysql4>
40
- </models>
41
- <resources>
42
- <unsoldproduct_setup>
43
- <setup>
44
- <module>Galaxy_Unsoldproduct</module>
45
- </setup>
46
- <connection>
47
- <use>core_setup</use>
48
- </connection>
49
- </unsoldproduct_setup>
50
- <unsoldproduct_write>
51
- <connection>
52
- <use>core_write</use>
53
- </connection>
54
- </unsoldproduct_write>
55
- <unsoldproduct_read>
56
- <connection>
57
- <use>core_read</use>
58
- </connection>
59
- </unsoldproduct_read>
60
- </resources>
61
- <blocks>
62
- <unsoldproduct>
63
- <class>Galaxy_Unsoldproduct_Block</class>
64
- </unsoldproduct>
65
- </blocks>
66
- <helpers>
67
- <unsoldproduct>
68
- <class>Galaxy_Unsoldproduct_Helper</class>
69
- </unsoldproduct>
70
- </helpers>
71
- </global>
72
- <admin>
73
- <routers>
74
- <unsoldproduct>
75
- <use>admin</use>
76
- <args>
77
- <module>Galaxy_Unsoldproduct</module>
78
- <frontName>unsoldproduct</frontName>
79
- </args>
80
- </unsoldproduct>
81
- </routers>
82
- </admin>
83
- <adminhtml>
84
- <menu>
85
- <unsoldproduct module="unsoldproduct">
86
- <title>Unsoldproduct</title>
87
- <sort_order>99</sort_order>
88
- <children>
89
- <items module="unsoldproduct">
90
- <title>Manage Items</title>
91
- <sort_order>0</sort_order>
92
- <action>unsoldproduct/adminhtml_index</action>
93
- </items>
94
- </children>
95
- </unsoldproduct>
96
- </menu>
97
- <acl>
98
- <resources>
99
- <all>
100
- <title>Allow everything</title>
101
- </all>
102
- <admin translate="title" module="unsoldproduct">
103
- <title>Magento Admin Galaxy Unsoldproduct</title>
104
- </admin>
105
- </resources>
106
- </acl>
107
- <layout>
108
- <updates>
109
- <unsoldproduct>
110
- <file>unsoldproduct.xml</file>
111
- </unsoldproduct>
112
- </updates>
113
- </layout>
114
- </adminhtml>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  </config>
1
+ <?xml version="1.0"?>
2
+ <!-- /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct module config file and router info
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */ -->
29
+ <config>
30
+ <modules>
31
+ <Galaxy_Unsoldproduct>
32
+ <version>0.1.0</version>
33
+ </Galaxy_Unsoldproduct>
34
+ </modules>
35
+ <frontend>
36
+ <routers>
37
+ <unsoldproduct>
38
+ <use>standard</use>
39
+ <args>
40
+ <module>Galaxy_Unsoldproduct</module>
41
+ <frontName>unsoldproduct</frontName>
42
+ </args>
43
+ </unsoldproduct>
44
+ </routers>
45
+ <layout>
46
+ <updates>
47
+ <unsoldproduct>
48
+ <file>unsoldproduct.xml</file>
49
+ </unsoldproduct>
50
+ </updates>
51
+ </layout>
52
+ </frontend>
53
+ <global>
54
+ <models>
55
+ <unsoldproduct>
56
+ <class>Galaxy_Unsoldproduct_Model</class>
57
+ <resourceModel>unsoldproduct_mysql4</resourceModel>
58
+ </unsoldproduct>
59
+ <unsoldproduct_mysql4>
60
+ <class>Galaxy_Unsoldproduct_Model_Mysql4</class>
61
+ <entities>
62
+ <unsoldproduct>
63
+ <table>unsoldproduct</table>
64
+ </unsoldproduct>
65
+ </entities>
66
+ </unsoldproduct_mysql4>
67
+ </models>
68
+ <resources>
69
+ <unsoldproduct_setup>
70
+ <setup>
71
+ <module>Galaxy_Unsoldproduct</module>
72
+ </setup>
73
+ <connection>
74
+ <use>core_setup</use>
75
+ </connection>
76
+ </unsoldproduct_setup>
77
+ <unsoldproduct_write>
78
+ <connection>
79
+ <use>core_write</use>
80
+ </connection>
81
+ </unsoldproduct_write>
82
+ <unsoldproduct_read>
83
+ <connection>
84
+ <use>core_read</use>
85
+ </connection>
86
+ </unsoldproduct_read>
87
+ </resources>
88
+ <blocks>
89
+ <unsoldproduct>
90
+ <class>Galaxy_Unsoldproduct_Block</class>
91
+ </unsoldproduct>
92
+ </blocks>
93
+ <helpers>
94
+ <unsoldproduct>
95
+ <class>Galaxy_Unsoldproduct_Helper</class>
96
+ </unsoldproduct>
97
+ </helpers>
98
+ </global>
99
+ <admin>
100
+ <routers>
101
+ <unsoldproduct>
102
+ <use>admin</use>
103
+ <args>
104
+ <module>Galaxy_Unsoldproduct</module>
105
+ <frontName>unsoldproduct</frontName>
106
+ </args>
107
+ </unsoldproduct>
108
+ </routers>
109
+ </admin>
110
+ <adminhtml>
111
+ <menu>
112
+ <unsoldproduct module="unsoldproduct">
113
+ <title>Unsoldproduct</title>
114
+ <sort_order>99</sort_order>
115
+ <children>
116
+ <items module="unsoldproduct">
117
+ <title>Manage Items</title>
118
+ <sort_order>0</sort_order>
119
+ <action>unsoldproduct/adminhtml_index</action>
120
+ </items>
121
+ </children>
122
+ </unsoldproduct>
123
+ </menu>
124
+ <acl>
125
+ <resources>
126
+ <all>
127
+ <title>Allow everything</title>
128
+ </all>
129
+ <admin translate="title" module="unsoldproduct">
130
+ <title>Magento Admin Galaxy Unsoldproduct</title>
131
+ </admin>
132
+ </resources>
133
+ </acl>
134
+ <layout>
135
+ <updates>
136
+ <unsoldproduct>
137
+ <file>unsoldproduct.xml</file>
138
+ </unsoldproduct>
139
+ </updates>
140
+ </layout>
141
+ </adminhtml>
142
  </config>
app/code/local/Galaxy/Unsoldproduct/sql/unsoldproduct_setup/blockmysql4-install-0.1.0.php CHANGED
@@ -1,23 +1,50 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS {$this->getTable('unsoldproduct')};
10
- CREATE TABLE {$this->getTable('unsoldproduct')} (
11
- `unsoldproduct_id` int(11) unsigned NOT NULL auto_increment,
12
- `title` varchar(255) NOT NULL default '',
13
- `filename` varchar(255) NOT NULL default '',
14
- `content` text NOT NULL default '',
15
- `status` smallint(6) NOT NULL default '0',
16
- `created_time` datetime NULL,
17
- `update_time` datetime NULL,
18
- PRIMARY KEY (`unsoldproduct_id`)
19
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
-
21
- ");
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  $installer->endSetup();
1
+ <?php
2
+ /**
3
+ * Galaxy
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Galaxyweblinks.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.galaxyweblinks.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Galaxy
17
+ * @package Galaxy_Unsold
18
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
19
+ * @license http://www.galaxyweblinks.com
20
+ */
21
+
22
+ /**
23
+ * Unsoldproduct Resource Colection Model
24
+ *
25
+ * @category Galaxy
26
+ * @package Galaxy_Unsold
27
+ * @author Galaxy Developer
28
+ */
29
+ /* database installer file to install module table in magento database */
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $installer->run("
35
+
36
+ -- DROP TABLE IF EXISTS {$this->getTable('unsoldproduct')};
37
+ CREATE TABLE {$this->getTable('unsoldproduct')} (
38
+ `unsoldproduct_id` int(11) unsigned NOT NULL auto_increment,
39
+ `title` varchar(255) NOT NULL default '',
40
+ `filename` varchar(255) NOT NULL default '',
41
+ `content` text NOT NULL default '',
42
+ `status` smallint(6) NOT NULL default '0',
43
+ `created_time` datetime NULL,
44
+ `update_time` datetime NULL,
45
+ PRIMARY KEY (`unsoldproduct_id`)
46
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
47
+
48
+ ");
49
+
50
  $installer->endSetup();
app/design/adminhtml/default/default/layout/unsoldproduct.xml CHANGED
@@ -1,15 +1,46 @@
1
- <?xml version="1.0"?>
2
- <layout>
3
- <unsoldproduct_adminhtml_index_index>
4
- <update handle="unsoldproduct_index_index"/>
5
- <reference name="content">
6
- <block type="unsoldproduct/adminhtml_unsoldproduct" name="myadmin" template="unsoldproduct/unsoldproduct.phtml"/>
7
- </reference>
8
- </unsoldproduct_adminhtml_index_index>
9
- <unsoldproduct_adminhtml_index_post>
10
-
11
- <reference name="content">
12
- <block type="unsoldproduct/adminhtml_unsoldproduct" name="myadmin" template="unsoldproduct/unsoldproduct.phtml"/>
13
- </reference>
14
- </unsoldproduct_adminhtml_index_post>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  </layout>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+
4
+ /**
5
+ * Galaxy
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Galaxyweblinks.com license that is
10
+ * available through the world-wide-web at this URL:
11
+ * http://www.galaxyweblinks.com
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
16
+ * version in the future.
17
+ *
18
+ * @category Galaxy
19
+ * @package Galaxy_Unsold
20
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
21
+ * @license http://www.galaxyweblinks.com
22
+ */
23
+
24
+ /**
25
+ * Unsoldproduct Helper
26
+ *
27
+ * @category Galaxy
28
+ * @package Galaxy_Unsold
29
+ * @author Galaxy Developer
30
+ */
31
+
32
+ xml file to call phtml file according to url -->
33
+ <layout>
34
+ <unsoldproduct_adminhtml_index_index>
35
+ <update handle="unsoldproduct_index_index"/>
36
+ <reference name="content">
37
+ <block type="unsoldproduct/adminhtml_unsoldproduct" name="myadmin" template="unsoldproduct/unsoldproduct.phtml"/>
38
+ </reference>
39
+ </unsoldproduct_adminhtml_index_index>
40
+ <unsoldproduct_adminhtml_index_post>
41
+
42
+ <reference name="content">
43
+ <block type="unsoldproduct/adminhtml_unsoldproduct" name="myadmin" template="unsoldproduct/unsoldproduct.phtml"/>
44
+ </reference>
45
+ </unsoldproduct_adminhtml_index_post>
46
  </layout>
app/design/adminhtml/default/default/template/unsoldproduct/unsoldproduct.phtml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* phtml file to show form on admin panel with two fields
4
+ it will show list of product unsold between given dates */
5
+
6
+ $to="";
7
+ $from="";
8
+ $to = $this->getRequest()->getParam('report_to');
9
+ $from = $this->getRequest()->getParam('report_from');
10
+ if($to !="" && $from !="")
11
+ {
12
+ // call model function getUnsoldproductslists to get product unsold list between date
13
+ $products = Mage::getModel('unsoldproduct/unsoldproduct')->getUnsoldproductslists($from,$to);
14
+
15
+ }
16
+ ?>
17
+ <h1><?php echo $this->__('Unsold Product between date') ?></h1>
18
+
19
+ <form action="<?php echo $this->getUrl('unsoldproduct/adminhtml_index/post/');?>" method="get" id="form-validate" >
20
+ <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
21
+ <table width="100%" border="0" cellpadding="10" cellspacing="10" >
22
+ <tr>
23
+ <td>From:&nbsp;</td>
24
+ <td><div class="f-left">
25
+ <div><input type="text" style="width:5em" value="<?php echo $from;?>" name="report_from" id="period_date_from" class="input-text no-changes required-entry"> <img class="v-middle" alt="Select Date" id="period_date_from_trig" title="Select Date" src="<?php echo Mage::getBaseUrl('skin');?>adminhtml/default/default/images/grid-cal.gif">&nbsp;&nbsp;</div>
26
+ <div id="period_date_from_advaice"></div>
27
+ </div></td>
28
+ </tr>
29
+ <tr>
30
+ <td>To:&nbsp;</td>
31
+ <td><div class="f-left">
32
+ <div><input type="text" style="width:5em" value="<?php echo $to;?>" name="report_to" id="period_date_to" class="input-text no-changes required-entry"> <img alt="Select Date" id="period_date_to_trig" title="Select Date" class="v-middle" src="<?php echo Mage::getBaseUrl('skin');?>adminhtml/default/default/images/grid-cal.gif">&nbsp;&nbsp;</div>
33
+ <div id="period_date_to_advaice"></div>
34
+ </div></td>
35
+ </tr>
36
+ <tr>
37
+ <td></td>
38
+ <td><input type="submit" name="do" value="Get Products" /></td>
39
+ </tr>
40
+ </table>
41
+ <?php
42
+ // iterate thourgh each product
43
+ if($products){?>
44
+ <table>
45
+ <tr>
46
+ <th>S No</th>
47
+ <th>Name</th>
48
+ <th>Views</th>
49
+ </tr>
50
+ <?php
51
+ $cnt=1;
52
+ foreach($products as $pro)
53
+ {
54
+
55
+ // code to get product views count between given date
56
+
57
+ $product = Mage::getModel('catalog/product')->load($pro['id']);
58
+ $data=explode("/",$from);
59
+ $from = $data[2].'-'.$data[1].'-'.$data[0];
60
+ $data1=explode("/",$to);
61
+ $to = $data1[2].'-'.$data1[1].'-'.$data1[0];
62
+
63
+ $productId = $pro['id'];
64
+
65
+ $viewedProducts = Mage::getResourceModel('reports/product_collection')
66
+ ->addViewsCount($from, $to)
67
+ ->addAttributeToFilter('entity_id', array('in' => array($productId)));
68
+
69
+ $views=0;
70
+ foreach($viewedProducts as $productviews) {
71
+ $views = $productviews->getData('views');
72
+ }
73
+ ?>
74
+ <tr>
75
+ <td><?php echo $cnt;?></td>
76
+ <td><a href="<?php echo Mage::getBaseUrl();?>admin/catalog_product/edit/id/<?php echo $pro['id'];?>/key/<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" target="_blank"><?php echo $product->getName();?></a></td>
77
+ <td><?php echo $views;?></td>
78
+ </tr>
79
+ <?php $cnt++; }
80
+ ?>
81
+ </table>
82
+ <?php } ?>
83
+ </form>
84
+ <script type="text/javascript">
85
+
86
+ Calendar.setup({
87
+ inputField : 'period_date_from',
88
+ ifFormat : '%m/%e/%Y',
89
+ button : 'period_date_from_trig',
90
+ align : 'Bl',
91
+ singleClick : true
92
+ });
93
+ Calendar.setup({
94
+ inputField : 'period_date_to',
95
+ ifFormat : '%m/%e/%Y',
96
+ button : 'period_date_to_trig',
97
+ align : 'Bl',
98
+ singleClick : true
99
+ });
100
+
101
+ </script>
app/etc/modules/Galaxy_Unsoldproduct.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Galaxy
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Galaxyweblinks.com license that is
9
+ * available through the world-wide-web at this URL:
10
+ * http://www.galaxyweblinks.com
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
15
+ * version in the future.
16
+ *
17
+ * @category Galaxy
18
+ * @package Galaxy_Unsold
19
+ * @copyright Copyright (c) 2013 Galaxy (http://www.galaxyweblinks.com/)
20
+ * @license http://www.galaxyweblinks.com
21
+ */
22
+
23
+ /**
24
+ * Unsoldproduct Helper
25
+ *
26
+ * @category Galaxy
27
+ * @package Galaxy_Unsold
28
+ * @author Galaxy Developer
29
+ */
30
+ module configuration file Set up module’s router information in -->
31
+ <config>
32
+ <modules>
33
+ <Galaxy_Unsoldproduct>
34
+ <active>true</active>
35
+ <codePool>local</codePool>
36
+ </Galaxy_Unsoldproduct>
37
+ </modules>
38
+ </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Galaxy_Unsold</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Provide unsold product information of your store between selected dates.</summary>
10
- <description>This extension provides unsold products of your store between two given dates with views of that products between given dates and still its remain as unsold on your store.</description>
11
- <notes>First release. </notes>
12
- <authors><author><name>Vivek</name><user>galaxyweblinks</user><email>vivek.jha@galaxysofttech.co.in</email></author></authors>
13
- <date>2014-04-26</date>
14
- <time>05:51:49</time>
15
- <contents><target name="magelocal"><dir name="Galaxy"><dir name="Unsoldproduct"><dir name="Block"><dir name="Adminhtml"><file name="Unsoldproduct.php" hash="2887dc6077abc0c26ed107d5ffc33a91"/></dir><file name="Unsoldproduct.php" hash="960589023be9b09d9b31e45873583f0d"/></dir><dir name="Helper"><file name="Data.php" hash="13436758ffacb3d31d914dc561d44061"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Unsoldproduct"><file name="Collection.php" hash="87d87448519f1e28c500c1f053f8a36e"/></dir><file name="Unsoldproduct.php" hash="eb75ab1b143606c0d82fa51b7b8e5684"/></dir><file name="Status.php" hash="4a728b1fa487be343d54185ada49c12f"/><file name="Unsoldproduct.php" hash="b3a5eeecc1a3041b831a62576d206127"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="3b8f77804a90c0c94dd24fbfdec5b881"/></dir><file name="IndexController.php" hash="3ca4fa6d25810381186b527d21625d35"/></dir><dir name="etc"><file name="config.xml" hash="a4b0daf24e5bf441a2dd086b69f3f134"/></dir><dir name="sql"><dir name="unsoldproduct_setup"><file name="blockmysql4-install-0.1.0.php" hash="04b12fe4ec2741bb8d080d8ad0e0773a"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="unsoldproduct"><file name="unsoldproduct.phtml" hash=""/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="moduels"><file name="Galaxy_Unsoldproduct.xml" hash=""/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="unsoldproduct.xml" hash="16ced89eb5d9d6b8e75a89c05361d96d"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Galaxy_Unsold</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Business intelligent information about the products in an online store that have been unsold for some time </summary>
10
+ <description>Unsold Product extension helps businesses keep a track of their inventory by ensuring that the unwanted stuff is filtered from the store. It provides information like the least popular products in the store. This kind of intelligence avoids the costs incurred in procuring or housing these products. These funds can be rather utilized in purchasing or marketing the products that bring conversion. Unsold extension aids the businesses to have a 360-degree snapshot of the store&#x2019;s performance (alongside utilizing information from the sales and products reports).</description>
11
+ <notes>updated files</notes>
12
+ <authors><author><name>Vivek</name><user>galaxyweblinks</user><email>vivek.jha@galaxysofttech.co.in</email></author><author><name>Vinod Khajja</name><user>vinikhajja</user><email>vini.khajja@gmail.com</email></author></authors>
13
+ <date>2014-07-09</date>
14
+ <time>09:04:18</time>
15
+ <contents><target name="magelocal"><dir name="Galaxy"><dir name="Unsoldproduct"><dir name="Block"><dir name="Adminhtml"><file name="Unsoldproduct.php" hash="171f76f7c153742d1ee7d1d69a997c40"/></dir><file name="Unsoldproduct.php" hash="093be5b3858fe3e4b883d5de09a5dd46"/></dir><dir name="Helper"><file name="Data.php" hash="a01550439b63e1569267b0dbea6f2aff"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Unsoldproduct"><file name="Collection.php" hash="12ced2984cbcedb6cb9e89e771bd1184"/></dir><file name="Unsoldproduct.php" hash="bc5b9baf2c1fdfb7f61e4a4c42bf7e6c"/></dir><file name="Status.php" hash="4a728b1fa487be343d54185ada49c12f"/><file name="Unsoldproduct.php" hash="329ba250aad5ceec0e979b04627389d9"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="108e5d12f1dcb95f026ad26936c4c83a"/></dir><file name="IndexController.php" hash="ae6f3a1c2d9455ce6c4baaf76be63077"/></dir><dir name="etc"><file name="config.xml" hash="4120ca0837ab950ec253534468539984"/></dir><dir name="sql"><dir name="unsoldproduct_setup"><file name="blockmysql4-install-0.1.0.php" hash="7bf1ca228726d9ce867fbdf45be65a7d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="unsoldproduct.xml" hash="f3738e265432cf08ec6ab7502500b5a1"/></dir><dir name="template"><dir name="unsoldproduct"><file name="unsoldproduct.phtml" hash="1ddcc34792d24755ac9f57289999c9fb"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Galaxy_Unsoldproduct.xml" hash="0bfd25edd7bca4e766f1ae618f097f9f"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>