Rudracomputech_Customerwithoutorder - Version 0.1.0

Version Notes

Please report bug.

Download this release

Release Info

Developer Rudra Computech
Extension Rudracomputech_Customerwithoutorder
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/Rudracomputech/Customerwithoutorder/Block/Adminhtml/Report/Customer/Customerwithoutorder.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Adminhtml new accounts report page content block
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Rudracomputech_Customerwithoutorder_Block_Adminhtml_Report_Customer_Customerwithoutorder extends Mage_Adminhtml_Block_Widget_Grid_Container
36
+ {
37
+
38
+ public function __construct()
39
+ {
40
+ #$class = Mage::getConfig()->getBlockClassName('customerwithoutorder/adminhtml_report_customer_customerwithoutorder_grid');
41
+ #var_dump($class);die;
42
+
43
+ $this->_blockGroup = 'customerwithoutorder';
44
+ $this->_controller = 'adminhtml_report_customer_customerwithoutorder';
45
+ $this->_headerText = Mage::helper('reports')->__('Customer without order');
46
+ parent::__construct();
47
+ $this->_removeButton('add');
48
+ }
49
+
50
+ }
app/code/community/Rudracomputech/Customerwithoutorder/Block/Adminhtml/Report/Customer/Customerwithoutorder/Grid.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ /**
27
+ * Adminhtml new accounts report grid block
28
+ *
29
+ * @category Mage
30
+ * @package Mage_Adminhtml
31
+ * @author Magento Core Team <core@magentocommerce.com>
32
+ */
33
+ class Rudracomputech_Customerwithoutorder_Block_Adminhtml_Report_Customer_Customerwithoutorder_Grid extends Mage_Adminhtml_Block_Widget_Grid
34
+ {
35
+ public function __construct()
36
+ {
37
+ parent::__construct();
38
+ $this->setId('gridOrdersCustomer');
39
+ #$this->setDefaultSort('id');
40
+ #$this->setDefaultDir('ASC');
41
+ $this->setSaveParametersInSession(true);
42
+ }
43
+ protected function _createCollection()
44
+ {
45
+ $collection = Mage::getResourceModel('customer/customer_collection')
46
+ ->addNameToSelect()
47
+ ->addAttributeToSelect('email')
48
+ ->addAttributeToSelect('created_at')
49
+ ->addAttributeToSelect('group_id')
50
+ ->joinAttribute('company', 'customer_address/company', 'default_billing', null, 'left')
51
+ ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
52
+ ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');
53
+ $collection->getSelect()->joinLeft(
54
+ array('o' => Mage::getSingleton('core/resource')->getTableName('sales/order')),
55
+ 'o.customer_id = e.entity_id',
56
+ array(
57
+ 'o.created_at' => 'MAX(o.created_at)',
58
+ )
59
+ ) ;
60
+ $collection->groupByAttribute('entity_id')
61
+ ->getSelect()
62
+ ->where('o.created_at IS NULL');
63
+ return $collection;
64
+ }
65
+ protected function _prepareCollection()
66
+ {
67
+ $collection = $this->_createCollection();
68
+ #echo $collection->getSelect();die;
69
+ $this->setCollection($collection);
70
+ try {
71
+ parent::_prepareCollection();
72
+ }
73
+ catch (Exception $e) {
74
+ //abort rendering grid and replace collection with an empty one
75
+ $this->setCollection(new Varien_Data_Collection());
76
+ }
77
+ return $this;
78
+ }
79
+ protected function _prepareColumns()
80
+ {
81
+ $this->addColumn('entity_id', array(
82
+ 'header' => Mage::helper('customer')->__('ID'),
83
+ 'width' => '50px',
84
+ 'index' => 'entity_id',
85
+ 'type' => 'number',
86
+ ));
87
+ $this->addColumn('name', array(
88
+ 'header' => Mage::helper('customer')->__('Name'),
89
+ 'index' => 'name'
90
+ ));
91
+ $this->addColumn('email', array(
92
+ 'header' => Mage::helper('customer')->__('Email'),
93
+ 'width' => '150',
94
+ 'index' => 'email'
95
+ ));
96
+ $this->addColumn('company', array(
97
+ 'header' => 'Company Name',
98
+ 'type' => 'text',
99
+ 'index' => 'company',
100
+ ));
101
+ $this->addColumn('Telephone', array(
102
+ 'header' => Mage::helper('customer')->__('Telephone'),
103
+ 'width' => '100',
104
+ 'index' => 'billing_telephone'
105
+ ));
106
+ $this->addColumn('billing_country_id', array(
107
+ 'header' => Mage::helper('customer')->__('Country'),
108
+ 'width' => '100',
109
+ 'type' => 'country',
110
+ 'index' => 'billing_country_id',
111
+ ));
112
+ $this->addColumn('customer_since', array(
113
+ 'header' => Mage::helper('customer')->__('Customer Since'),
114
+ 'type' => 'datetime',
115
+ 'align' => 'center',
116
+ 'index' => 'created_at',
117
+
118
+ 'gmtoffset' => true
119
+ ));
120
+ if (!Mage::app()->isSingleStoreMode()) {
121
+ $this->addColumn('website_id', array(
122
+ 'header' => Mage::helper('customer')->__('Website'),
123
+ 'align' => 'center',
124
+ 'width' => '80px',
125
+ 'type' => 'options',
126
+ 'options' => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(true),
127
+ 'index' => 'website_id',
128
+ ));
129
+ }
130
+ $this->addColumn('action',
131
+ array(
132
+ 'header' => Mage::helper('customer')->__('Action'),
133
+ 'width' => '100',
134
+ 'type' => 'action',
135
+ 'getter' => 'getId',
136
+ 'actions' => array(
137
+ array(
138
+ 'caption' => Mage::helper('customer')->__('Edit'),
139
+ 'url' => array('base'=> '*/customer/edit'),
140
+ 'field' => 'id'
141
+ )
142
+ ),
143
+ 'filter' => false,
144
+ 'sortable' => false,
145
+ 'index' => 'stores',
146
+ 'is_system' => true,
147
+ ));
148
+ $this->addExportType('*/*/exportCsv', Mage::helper('customerwithoutorder')->__('CSV'));
149
+ $this->addExportType('*/*/exportExcel', Mage::helper('customerwithoutorder')->__('Excel XML'));
150
+ return parent::_prepareColumns();
151
+ }
152
+ public function getRowUrl($row)
153
+ {
154
+ return $this->getUrl('adminhtml/customer/edit', array('id'=>$row->getId()));
155
+ }
156
+ }
app/code/community/Rudracomputech/Customerwithoutorder/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Rudracomputech_Customerwithoutorder_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+
app/code/community/Rudracomputech/Customerwithoutorder/controllers/Adminhtml/Report/CustomerController.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Rudracomputech_Customerwithoutorder_Adminhtml_Report_CustomerController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ /**
5
+ * Add report/customer breadcrumbs
6
+ *
7
+ * @return Rudracomputech_Customerwithoutorder_Adminhtml_Report_CustomerController
8
+ */
9
+ public function _initAction()
10
+ {
11
+
12
+ $this->loadLayout()
13
+ ->_addBreadcrumb(Mage::helper('reports')->__('Reports'), Mage::helper('reports')->__('Reports'))
14
+ ->_addBreadcrumb(Mage::helper('reports')->__('Customers'), Mage::helper('reports')->__('Customers'))
15
+ ->_addBreadcrumb(Mage::helper('reports')->__('Customer without order'), Mage::helper('reports')->__('Customer without order'));
16
+ return $this;
17
+ }
18
+
19
+ public function customerwithoutorderAction()
20
+ {
21
+
22
+ $this->_initAction()
23
+ ->_setActiveMenu('report/customer/customerwithoutorder')
24
+ ->_addBreadcrumb(Mage::helper('reports')->__('Customers without Orders'), Mage::helper('reports')->__('Customers without Orders'))
25
+ ->_addContent($this->getLayout()->createBlock('customerwithoutorder/adminhtml_report_customer_customerwithoutorder'))
26
+ ->renderLayout();
27
+ }
28
+ /**
29
+ * Export Customer grid to CSV format
30
+ */
31
+ public function exportCsvAction()
32
+ {
33
+ $fileName = 'customer_report.csv';
34
+ $csv = $this->getLayout()->createBlock('customerwithoutorder/adminhtml_report_customer_customerwithoutorder_grid')->getCsvFile();
35
+ $this->_prepareDownloadResponse($fileName, $csv);
36
+ }
37
+ /**
38
+ * Export Customer grid to Excel format
39
+ */
40
+ public function exportExcelAction()
41
+ {
42
+
43
+ $fileName = 'customer_report.xls';
44
+ $xls = $this->getLayout()->createBlock('customerwithoutorder/adminhtml_report_customer_customerwithoutorder_grid')->getExcelFile();
45
+ $this->_prepareDownloadResponse($fileName, $xls);
46
+ }
47
+
48
+ }
app/code/community/Rudracomputech/Customerwithoutorder/etc/adminhtml.xml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <menu>
4
+ <report>
5
+ <children>
6
+ <customers>
7
+ <children>
8
+
9
+ <customerwithoutorder translate="title">
10
+ <title>Customer without order</title>
11
+ <action>adminhtml/report_customer/customerwithoutorder</action>
12
+ <sort_order>1000</sort_order>
13
+ </customerwithoutorder>
14
+
15
+ </children>
16
+ </customers>
17
+ </children>
18
+
19
+ </report>
20
+ </menu>
21
+ <acl>
22
+ <resources>
23
+ <admin>
24
+ <children>
25
+ <report>
26
+ <children>
27
+ <customers>
28
+ <children>
29
+ <customerwithoutorder translate="title">
30
+ <title>Customer without order</title>
31
+ <children>
32
+ <view translate="title">
33
+ <title>View</title>
34
+ </view>
35
+ </children>
36
+ </customerwithoutorder>
37
+ </children>
38
+ </customers>
39
+ </children>
40
+
41
+ </report>
42
+ </children>
43
+ </admin>
44
+ </resources>
45
+ </acl>
46
+ </config>
app/code/community/Rudracomputech/Customerwithoutorder/etc/config.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Rudracomputech_Customerwithoutorder>
5
+ <version>0.1.0</version>
6
+ </Rudracomputech_Customerwithoutorder>
7
+ </modules>
8
+ <global>
9
+
10
+ <helpers>
11
+ <customerwithoutorder>
12
+ <class>Rudracomputech_Customerwithoutorder_Helper</class>
13
+ </customerwithoutorder>
14
+ </helpers>
15
+ <blocks>
16
+ <customerwithoutorder>
17
+ <class>Rudracomputech_Customerwithoutorder_Block</class>
18
+ </customerwithoutorder>
19
+ </blocks>
20
+ </global>
21
+ <admin>
22
+ <routers>
23
+ <adminhtml>
24
+
25
+ <args>
26
+ <modules>
27
+ <Rudracomputech_Customerwithoutorder before="Mage_Adminhtml">Rudracomputech_Customerwithoutorder_Adminhtml</Rudracomputech_Customerwithoutorder>
28
+ </modules>
29
+ </args>
30
+ </adminhtml>
31
+
32
+
33
+ </routers>
34
+ </admin>
35
+ <adminhtml>
36
+
37
+ </adminhtml>
38
+ </config>
app/etc/modules/Rudracomputech_Customerwithoutorder.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Rudracomputech_Customerwithoutorder>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>0.1.0</version>
8
+ </Rudracomputech_Customerwithoutorder>
9
+ </modules>
10
+ </config>
package.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Rudracomputech_Customerwithoutorder</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension help you to get list of customers those are registered on your store but who didn't placed any order.</summary>
10
+ <description>Magento default admin customer report can only gives you list of customers by their number of orders with limitation of top 5 customers. But with our extension you will get list of all customers without any limitation. Admin can export list of registered customers who didnt purchase. Can be exported in excel or csv format. &#xD;
11
+ &#xD;
12
+ you can generate the report from &#xD;
13
+ Admin &gt; Reports &gt; Customers &gt; Customer without order. &#xD;
14
+ &#xD;
15
+ When you click on edit button you will redirect to customer account from where you can modify or delete the account as you requirement. &#xD;
16
+ &#xD;
17
+ Please give us your suggestion and feedback to make this extension better on &lt;a href="mailto:info@rudracomputech.com"&gt;mailto:info@rudracomputech.com &lt;/a&gt;. &#xD;
18
+ </description>
19
+ <notes>Please report bug.</notes>
20
+ <authors><author><name>Rudra Computech</name><user>rudracomputech</user><email>rudracomputechs@gmail.com</email></author></authors>
21
+ <date>2015-07-27</date>
22
+ <time>22:24:57</time>
23
+ <contents><target name="magecommunity"><dir name="Rudracomputech"><dir name="Customerwithoutorder"><dir name="Block"><dir name="Adminhtml"><dir name="Report"><dir name="Customer"><dir name="Customerwithoutorder"><file name="Grid.php" hash="26df071933b05b6d1883e3b347193f9a"/></dir><file name="Customerwithoutorder.php" hash="4c93a429e053710bcf738b103bc31cc8"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="05aaa50c69a6a115e5fb86e61cacdcd1"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Report"><file name="CustomerController.php" hash="aa08cdd860c46c6ff630c33378f4ba93"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="60970fc52157dbd137bf57c15d34926c"/><file name="config.xml" hash="dd6ca7c1c499a016e85b490be7720b8e"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Rudracomputech_Customerwithoutorder.xml" hash="737e3d9d5e4eddddaea69108e866b0a3"/></dir></target></contents>
24
+ <compatible/>
25
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
26
+ </package>