Version Notes
Includes the following reports:
- Worstsellers
- Bestsellers Categories
- Worstsellers Categories
- Signed Up Never Order
- Shopped Once And Never Again
- Lifetime Sales
- Wishlist
- Products With No Upsells
Download this release
Release Info
Developer | Digital Pianism |
Extension | DigitalPianism_CustomReports |
Version | 0.0.12 |
Comparing to | |
See all releases |
Version 0.0.12
- app/code/community/DigitalPianism/CustomReports/Block/Bestsellersbycategory.php +24 -0
- app/code/community/DigitalPianism/CustomReports/Block/Bestsellersbycategory/Grid.php +193 -0
- app/code/community/DigitalPianism/CustomReports/Block/Customreport.php +15 -0
- app/code/community/DigitalPianism/CustomReports/Block/Lifetimesales.php +1 -0
- app/code/community/DigitalPianism/CustomReports/Block/Lifetimesales/Grid.php +1 -0
- app/code/community/DigitalPianism/CustomReports/Block/Noupsells.php +18 -0
- app/code/community/DigitalPianism/CustomReports/Block/Noupsells/Grid.php +1 -0
- app/code/community/DigitalPianism/CustomReports/Block/Shoppedonce.php +1 -0
- app/code/community/DigitalPianism/CustomReports/Block/Shoppedonce/Grid.php +1 -0
- app/code/community/DigitalPianism/CustomReports/Block/Signedupnoorder.php +17 -0
- app/code/community/DigitalPianism/CustomReports/Block/Signedupnoorder/Grid.php +1 -0
- app/code/community/DigitalPianism/CustomReports/Block/Wishlist.php +17 -0
- app/code/community/DigitalPianism/CustomReports/Block/Wishlist/Grid.php +1 -0
- app/code/community/DigitalPianism/CustomReports/Block/Worstsellers.php +19 -0
- app/code/community/DigitalPianism/CustomReports/Block/Worstsellers/Grid.php +240 -0
- app/code/community/DigitalPianism/CustomReports/Block/Worstsellersbycategory.php +24 -0
- app/code/community/DigitalPianism/CustomReports/Block/Worstsellersbycategory/Grid.php +244 -0
- app/code/community/DigitalPianism/CustomReports/Model/Reports/Resource/Product/Collection.php +73 -0
- app/code/community/DigitalPianism/CustomReports/controllers/BestsellersbycategoryController.php +47 -0
- app/code/community/DigitalPianism/CustomReports/controllers/LifetimesalesController.php +47 -0
- app/code/community/DigitalPianism/CustomReports/controllers/NoupsellsController.php +36 -0
- app/code/community/DigitalPianism/CustomReports/controllers/ShoppedonceController.php +36 -0
- app/code/community/DigitalPianism/CustomReports/controllers/SignedupnoorderController.php +36 -0
- app/code/community/DigitalPianism/CustomReports/controllers/WishlistController.php +47 -0
- app/code/community/DigitalPianism/CustomReports/controllers/WorstsellersController.php +47 -0
- app/code/community/DigitalPianism/CustomReports/controllers/WorstsellersbycategoryController.php +47 -0
- app/code/community/DigitalPianism/CustomReports/etc/adminhtml.xml +114 -0
- app/code/community/DigitalPianism/CustomReports/etc/config.xml +63 -0
- app/design/adminhtml/default/default/template/digitalpianism/customreports/advancedgrid.phtml +1 -0
- app/design/adminhtml/default/default/template/digitalpianism/customreports/grid.phtml +13 -0
- app/etc/modules/DigitalPianism_CustomReports.xml +9 -0
- app/locale/en_US/DigitalPianism_CustomReports.csv +32 -0
- package.xml +67 -0
app/code/community/DigitalPianism/CustomReports/Block/Bestsellersbycategory.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Bestsellersbycategory extends DigitalPianism_CustomReports_Block_Customreport
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setTemplate('digitalpianism/customreports/advancedgrid.phtml');
|
8 |
+
$this->setTitle('Custom Bestsellers By Category Report');
|
9 |
+
$this->setSideNote("<p>Attention: please note that these data may not be totally accurate due to the following reasons:</p>
|
10 |
+
<p>- A product can be moved to a different category after an order has been placed.</p>
|
11 |
+
<p>- A category can be deleted</p>
|
12 |
+
<p>- A product can be in more than one category</p>
|
13 |
+
<p>For these reasons, if a product is in several categories, it will be counted as a sale for all of these categories.</p>");
|
14 |
+
// Set the right URL for the form which handles the dates
|
15 |
+
$this->setFormAction(Mage::getUrl('*/*/index'));
|
16 |
+
}
|
17 |
+
|
18 |
+
public function _beforeToHtml()
|
19 |
+
{
|
20 |
+
$this->setChild('grid', $this->getLayout()->createBlock('customreports/bestsellersbycategory_grid', 'customreports.grid'));
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Block/Bestsellersbycategory/Grid.php
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Bestsellersbycategory_Grid extends AW_Advancedreports_Block_Advanced_Bestsellers_Grid
|
3 |
+
{
|
4 |
+
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
Mage_Adminhtml_Block_Widget_Grid::__construct();
|
8 |
+
$this->setId('bestsellersbycategoryReportGrid');
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function _prepareCollection()
|
12 |
+
{
|
13 |
+
// Get the session
|
14 |
+
$session = Mage::getSingleton('core/session');
|
15 |
+
|
16 |
+
// Dates for one week
|
17 |
+
$store = Mage_Core_Model_App::ADMIN_STORE_ID;
|
18 |
+
$timezone = Mage::app()->getStore($store)->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);
|
19 |
+
date_default_timezone_set($timezone);
|
20 |
+
|
21 |
+
// Automatic -30 days if no dates provided
|
22 |
+
if ($session->getFrom())
|
23 |
+
{
|
24 |
+
$sDate = $session->getFrom();
|
25 |
+
$sDate = str_replace('/', '-', $sDate);
|
26 |
+
$sDate = strtotime($sDate);
|
27 |
+
$sDate = date('Y-m-d H:i:s', $sDate);
|
28 |
+
}
|
29 |
+
else
|
30 |
+
{
|
31 |
+
$sDate = date('Y-m-d 00:00:00',
|
32 |
+
Mage::getModel('core/date')->timestamp(strtotime('-30 days'))
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
if ($session->getTo())
|
37 |
+
{
|
38 |
+
$eDate = $session->getTo();
|
39 |
+
$eDate = str_replace('/', '-', $eDate);
|
40 |
+
$eDate = strtotime($eDate);
|
41 |
+
$eDate = date('Y-m-d H:i:s', $eDate);
|
42 |
+
}
|
43 |
+
else
|
44 |
+
{
|
45 |
+
$eDate = date('Y-m-d 23:59:59',
|
46 |
+
Mage::getModel('core/date')->timestamp(time())
|
47 |
+
);
|
48 |
+
}
|
49 |
+
|
50 |
+
// Get the bestsellers product using Magento collection
|
51 |
+
$bestSellers = Mage::getResourceModel('reports/product_collection')
|
52 |
+
->addOrderedQtyAndTotal($sDate, $eDate)
|
53 |
+
->addAttributeToSelect('*');
|
54 |
+
|
55 |
+
$this->setCollection($bestSellers);
|
56 |
+
|
57 |
+
// Remove the limitation so we get all the bestsellers to be able to create accurate data
|
58 |
+
$this->getCollection()->getSelect()->reset(Zend_Db_Select::LIMIT_COUNT);
|
59 |
+
|
60 |
+
// echo $this->getCollection()->getSelect();
|
61 |
+
|
62 |
+
// Array that will contain the data
|
63 |
+
$arrayBestSellers = array();
|
64 |
+
foreach ($this->getCollection() as $productSold)
|
65 |
+
{
|
66 |
+
// Get Product ID
|
67 |
+
$id = $productSold->getData('entity_id');
|
68 |
+
|
69 |
+
// Get Sold Quantity and Total
|
70 |
+
$sumQty = $productSold->getData('ordered_qty');
|
71 |
+
$sumTotal = $productSold->getData('ordered_total');
|
72 |
+
|
73 |
+
// Load the potential parent product ids
|
74 |
+
$parentProduct = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($id);
|
75 |
+
|
76 |
+
// If a product is an associated product
|
77 |
+
if (!empty($parentProduct) && isset($parentProduct[0]))
|
78 |
+
{
|
79 |
+
// Get the parent configurable product id
|
80 |
+
$productId = $parentProduct[0];
|
81 |
+
}
|
82 |
+
else
|
83 |
+
{
|
84 |
+
// Get the simple product id
|
85 |
+
$productId = $id;
|
86 |
+
}
|
87 |
+
|
88 |
+
// Get all categories of this product
|
89 |
+
$categories = Mage::getResourceModel('catalog/category_collection')
|
90 |
+
->joinField('product_id',
|
91 |
+
'catalog/category_product',
|
92 |
+
'product_id',
|
93 |
+
'category_id = entity_id',
|
94 |
+
null)
|
95 |
+
->addAttributeToSelect('name')
|
96 |
+
->addAttributeToSelect('parent_id')
|
97 |
+
->addFieldToFilter('product_id', $productId);
|
98 |
+
|
99 |
+
// Export this collection to array so we could iterate on it's elements
|
100 |
+
$categories = $categories->exportToArray();
|
101 |
+
|
102 |
+
// Get categories names
|
103 |
+
foreach($categories as $category)
|
104 |
+
{
|
105 |
+
// Get Category ID
|
106 |
+
$categoryID = $category['entity_id'];
|
107 |
+
// Get Category Name
|
108 |
+
$categoryName = $category['name'];
|
109 |
+
|
110 |
+
// If category already in the array, we add data
|
111 |
+
if (array_key_exists($categoryID, $arrayBestSellers))
|
112 |
+
{
|
113 |
+
// We update the ordered quantity
|
114 |
+
$arrayBestSellers[$categoryID]['ordered_qty'] += $sumQty;
|
115 |
+
|
116 |
+
// We udpate the ordered total
|
117 |
+
$arrayBestSellers[$categoryID]['ordered_total'] += $sumTotal;
|
118 |
+
}
|
119 |
+
else
|
120 |
+
{
|
121 |
+
// For the categories called 'ALL' we need to add the parent category name
|
122 |
+
if (strtolower($categoryName)=='all')
|
123 |
+
{
|
124 |
+
// Get the parent category Name
|
125 |
+
$parentCategoryName = Mage::getModel('catalog/category')->load($category['parent_id'])->getName();
|
126 |
+
// Add the parent category name
|
127 |
+
$categoryName = $parentCategoryName . " > " . $categoryName;
|
128 |
+
}
|
129 |
+
|
130 |
+
// Else we create a new entry with the data
|
131 |
+
$arrayBestSellers[$categoryID] = array(
|
132 |
+
'name' => $categoryName,
|
133 |
+
'ordered_qty' => $sumQty,
|
134 |
+
'ordered_total' => $sumTotal
|
135 |
+
);
|
136 |
+
}
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
// Obtain a list of columns to sort the array using subkeys
|
141 |
+
$total = array();
|
142 |
+
$qty = array();
|
143 |
+
foreach ($arrayBestSellers as $key => $row) {
|
144 |
+
$total[$key] = $row['ordered_total'];
|
145 |
+
$qty[$key] = $row['ordered_qty'];
|
146 |
+
}
|
147 |
+
|
148 |
+
// Sort the data with qty ascending, views descending
|
149 |
+
// Add $arrayBestSellers as the last parameter, to sort by the common key
|
150 |
+
array_multisort($total, SORT_DESC, $qty, SORT_DESC, $arrayBestSellers);
|
151 |
+
|
152 |
+
// Convert the array to a collection
|
153 |
+
$collection = new Varien_Data_Collection();
|
154 |
+
foreach($arrayBestSellers as $category){
|
155 |
+
$rowObj = new Varien_Object();
|
156 |
+
$rowObj->setData($category);
|
157 |
+
$collection->addItem($rowObj);
|
158 |
+
}
|
159 |
+
|
160 |
+
$this->setCollection($collection);
|
161 |
+
|
162 |
+
Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
|
163 |
+
|
164 |
+
return $this;
|
165 |
+
}
|
166 |
+
|
167 |
+
protected function _prepareColumns()
|
168 |
+
{
|
169 |
+
$this->addColumn('name', array(
|
170 |
+
'header' => Mage::helper('reports')->__('Category Name'),
|
171 |
+
'width' => '50',
|
172 |
+
'index' => 'name'
|
173 |
+
));
|
174 |
+
|
175 |
+
$this->addColumn('ordered_qty', array(
|
176 |
+
'header' => Mage::helper('reports')->__('Ordered Quantity'),
|
177 |
+
'width' => '150',
|
178 |
+
'index' => 'ordered_qty',
|
179 |
+
));
|
180 |
+
|
181 |
+
$this->addColumn('ordered_total', array(
|
182 |
+
'header' => Mage::helper('reports')->__('Ordered Total'),
|
183 |
+
'width' => '150',
|
184 |
+
'index' => 'ordered_total',
|
185 |
+
));
|
186 |
+
|
187 |
+
$this->addExportType('*/*/exportBestsellersbycategoryCsv', Mage::helper('reports')->__('CSV'));
|
188 |
+
$this->addExportType('*/*/exportBestsellersbycategoryExcel', Mage::helper('reports')->__('Excel'));
|
189 |
+
|
190 |
+
return Mage_Adminhtml_Block_Widget_Grid::_prepareColumns();
|
191 |
+
}
|
192 |
+
|
193 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Block/Customreport.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Customreport extends Mage_Adminhtml_Block_Template
|
3 |
+
{
|
4 |
+
protected $_sideNote = null;
|
5 |
+
|
6 |
+
public function setSideNote($nb)
|
7 |
+
{
|
8 |
+
$this->_sideNote = $nb;
|
9 |
+
}
|
10 |
+
|
11 |
+
public function getSideNote()
|
12 |
+
{
|
13 |
+
return $this->_sideNote;
|
14 |
+
}
|
15 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Block/Lifetimesales.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
public function __construct()
|
1 |
{
|
2 |
parent::__construct();
|
3 |
$this->setTemplate('digitalpianism/customreports/advancedgrid.phtml');
|
4 |
}
|
5 |
public function _beforeToHtml()
|
6 |
{
|
7 |
$this->setChild('grid', $this->getLayout()->createBlock('customreports/lifetimesales_grid', 'customreports.grid'));
|
8 |
return $this;
|
9 |
}
|
1 |
+
<?php
|
2 |
public function __construct()
|
3 |
{
|
4 |
parent::__construct();
|
5 |
$this->setTemplate('digitalpianism/customreports/advancedgrid.phtml');
|
6 |
}
|
7 |
public function _beforeToHtml()
|
8 |
{
|
9 |
$this->setChild('grid', $this->getLayout()->createBlock('customreports/lifetimesales_grid', 'customreports.grid'));
|
10 |
return $this;
|
11 |
}
|
app/code/community/DigitalPianism/CustomReports/Block/Lifetimesales/Grid.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
public function __construct()
|
1 |
{
|
2 |
parent::__construct();
|
3 |
$this->setId('lifetimesalesReportGrid');
|
4 |
$this->setDefaultSort('orders_sum_amount');
|
5 |
$this->setDefaultDir('desc');
|
6 |
}
|
7 |
protected function _prepareCollection()
|
8 |
{
|
9 |
else
|
10 |
else
|
11 |
$end = new Zend_Date($eDate);
|
12 |
$collection = Mage::getResourceModel('reports/customer_collection')
|
13 |
->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');;
|
14 |
$this->setCollection($collection);
|
15 |
parent::_prepareCollection();
|
16 |
return $this;
|
17 |
}
|
18 |
protected function _prepareColumns()
|
19 |
{
|
20 |
$this->addColumn('entity_id', array(
|
21 |
'header' => Mage::helper('reports')->__('Customer ID'),
|
22 |
'index' => 'entity_id'
|
23 |
));
|
24 |
'header' => Mage::helper('reports')->__('Name'),
|
25 |
'index' => 'name'
|
26 |
));
|
27 |
$this->addColumn('email', array(
|
28 |
'header' => Mage::helper('reports')->__('Email'),
|
29 |
'width' => '150',
|
30 |
'index' => 'email'
|
31 |
));
|
32 |
$this->addColumn('billing_country_id', array(
|
33 |
'header' => Mage::helper('reports')->__('Country'),
|
34 |
'width' => '100',
|
35 |
'type' => 'country',
|
36 |
'index' => 'billing_country_id',
|
37 |
));
|
38 |
$this->addColumn('billing_region', array(
|
39 |
'header' => Mage::helper('reports')->__('State/Province'),
|
40 |
'width' => '150',
|
41 |
'index' => 'billing_region',
|
42 |
));
|
43 |
'header' => Mage::helper('reports')->__('Number of Orders'),
|
44 |
'width' => '100px',
|
45 |
'sortable' => false,
|
46 |
'index' => 'orders_count',
|
47 |
'total' => 'sum',
|
48 |
'type' => 'number'
|
49 |
));
|
50 |
'header' => Mage::helper('reports')->__('Average Order Amount'),
|
51 |
'width' => '200px',
|
52 |
'align' => 'right',
|
53 |
'sortable' => false,
|
54 |
'type' => 'number',
|
55 |
'index' => 'orders_avg_amount',
|
56 |
'total' => 'orders_sum_amount/orders_count'
|
57 |
));
|
58 |
'header' => Mage::helper('reports')->__('Orders Sum Amount'),
|
59 |
'width' => '100',
|
60 |
'index' => 'orders_sum_amount',
|
61 |
));
|
62 |
array(
|
63 |
'header' => Mage::helper('reports')->__('Action'),
|
64 |
'width' => '100',
|
65 |
'type' => 'action',
|
66 |
'getter' => 'getEntityId',
|
67 |
'actions' => array(
|
68 |
array(
|
69 |
'caption' => Mage::helper('reports')->__('Edit Customer'),
|
70 |
'url' => array('base'=> 'adminhtml/customer/edit'),
|
71 |
'field' => 'id'
|
72 |
)
|
73 |
),
|
74 |
'filter' => false,
|
75 |
'sortable' => false,
|
76 |
'index' => 'stores',
|
77 |
'is_system' => true,
|
78 |
));
|
79 |
$this->addExportType('*/*/exportLifetimesalesCsv', Mage::helper('reports')->__('CSV'));
|
80 |
$this->addExportType('*/*/exportLifetimesalesExcel', Mage::helper('reports')->__('Excel'));
|
81 |
return parent::_prepareColumns();
|
82 |
}
|
1 |
+
<?php
|
2 |
public function __construct()
|
3 |
{
|
4 |
parent::__construct();
|
5 |
$this->setId('lifetimesalesReportGrid');
|
6 |
$this->setDefaultSort('orders_sum_amount');
|
7 |
$this->setDefaultDir('desc');
|
8 |
}
|
9 |
protected function _prepareCollection()
|
10 |
{
|
11 |
else
|
12 |
else
|
13 |
$end = new Zend_Date($eDate);
|
14 |
$collection = Mage::getResourceModel('reports/customer_collection')
|
15 |
->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');;
|
16 |
$this->setCollection($collection);
|
17 |
parent::_prepareCollection();
|
18 |
return $this;
|
19 |
}
|
20 |
protected function _prepareColumns()
|
21 |
{
|
22 |
$this->addColumn('entity_id', array(
|
23 |
'header' => Mage::helper('reports')->__('Customer ID'),
|
24 |
'index' => 'entity_id'
|
25 |
));
|
26 |
'header' => Mage::helper('reports')->__('Name'),
|
27 |
'index' => 'name'
|
28 |
));
|
29 |
$this->addColumn('email', array(
|
30 |
'header' => Mage::helper('reports')->__('Email'),
|
31 |
'width' => '150',
|
32 |
'index' => 'email'
|
33 |
));
|
34 |
$this->addColumn('billing_country_id', array(
|
35 |
'header' => Mage::helper('reports')->__('Country'),
|
36 |
'width' => '100',
|
37 |
'type' => 'country',
|
38 |
'index' => 'billing_country_id',
|
39 |
));
|
40 |
$this->addColumn('billing_region', array(
|
41 |
'header' => Mage::helper('reports')->__('State/Province'),
|
42 |
'width' => '150',
|
43 |
'index' => 'billing_region',
|
44 |
));
|
45 |
'header' => Mage::helper('reports')->__('Number of Orders'),
|
46 |
'width' => '100px',
|
47 |
'sortable' => false,
|
48 |
'index' => 'orders_count',
|
49 |
'total' => 'sum',
|
50 |
'type' => 'number'
|
51 |
));
|
52 |
'header' => Mage::helper('reports')->__('Average Order Amount'),
|
53 |
'width' => '200px',
|
54 |
'align' => 'right',
|
55 |
'sortable' => false,
|
56 |
'type' => 'number',
|
57 |
'index' => 'orders_avg_amount',
|
58 |
'total' => 'orders_sum_amount/orders_count'
|
59 |
));
|
60 |
'header' => Mage::helper('reports')->__('Orders Sum Amount'),
|
61 |
'width' => '100',
|
62 |
'index' => 'orders_sum_amount',
|
63 |
));
|
64 |
array(
|
65 |
'header' => Mage::helper('reports')->__('Action'),
|
66 |
'width' => '100',
|
67 |
'type' => 'action',
|
68 |
'getter' => 'getEntityId',
|
69 |
'actions' => array(
|
70 |
array(
|
71 |
'caption' => Mage::helper('reports')->__('Edit Customer'),
|
72 |
'url' => array('base'=> 'adminhtml/customer/edit'),
|
73 |
'field' => 'id'
|
74 |
)
|
75 |
),
|
76 |
'filter' => false,
|
77 |
'sortable' => false,
|
78 |
'index' => 'stores',
|
79 |
'is_system' => true,
|
80 |
));
|
81 |
$this->addExportType('*/*/exportLifetimesalesCsv', Mage::helper('reports')->__('CSV'));
|
82 |
$this->addExportType('*/*/exportLifetimesalesExcel', Mage::helper('reports')->__('Excel'));
|
83 |
return parent::_prepareColumns();
|
84 |
}
|
app/code/community/DigitalPianism/CustomReports/Block/Noupsells.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Noupsells extends DigitalPianism_CustomReports_Block_Customreport
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setTemplate('digitalpianism/customreports/grid.phtml');
|
8 |
+
$this->setTitle('Custom Products With No Upsells Report');
|
9 |
+
$this->setSideNote('N.B.: the grid displays only configurable products. You can use the visibility and status filter to only get the products which are available on the store.');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function _beforeToHtml()
|
13 |
+
{
|
14 |
+
$this->setChild('grid', $this->getLayout()->createBlock('customreports/noupsells_grid', 'customreports.grid'));
|
15 |
+
return $this;
|
16 |
+
}
|
17 |
+
|
18 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Block/Noupsells/Grid.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
public function __construct()
|
1 |
{
|
2 |
parent::__construct();
|
3 |
$this->setId('noupsellsReportGrid');
|
4 |
$this->setDefaultSort('entity_id');
|
5 |
$this->setDefaultDir('desc');
|
6 |
}
|
7 |
{
|
8 |
foreach ($upsellsItemsCollection->getItems() as $item)
|
9 |
{
|
10 |
$product_with_upsell_id = $item->getProductId();
|
11 |
}
|
12 |
return $filterArray;
|
13 |
}
|
14 |
protected function _prepareCollection()
|
15 |
{
|
16 |
$collection = Mage::getResourceModel('catalog/product_collection')
|
17 |
$this->setCollection($collection);
|
18 |
parent::_prepareCollection();
|
19 |
return $this;
|
20 |
}
|
21 |
protected function _prepareColumns()
|
22 |
{
|
23 |
$this->addColumn('entity_id', array(
|
24 |
'header' =>Mage::helper('reports')->__('Product ID'),
|
25 |
'width' =>'50px',
|
26 |
'index' =>'entity_id'
|
27 |
));
|
28 |
$this->addColumn('name', array(
|
29 |
'header' =>Mage::helper('reports')->__('Product Name'),
|
30 |
'index' =>'name'
|
31 |
));
|
32 |
'header' =>Mage::helper('reports')->__('Sku'),
|
33 |
'index' =>'sku'
|
34 |
));
|
35 |
array(
|
36 |
'header'=> Mage::helper('catalog')->__('Visibility'),
|
37 |
'width' => '70px',
|
38 |
'index' => 'visibility',
|
39 |
'type' => 'options',
|
40 |
'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),
|
41 |
));
|
42 |
$this->addColumn('status',
|
43 |
array(
|
44 |
'header'=> Mage::helper('catalog')->__('Status'),
|
45 |
'width' => '70px',
|
46 |
'index' => 'status',
|
47 |
'type' => 'options',
|
48 |
'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
|
49 |
));
|
50 |
array(
|
51 |
'header' => Mage::helper('reports')->__('Action'),
|
52 |
'width' => '100',
|
53 |
'type' => 'action',
|
54 |
'getter' => 'getId',
|
55 |
'actions' => array(
|
56 |
array(
|
57 |
'caption' => Mage::helper('reports')->__('Edit Product'),
|
58 |
'url' => array('base'=> 'adminhtml/catalog_product/edit'),
|
59 |
'field' => 'id'
|
60 |
)
|
61 |
),
|
62 |
'filter' => false,
|
63 |
'sortable' => false,
|
64 |
'index' => 'stores',
|
65 |
'is_system' => true,
|
66 |
));
|
67 |
$this->addExportType('*/*/exportNoupsellsCsv', Mage::helper('reports')->__('CSV'));
|
68 |
$this->addExportType('*/*/exportNoupsellsExcel', Mage::helper('reports')->__('Excel'));
|
69 |
return parent::_prepareColumns();
|
70 |
}
|
1 |
+
<?php
|
2 |
public function __construct()
|
3 |
{
|
4 |
parent::__construct();
|
5 |
$this->setId('noupsellsReportGrid');
|
6 |
$this->setDefaultSort('entity_id');
|
7 |
$this->setDefaultDir('desc');
|
8 |
}
|
9 |
{
|
10 |
foreach ($upsellsItemsCollection->getItems() as $item)
|
11 |
{
|
12 |
$product_with_upsell_id = $item->getProductId();
|
13 |
}
|
14 |
return $filterArray;
|
15 |
}
|
16 |
protected function _prepareCollection()
|
17 |
{
|
18 |
$collection = Mage::getResourceModel('catalog/product_collection')
|
19 |
$this->setCollection($collection);
|
20 |
parent::_prepareCollection();
|
21 |
return $this;
|
22 |
}
|
23 |
protected function _prepareColumns()
|
24 |
{
|
25 |
$this->addColumn('entity_id', array(
|
26 |
'header' =>Mage::helper('reports')->__('Product ID'),
|
27 |
'width' =>'50px',
|
28 |
'index' =>'entity_id'
|
29 |
));
|
30 |
$this->addColumn('name', array(
|
31 |
'header' =>Mage::helper('reports')->__('Product Name'),
|
32 |
'index' =>'name'
|
33 |
));
|
34 |
'header' =>Mage::helper('reports')->__('Sku'),
|
35 |
'index' =>'sku'
|
36 |
));
|
37 |
array(
|
38 |
'header'=> Mage::helper('catalog')->__('Visibility'),
|
39 |
'width' => '70px',
|
40 |
'index' => 'visibility',
|
41 |
'type' => 'options',
|
42 |
'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),
|
43 |
));
|
44 |
$this->addColumn('status',
|
45 |
array(
|
46 |
'header'=> Mage::helper('catalog')->__('Status'),
|
47 |
'width' => '70px',
|
48 |
'index' => 'status',
|
49 |
'type' => 'options',
|
50 |
'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
|
51 |
));
|
52 |
array(
|
53 |
'header' => Mage::helper('reports')->__('Action'),
|
54 |
'width' => '100',
|
55 |
'type' => 'action',
|
56 |
'getter' => 'getId',
|
57 |
'actions' => array(
|
58 |
array(
|
59 |
'caption' => Mage::helper('reports')->__('Edit Product'),
|
60 |
'url' => array('base'=> 'adminhtml/catalog_product/edit'),
|
61 |
'field' => 'id'
|
62 |
)
|
63 |
),
|
64 |
'filter' => false,
|
65 |
'sortable' => false,
|
66 |
'index' => 'stores',
|
67 |
'is_system' => true,
|
68 |
));
|
69 |
$this->addExportType('*/*/exportNoupsellsCsv', Mage::helper('reports')->__('CSV'));
|
70 |
$this->addExportType('*/*/exportNoupsellsExcel', Mage::helper('reports')->__('Excel'));
|
71 |
return parent::_prepareColumns();
|
72 |
}
|
app/code/community/DigitalPianism/CustomReports/Block/Shoppedonce.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
public function __construct()
|
1 |
{
|
2 |
parent::__construct();
|
3 |
$this->setTemplate('digitalpianism/customreports/grid.phtml');
|
4 |
}
|
5 |
public function _beforeToHtml()
|
6 |
{
|
7 |
$this->setChild('grid', $this->getLayout()->createBlock('customreports/shoppedonce_grid', 'customreports.grid'));
|
8 |
return $this;
|
9 |
}
|
1 |
+
<?php
|
2 |
public function __construct()
|
3 |
{
|
4 |
parent::__construct();
|
5 |
$this->setTemplate('digitalpianism/customreports/grid.phtml');
|
6 |
}
|
7 |
public function _beforeToHtml()
|
8 |
{
|
9 |
$this->setChild('grid', $this->getLayout()->createBlock('customreports/shoppedonce_grid', 'customreports.grid'));
|
10 |
return $this;
|
11 |
}
|
app/code/community/DigitalPianism/CustomReports/Block/Shoppedonce/Grid.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
public function __construct()
|
1 |
{
|
2 |
parent::__construct();
|
3 |
$this->setId('shoppedonceReportGrid');
|
4 |
$this->setDefaultSort('created_at');
|
5 |
$this->setDefaultDir('desc');
|
6 |
}
|
7 |
protected function _prepareCollection()
|
8 |
{
|
9 |
$collection = Mage::getResourceModel('reports/order_collection')
|
10 |
$this->setCollection($collection);
|
11 |
parent::_prepareCollection();
|
12 |
return $this;
|
13 |
}
|
14 |
protected function _prepareColumns()
|
15 |
{
|
16 |
$this->addColumn('entity_id', array(
|
17 |
'header' => Mage::helper('reports')->__('Order ID'),
|
18 |
'index' => 'entity_id'
|
19 |
));
|
20 |
$this->addColumn('customer_email', array(
|
21 |
'header' => Mage::helper('reports')->__('Customer Email'),
|
22 |
'width' => '300',
|
23 |
'index' => 'customer_email'
|
24 |
));
|
25 |
$this->addColumn('customer_firstname', array(
|
26 |
'header' => Mage::helper('reports')->__('First Name'),
|
27 |
'width' => '300',
|
28 |
'index' => 'customer_firstname',
|
29 |
));
|
30 |
$this->addColumn('customer_lastname', array(
|
31 |
'header' => Mage::helper('reports')->__('Last Name'),
|
32 |
'width' => '300',
|
33 |
'index' => 'customer_lastname',
|
34 |
));
|
35 |
'header' =>Mage::helper('reports')->__('Sale Date'),
|
36 |
'align' =>'right',
|
37 |
'index' =>'created_at'
|
38 |
));
|
39 |
array(
|
40 |
'header' => Mage::helper('reports')->__('Action'),
|
41 |
'width' => '100',
|
42 |
'type' => 'action',
|
43 |
'getter' => 'getEntityId',
|
44 |
'actions' => array(
|
45 |
array(
|
46 |
'caption' => Mage::helper('reports')->__('Edit Order'),
|
47 |
'url' => array('base'=> 'adminhtml/sales_order/view/'),
|
48 |
'field' => 'order_id'
|
49 |
)
|
50 |
),
|
51 |
'filter' => false,
|
52 |
'sortable' => false,
|
53 |
'index' => 'stores',
|
54 |
'is_system' => true,
|
55 |
));
|
56 |
$this->addExportType('*/*/exportShoppedonceCsv', Mage::helper('reports')->__('CSV'));
|
57 |
$this->addExportType('*/*/exportShoppedonceExcel', Mage::helper('reports')->__('Excel'));
|
58 |
return parent::_prepareColumns();
|
59 |
}
|
1 |
+
<?php
|
2 |
public function __construct()
|
3 |
{
|
4 |
parent::__construct();
|
5 |
$this->setId('shoppedonceReportGrid');
|
6 |
$this->setDefaultSort('created_at');
|
7 |
$this->setDefaultDir('desc');
|
8 |
}
|
9 |
protected function _prepareCollection()
|
10 |
{
|
11 |
$collection = Mage::getResourceModel('reports/order_collection')
|
12 |
$this->setCollection($collection);
|
13 |
parent::_prepareCollection();
|
14 |
return $this;
|
15 |
}
|
16 |
protected function _prepareColumns()
|
17 |
{
|
18 |
$this->addColumn('entity_id', array(
|
19 |
'header' => Mage::helper('reports')->__('Order ID'),
|
20 |
'index' => 'entity_id'
|
21 |
));
|
22 |
$this->addColumn('customer_email', array(
|
23 |
'header' => Mage::helper('reports')->__('Customer Email'),
|
24 |
'width' => '300',
|
25 |
'index' => 'customer_email'
|
26 |
));
|
27 |
$this->addColumn('customer_firstname', array(
|
28 |
'header' => Mage::helper('reports')->__('First Name'),
|
29 |
'width' => '300',
|
30 |
'index' => 'customer_firstname',
|
31 |
));
|
32 |
$this->addColumn('customer_lastname', array(
|
33 |
'header' => Mage::helper('reports')->__('Last Name'),
|
34 |
'width' => '300',
|
35 |
'index' => 'customer_lastname',
|
36 |
));
|
37 |
'header' =>Mage::helper('reports')->__('Sale Date'),
|
38 |
'align' =>'right',
|
39 |
'index' =>'created_at'
|
40 |
));
|
41 |
array(
|
42 |
'header' => Mage::helper('reports')->__('Action'),
|
43 |
'width' => '100',
|
44 |
'type' => 'action',
|
45 |
'getter' => 'getEntityId',
|
46 |
'actions' => array(
|
47 |
array(
|
48 |
'caption' => Mage::helper('reports')->__('Edit Order'),
|
49 |
'url' => array('base'=> 'adminhtml/sales_order/view/'),
|
50 |
'field' => 'order_id'
|
51 |
)
|
52 |
),
|
53 |
'filter' => false,
|
54 |
'sortable' => false,
|
55 |
'index' => 'stores',
|
56 |
'is_system' => true,
|
57 |
));
|
58 |
$this->addExportType('*/*/exportShoppedonceCsv', Mage::helper('reports')->__('CSV'));
|
59 |
$this->addExportType('*/*/exportShoppedonceExcel', Mage::helper('reports')->__('Excel'));
|
60 |
return parent::_prepareColumns();
|
61 |
}
|
app/code/community/DigitalPianism/CustomReports/Block/Signedupnoorder.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Signedupnoorder extends DigitalPianism_CustomReports_Block_Customreport
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setTemplate('digitalpianism/customreports/grid.phtml');
|
8 |
+
$this->setTitle('Custom Signed Up But Never Shopped Report');
|
9 |
+
}
|
10 |
+
|
11 |
+
public function _beforeToHtml()
|
12 |
+
{
|
13 |
+
$this->setChild('grid', $this->getLayout()->createBlock('customreports/signedupnoorder_grid', 'customreports.grid'));
|
14 |
+
return $this;
|
15 |
+
}
|
16 |
+
|
17 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Block/Signedupnoorder/Grid.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
public function __construct()
|
1 |
{
|
2 |
parent::__construct();
|
3 |
$this->setId('signedupnoorderReportGrid');
|
4 |
$this->setDefaultSort('subscriber_subscriptiondate');
|
5 |
$this->setDefaultDir('desc');
|
6 |
}
|
7 |
protected function _prepareCollection()
|
8 |
{
|
9 |
$collection = Mage::getModel('newsletter/subscriber')->getCollection()
|
10 |
$this->setCollection($collection);
|
11 |
parent::_prepareCollection();
|
12 |
return $this;
|
13 |
}
|
14 |
protected function _prepareColumns()
|
15 |
{
|
16 |
$this->addColumn('subscriber_id', array(
|
17 |
'header' => Mage::helper('reports')->__('Subscriber ID'),
|
18 |
'index' => 'subscriber_id'
|
19 |
));
|
20 |
$this->addColumn('subscriber_email', array(
|
21 |
'header' => Mage::helper('reports')->__('Subscriber Email'),
|
22 |
'width' => '300',
|
23 |
'index' => 'subscriber_email'
|
24 |
));
|
25 |
$this->addColumn('subscriber_firstname', array(
|
26 |
'header' => Mage::helper('reports')->__('First Name'),
|
27 |
'width' => '300',
|
28 |
'index' => 'subscriber_firstname',
|
29 |
));
|
30 |
$this->addColumn('subscriber_lastname', array(
|
31 |
'header' => Mage::helper('reports')->__('Last Name'),
|
32 |
'width' => '300',
|
33 |
'index' => 'subscriber_lastname',
|
34 |
));
|
35 |
'header' =>Mage::helper('reports')->__('Subscription Date'),
|
36 |
'align' =>'right',
|
37 |
'index' =>'subscriber_subscriptiondate'
|
38 |
));
|
39 |
$this->addExportType('*/*/exportSignedupnoorderCsv', Mage::helper('reports')->__('CSV'));
|
40 |
$this->addExportType('*/*/exportSignedupnoorderExcel', Mage::helper('reports')->__('Excel'));
|
41 |
return parent::_prepareColumns();
|
42 |
}
|
1 |
+
<?php
|
2 |
public function __construct()
|
3 |
{
|
4 |
parent::__construct();
|
5 |
$this->setId('signedupnoorderReportGrid');
|
6 |
$this->setDefaultSort('subscriber_subscriptiondate');
|
7 |
$this->setDefaultDir('desc');
|
8 |
}
|
9 |
protected function _prepareCollection()
|
10 |
{
|
11 |
$collection = Mage::getModel('newsletter/subscriber')->getCollection()
|
12 |
$this->setCollection($collection);
|
13 |
parent::_prepareCollection();
|
14 |
return $this;
|
15 |
}
|
16 |
protected function _prepareColumns()
|
17 |
{
|
18 |
$this->addColumn('subscriber_id', array(
|
19 |
'header' => Mage::helper('reports')->__('Subscriber ID'),
|
20 |
'index' => 'subscriber_id'
|
21 |
));
|
22 |
$this->addColumn('subscriber_email', array(
|
23 |
'header' => Mage::helper('reports')->__('Subscriber Email'),
|
24 |
'width' => '300',
|
25 |
'index' => 'subscriber_email'
|
26 |
));
|
27 |
$this->addColumn('subscriber_firstname', array(
|
28 |
'header' => Mage::helper('reports')->__('First Name'),
|
29 |
'width' => '300',
|
30 |
'index' => 'subscriber_firstname',
|
31 |
));
|
32 |
$this->addColumn('subscriber_lastname', array(
|
33 |
'header' => Mage::helper('reports')->__('Last Name'),
|
34 |
'width' => '300',
|
35 |
'index' => 'subscriber_lastname',
|
36 |
));
|
37 |
'header' =>Mage::helper('reports')->__('Subscription Date'),
|
38 |
'align' =>'right',
|
39 |
'index' =>'subscriber_subscriptiondate'
|
40 |
));
|
41 |
$this->addExportType('*/*/exportSignedupnoorderCsv', Mage::helper('reports')->__('CSV'));
|
42 |
$this->addExportType('*/*/exportSignedupnoorderExcel', Mage::helper('reports')->__('Excel'));
|
43 |
return parent::_prepareColumns();
|
44 |
}
|
app/code/community/DigitalPianism/CustomReports/Block/Wishlist.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Wishlist extends DigitalPianism_CustomReports_Block_Customreport
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setTemplate('digitalpianism/customreports/grid.phtml');
|
8 |
+
$this->setTitle('Wishlist Report');
|
9 |
+
}
|
10 |
+
|
11 |
+
public function _beforeToHtml()
|
12 |
+
{
|
13 |
+
$this->setChild('grid', $this->getLayout()->createBlock('customreports/wishlist_grid', 'customreports.grid'));
|
14 |
+
return $this;
|
15 |
+
}
|
16 |
+
|
17 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Block/Wishlist/Grid.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
public function __construct()
|
1 |
{
|
2 |
parent::__construct();
|
3 |
$this->setId('wishlistReportGrid');
|
4 |
$this->setDefaultSort('updated_at');
|
5 |
$this->setDefaultDir('desc');
|
6 |
}
|
7 |
{
|
8 |
foreach ($wishlistItemsCollection->getItems() as $item)
|
9 |
{
|
10 |
$wishlist_id = $item->getWishlistId();
|
11 |
}
|
12 |
return $filterArray;
|
13 |
}
|
14 |
protected function _prepareCollection()
|
15 |
{
|
16 |
else
|
17 |
else
|
18 |
$end = new Zend_Date($eDate);
|
19 |
$collection = Mage::getModel('wishlist/wishlist')
|
20 |
//->addAttributeToSelect('entity_id')
|
21 |
$this->setCollection($collection);
|
22 |
parent::_prepareCollection();
|
23 |
return $this;
|
24 |
}
|
25 |
protected function _prepareColumns()
|
26 |
{
|
27 |
$this->addColumn('wishlist_id', array(
|
28 |
'header' =>Mage::helper('reports')->__('Wishlist ID'),
|
29 |
'width' =>'50px',
|
30 |
'index' =>'wishlist_id'
|
31 |
));
|
32 |
$this->addColumn('customer_id', array(
|
33 |
'header' =>Mage::helper('reports')->__('Customer ID'),
|
34 |
'index' =>'customer_id'
|
35 |
));
|
36 |
'header' =>Mage::helper('reports')->__('Has Been Shared ?'),
|
37 |
'index' =>'shared',
|
38 |
'options' => array(
|
39 |
0 => Mage::helper('reports')->__('No'),
|
40 |
1 => Mage::helper('reports')->__('Yes')
|
41 |
)
|
42 |
));
|
43 |
$this->addColumn('updated_at', array(
|
44 |
'header' =>Mage::helper('reports')->__('Updated At'),
|
45 |
'align' =>'right',
|
46 |
'index' =>'updated_at'
|
47 |
));
|
48 |
array(
|
49 |
'header' => Mage::helper('reports')->__('Action'),
|
50 |
'width' => '100',
|
51 |
'type' => 'action',
|
52 |
'getter' => 'getCustomerId',
|
53 |
'actions' => array(
|
54 |
array(
|
55 |
'caption' => Mage::helper('reports')->__('Edit Customer'),
|
56 |
'url' => array('base'=> 'adminhtml/customer/edit'),
|
57 |
'field' => 'id'
|
58 |
)
|
59 |
),
|
60 |
'filter' => false,
|
61 |
'sortable' => false,
|
62 |
'index' => 'stores',
|
63 |
'is_system' => true,
|
64 |
));
|
65 |
$this->addExportType('*/*/exportWishlistCsv', Mage::helper('reports')->__('CSV'));
|
66 |
$this->addExportType('*/*/exportWishlistExcel', Mage::helper('reports')->__('Excel'));
|
67 |
return parent::_prepareColumns();
|
68 |
}
|
1 |
+
<?php
|
2 |
public function __construct()
|
3 |
{
|
4 |
parent::__construct();
|
5 |
$this->setId('wishlistReportGrid');
|
6 |
$this->setDefaultSort('updated_at');
|
7 |
$this->setDefaultDir('desc');
|
8 |
}
|
9 |
{
|
10 |
foreach ($wishlistItemsCollection->getItems() as $item)
|
11 |
{
|
12 |
$wishlist_id = $item->getWishlistId();
|
13 |
}
|
14 |
return $filterArray;
|
15 |
}
|
16 |
protected function _prepareCollection()
|
17 |
{
|
18 |
else
|
19 |
else
|
20 |
$end = new Zend_Date($eDate);
|
21 |
$collection = Mage::getModel('wishlist/wishlist')
|
22 |
//->addAttributeToSelect('entity_id')
|
23 |
$this->setCollection($collection);
|
24 |
parent::_prepareCollection();
|
25 |
return $this;
|
26 |
}
|
27 |
protected function _prepareColumns()
|
28 |
{
|
29 |
$this->addColumn('wishlist_id', array(
|
30 |
'header' =>Mage::helper('reports')->__('Wishlist ID'),
|
31 |
'width' =>'50px',
|
32 |
'index' =>'wishlist_id'
|
33 |
));
|
34 |
$this->addColumn('customer_id', array(
|
35 |
'header' =>Mage::helper('reports')->__('Customer ID'),
|
36 |
'index' =>'customer_id'
|
37 |
));
|
38 |
'header' =>Mage::helper('reports')->__('Has Been Shared ?'),
|
39 |
'index' =>'shared',
|
40 |
'options' => array(
|
41 |
0 => Mage::helper('reports')->__('No'),
|
42 |
1 => Mage::helper('reports')->__('Yes')
|
43 |
)
|
44 |
));
|
45 |
$this->addColumn('updated_at', array(
|
46 |
'header' =>Mage::helper('reports')->__('Updated At'),
|
47 |
'align' =>'right',
|
48 |
'index' =>'updated_at'
|
49 |
));
|
50 |
array(
|
51 |
'header' => Mage::helper('reports')->__('Action'),
|
52 |
'width' => '100',
|
53 |
'type' => 'action',
|
54 |
'getter' => 'getCustomerId',
|
55 |
'actions' => array(
|
56 |
array(
|
57 |
'caption' => Mage::helper('reports')->__('Edit Customer'),
|
58 |
'url' => array('base'=> 'adminhtml/customer/edit'),
|
59 |
'field' => 'id'
|
60 |
)
|
61 |
),
|
62 |
'filter' => false,
|
63 |
'sortable' => false,
|
64 |
'index' => 'stores',
|
65 |
'is_system' => true,
|
66 |
));
|
67 |
$this->addExportType('*/*/exportWishlistCsv', Mage::helper('reports')->__('CSV'));
|
68 |
$this->addExportType('*/*/exportWishlistExcel', Mage::helper('reports')->__('Excel'));
|
69 |
return parent::_prepareColumns();
|
70 |
}
|
app/code/community/DigitalPianism/CustomReports/Block/Worstsellers.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Worstsellers extends DigitalPianism_CustomReports_Block_Customreport
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setTemplate('digitalpianism/customreports/advancedgrid.phtml');
|
8 |
+
$this->setTitle('Custom Worstsellers Report');
|
9 |
+
// Set the right URL for the form which handles the dates
|
10 |
+
$this->setFormAction(Mage::getUrl('*/*/index'));
|
11 |
+
}
|
12 |
+
|
13 |
+
public function _beforeToHtml()
|
14 |
+
{
|
15 |
+
$this->setChild('grid', $this->getLayout()->createBlock('customreports/worstsellers_grid', 'customreports.grid'));
|
16 |
+
return $this;
|
17 |
+
}
|
18 |
+
|
19 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Block/Worstsellers/Grid.php
ADDED
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Worstsellers_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
+
{
|
4 |
+
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('worstsellersReportGrid');
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function _prepareCollection()
|
12 |
+
{
|
13 |
+
// Get the session
|
14 |
+
$session = Mage::getSingleton('core/session');
|
15 |
+
|
16 |
+
// Dates for one week
|
17 |
+
$store = Mage_Core_Model_App::ADMIN_STORE_ID;
|
18 |
+
$timezone = Mage::app()->getStore($store)->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);
|
19 |
+
date_default_timezone_set($timezone);
|
20 |
+
|
21 |
+
// Automatic -30 days if no dates provided
|
22 |
+
if ($session->getWorstsellersFrom())
|
23 |
+
{
|
24 |
+
$sDate = $session->getWorstsellersFrom();
|
25 |
+
}
|
26 |
+
else
|
27 |
+
{
|
28 |
+
$sDate = date('Y-m-d 00:00:00',
|
29 |
+
Mage::getModel('core/date')->timestamp(strtotime('-30 days'))
|
30 |
+
);
|
31 |
+
}
|
32 |
+
if ($session->getWorstsellersTo())
|
33 |
+
{
|
34 |
+
$eDate = $session->getWorstsellersTo();
|
35 |
+
}
|
36 |
+
else
|
37 |
+
{
|
38 |
+
$eDate = date('Y-m-d 23:59:59',
|
39 |
+
Mage::getModel('core/date')->timestamp(time())
|
40 |
+
);
|
41 |
+
}
|
42 |
+
|
43 |
+
###############################################################################
|
44 |
+
|
45 |
+
$start = new Zend_Date($sDate);
|
46 |
+
$start->setTimeZone("UTC");
|
47 |
+
|
48 |
+
$end = new Zend_Date($eDate);
|
49 |
+
$end->setTimeZone("UTC");
|
50 |
+
|
51 |
+
###############################################################################
|
52 |
+
|
53 |
+
$from = $start->toString("Y-MM-dd HH:mm:ss");
|
54 |
+
$to = $end->toString("Y-MM-dd HH:mm:ss");
|
55 |
+
|
56 |
+
|
57 |
+
// Get the products with their ordered quantity
|
58 |
+
$bestSellers = Mage::getResourceModel('reports/product_collection')
|
59 |
+
->addAttributeToSelect('*')
|
60 |
+
->addOrderedQty($from, $to)
|
61 |
+
->setOrder('ordered_qty');
|
62 |
+
|
63 |
+
$bestSellers->getSelect()->join( array ('catalog_product' => Mage::getSingleton('core/resource')->getTableName('catalog/product')), 'catalog_product.entity_id = order_items.product_id', array('catalog_product.sku'));
|
64 |
+
|
65 |
+
//echo $bestSellers->printlogquery(true);
|
66 |
+
|
67 |
+
// Array that will contain the data
|
68 |
+
$arrayBestSellers = array();
|
69 |
+
foreach ($bestSellers as $productSold)
|
70 |
+
{
|
71 |
+
// Get Sku and Name
|
72 |
+
$sku = $productSold->getData('sku') ? $productSold->getData('sku') : $productSold->getData('catalog_product.sku');
|
73 |
+
$name = $productSold->getData('name') ? $productSold->getData('name') : $productSold->getData('order_items_name');
|
74 |
+
|
75 |
+
// If the sku is not set
|
76 |
+
if (!$sku)
|
77 |
+
{
|
78 |
+
// We get the sku by loading the product
|
79 |
+
$sku = Mage::getModel('catalog/product')->load($productSold->getEntityId())->getSku();
|
80 |
+
// If there's still no sku
|
81 |
+
if (!$sku)
|
82 |
+
{
|
83 |
+
// That means the product has been deleted
|
84 |
+
$sku = "UNKNOWN";
|
85 |
+
}
|
86 |
+
}
|
87 |
+
// If the name is not set
|
88 |
+
if (!$name)
|
89 |
+
{
|
90 |
+
// We get the name by loading the product
|
91 |
+
$name = Mage::getModel('catalog/product')->load($productSold->getEntityId())->getName();
|
92 |
+
// If there's still no name
|
93 |
+
if (!$name)
|
94 |
+
{
|
95 |
+
// That means the product has been deleted
|
96 |
+
$name = "PRODUCT NO LONGER EXISTS";
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
// We fill the array with the data
|
101 |
+
$arrayBestSellers[$productSold->getEntityId()] = array(
|
102 |
+
'sku' => $sku,
|
103 |
+
'name' => $name,
|
104 |
+
'ordered_qty' => $productSold->getOrderedQty(),
|
105 |
+
'views' => 0,
|
106 |
+
'product_id' => $productSold->getEntityId()
|
107 |
+
);
|
108 |
+
}
|
109 |
+
|
110 |
+
// Get the most viewed products
|
111 |
+
$mostViewed = Mage::getResourceModel('reports/product_collection')
|
112 |
+
->addAttributeToSelect('*')
|
113 |
+
->addViewsCount($from, $to);
|
114 |
+
|
115 |
+
//echo $mostViewed->printlogquery(true);
|
116 |
+
|
117 |
+
// Array that will contain the data
|
118 |
+
$arrayMostViewed = array();
|
119 |
+
foreach ($mostViewed as $productViewed)
|
120 |
+
{
|
121 |
+
// If the product has been pushed to the first array
|
122 |
+
// That means it has been sold
|
123 |
+
if (array_key_exists($productViewed->getEntityId(),$arrayBestSellers) && is_array($arrayBestSellers[$productViewed->getEntityId()]))
|
124 |
+
{
|
125 |
+
// We get the number of views
|
126 |
+
$arrayBestSellers[$productViewed->getEntityId()]['views'] = $productViewed->getViews();
|
127 |
+
}
|
128 |
+
// Else it is a product that has never been sold
|
129 |
+
else
|
130 |
+
{
|
131 |
+
// Get Sku and Name
|
132 |
+
$sku = $productViewed->getSku();
|
133 |
+
$name = $productViewed->getName();
|
134 |
+
// If the sku is not set
|
135 |
+
if (!$sku)
|
136 |
+
{
|
137 |
+
// We get the sku by loading the product
|
138 |
+
$sku = Mage::getModel('catalog/product')->load($productViewed->getEntityId())->getSku();
|
139 |
+
}
|
140 |
+
// If the name is not set
|
141 |
+
if (!$name)
|
142 |
+
{
|
143 |
+
// We get the name by loading the product
|
144 |
+
$name = Mage::getModel('catalog/product')->load($productViewed->getEntityId())->getName();
|
145 |
+
}
|
146 |
+
// We fill the array with the data
|
147 |
+
$arrayBestSellers[$productViewed->getEntityId()] = array(
|
148 |
+
'sku' => $sku,
|
149 |
+
'name' => $name,
|
150 |
+
'ordered_qty' => 0,
|
151 |
+
'views' => $productViewed->getViews(),
|
152 |
+
'product_id' => $productViewed->getEntityId()
|
153 |
+
);
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
// Obtain a list of columns to sort the array using subkeys
|
158 |
+
$views = array();
|
159 |
+
$qty = array();
|
160 |
+
foreach ($arrayBestSellers as $key => $row) {
|
161 |
+
// Remove the unexisting products
|
162 |
+
if ($row['sku'] == "UNKNOWN") {
|
163 |
+
unset($arrayBestSellers[$key]);
|
164 |
+
continue;
|
165 |
+
}
|
166 |
+
$views[$key] = $row['views'];
|
167 |
+
$qty[$key] = $row['ordered_qty'];
|
168 |
+
}
|
169 |
+
|
170 |
+
// Sort the data with qty ascending, views descending
|
171 |
+
// Add $arrayBestSellers as the last parameter, to sort by the common key
|
172 |
+
array_multisort($qty, SORT_ASC, $views, SORT_DESC, $arrayBestSellers);
|
173 |
+
|
174 |
+
// Convert the array to a collection
|
175 |
+
$collection = new Varien_Data_Collection();
|
176 |
+
foreach($arrayBestSellers as $product){
|
177 |
+
$rowObj = new Varien_Object();
|
178 |
+
$rowObj->setData($product);
|
179 |
+
$collection->addItem($rowObj);
|
180 |
+
}
|
181 |
+
|
182 |
+
$this->setCollection($collection);
|
183 |
+
|
184 |
+
parent::_prepareCollection();
|
185 |
+
|
186 |
+
return $this;
|
187 |
+
}
|
188 |
+
|
189 |
+
protected function _prepareColumns()
|
190 |
+
{
|
191 |
+
$this->addColumn('sku', array(
|
192 |
+
'header' => Mage::helper('reports')->__('Product SKU'),
|
193 |
+
'width' => '50',
|
194 |
+
'index' => 'sku'
|
195 |
+
));
|
196 |
+
|
197 |
+
$this->addColumn('name', array(
|
198 |
+
'header' => Mage::helper('reports')->__('Product Name'),
|
199 |
+
'width' => '300',
|
200 |
+
'index' => 'name'
|
201 |
+
));
|
202 |
+
|
203 |
+
$this->addColumn('ordered_qty', array(
|
204 |
+
'header' => Mage::helper('reports')->__('Ordered Quantity'),
|
205 |
+
'width' => '150',
|
206 |
+
'index' => 'ordered_qty',
|
207 |
+
));
|
208 |
+
|
209 |
+
$this->addColumn('views', array(
|
210 |
+
'header' => Mage::helper('reports')->__('Views'),
|
211 |
+
'width' => '150',
|
212 |
+
'index' => 'views',
|
213 |
+
));
|
214 |
+
|
215 |
+
$this->addColumn('action',
|
216 |
+
array(
|
217 |
+
'header' => Mage::helper('reports')->__('Action'),
|
218 |
+
'width' => '100',
|
219 |
+
'type' => 'action',
|
220 |
+
'getter' => 'getProductId',
|
221 |
+
'actions' => array(
|
222 |
+
array(
|
223 |
+
'caption' => Mage::helper('reports')->__('Edit Product'),
|
224 |
+
'url' => array('base'=> 'adminhtml/catalog_product/edit/'),
|
225 |
+
'field' => 'id'
|
226 |
+
)
|
227 |
+
),
|
228 |
+
'filter' => false,
|
229 |
+
'sortable' => false,
|
230 |
+
'index' => 'stores',
|
231 |
+
'is_system' => true,
|
232 |
+
));
|
233 |
+
|
234 |
+
$this->addExportType('*/*/exportWorstsellersCsv', Mage::helper('reports')->__('CSV'));
|
235 |
+
$this->addExportType('*/*/exportWorstsellersExcel', Mage::helper('reports')->__('Excel'));
|
236 |
+
|
237 |
+
return parent::_prepareColumns();
|
238 |
+
}
|
239 |
+
|
240 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Block/Worstsellersbycategory.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Worstsellersbycategory extends DigitalPianism_CustomReports_Block_Customreport
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setTemplate('digitalpianism/customreports/advancedgrid.phtml');
|
8 |
+
$this->setTitle('Custom Worstsellers By Category Report');
|
9 |
+
$this->setSideNote("<p>Attention: please note that these data may not be totally accurate due to the following reasons:</p>
|
10 |
+
<p>- A product can be moved to a different category after an order has been placed.</p>
|
11 |
+
<p>- A category can be deleted</p>
|
12 |
+
<p>- A product can be in more than one category</p>
|
13 |
+
<p>For these reasons, if a product is in several categories, it will be counted as a sale for all of these categories.</p>");
|
14 |
+
// Set the right URL for the form which handles the dates
|
15 |
+
$this->setFormAction(Mage::getUrl('*/*/index'));
|
16 |
+
}
|
17 |
+
|
18 |
+
public function _beforeToHtml()
|
19 |
+
{
|
20 |
+
$this->setChild('grid', $this->getLayout()->createBlock('customreports/worstsellersbycategory_grid', 'customreports.grid'));
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Block/Worstsellersbycategory/Grid.php
ADDED
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_Block_Worstsellersbycategory_Grid extends AW_Advancedreports_Block_Advanced_Bestsellers_Grid
|
3 |
+
{
|
4 |
+
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
Mage_Adminhtml_Block_Widget_Grid::__construct();
|
8 |
+
$this->setId('worstsellersbycategoryReportGrid');
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function _prepareCollection()
|
12 |
+
{
|
13 |
+
// Get the session
|
14 |
+
$session = Mage::getSingleton('core/session');
|
15 |
+
|
16 |
+
// Dates for one week
|
17 |
+
$store = Mage_Core_Model_App::ADMIN_STORE_ID;
|
18 |
+
$timezone = Mage::app()->getStore($store)->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);
|
19 |
+
date_default_timezone_set($timezone);
|
20 |
+
|
21 |
+
// Automatic -30 days if no dates provided
|
22 |
+
if ($session->getFrom())
|
23 |
+
{
|
24 |
+
$sDate = $session->getFrom();
|
25 |
+
$sDate = str_replace('/', '-', $sDate);
|
26 |
+
$sDate = strtotime($sDate);
|
27 |
+
$sDate = date('Y-m-d H:i:s', $sDate);
|
28 |
+
}
|
29 |
+
else
|
30 |
+
{
|
31 |
+
$sDate = date('Y-m-d 00:00:00',
|
32 |
+
Mage::getModel('core/date')->timestamp(strtotime('-30 days'))
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
if ($session->getTo())
|
37 |
+
{
|
38 |
+
$eDate = $session->getTo();
|
39 |
+
$eDate = str_replace('/', '-', $eDate);
|
40 |
+
$eDate = strtotime($eDate);
|
41 |
+
$eDate = date('Y-m-d H:i:s', $eDate);
|
42 |
+
}
|
43 |
+
else
|
44 |
+
{
|
45 |
+
$eDate = date('Y-m-d 23:59:59',
|
46 |
+
Mage::getModel('core/date')->timestamp(time())
|
47 |
+
);
|
48 |
+
}
|
49 |
+
|
50 |
+
###############################################################################
|
51 |
+
|
52 |
+
$start = new Zend_Date($sDate);
|
53 |
+
$start->setTimeZone("UTC");
|
54 |
+
|
55 |
+
$end = new Zend_Date($eDate);
|
56 |
+
$end->setTimeZone("UTC");
|
57 |
+
|
58 |
+
###############################################################################
|
59 |
+
|
60 |
+
$from = $start->toString("Y-MM-dd HH:mm:ss");
|
61 |
+
$to = $end->toString("Y-MM-dd HH:mm:ss");
|
62 |
+
|
63 |
+
|
64 |
+
// Get the bestsellers product using Magento collection
|
65 |
+
$bestSellers = Mage::getResourceModel('reports/product_collection')
|
66 |
+
->addOrderedQtyAndTotal($sDate, $eDate)
|
67 |
+
->addAttributeToSelect('*')
|
68 |
+
->setOrder('ordered_qty');
|
69 |
+
|
70 |
+
//echo $bestSellers->printlogquery(true);
|
71 |
+
|
72 |
+
// Array that will contain the data
|
73 |
+
$arrayBestSellers = array();
|
74 |
+
foreach ($bestSellers as $productSold)
|
75 |
+
{
|
76 |
+
// We fill the array with the data
|
77 |
+
$arrayBestSellers[$productSold->getEntityId()] = array(
|
78 |
+
'ordered_qty' => $productSold->getOrderedQty(),
|
79 |
+
'views' => 0,
|
80 |
+
'product_id' => $productSold->getEntityId()
|
81 |
+
);
|
82 |
+
}
|
83 |
+
|
84 |
+
// Get the most viewed products
|
85 |
+
$mostViewed = Mage::getResourceModel('reports/product_collection')
|
86 |
+
->addAttributeToSelect('*')
|
87 |
+
->addViewsCount($from, $to);
|
88 |
+
|
89 |
+
//echo $mostViewed->printlogquery(true);
|
90 |
+
|
91 |
+
// Array that will contain the data
|
92 |
+
$arrayMostViewed = array();
|
93 |
+
foreach ($mostViewed as $productViewed)
|
94 |
+
{
|
95 |
+
// If the product has been pushed to the first array
|
96 |
+
// That means it has been sold
|
97 |
+
if (array_key_exists($productViewed->getEntityId(),$arrayBestSellers) && is_array($arrayBestSellers[$productViewed->getEntityId()]))
|
98 |
+
{
|
99 |
+
// We get the number of views
|
100 |
+
$arrayBestSellers[$productViewed->getEntityId()]['views'] = $productViewed->getViews();
|
101 |
+
}
|
102 |
+
// Else it is a product that has never been sold
|
103 |
+
else
|
104 |
+
{
|
105 |
+
// We fill the array with the data
|
106 |
+
$arrayBestSellers[$productViewed->getEntityId()] = array(
|
107 |
+
'ordered_qty' => 0,
|
108 |
+
'views' => $productViewed->getViews(),
|
109 |
+
'product_id' => $productViewed->getEntityId()
|
110 |
+
);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
// Array that will contain the data
|
115 |
+
$arrayWorstSellers = array();
|
116 |
+
foreach ($arrayBestSellers as $worstSellerProductId => $worstSellerProduct)
|
117 |
+
{
|
118 |
+
// Get Product ID
|
119 |
+
$id = $worstSellerProduct['product_id'];
|
120 |
+
|
121 |
+
// Get Sold Quantity and Total
|
122 |
+
$orderedQty = $worstSellerProduct['ordered_qty'];
|
123 |
+
$views = $worstSellerProduct['views'];
|
124 |
+
|
125 |
+
// Load the potential parent product ids
|
126 |
+
$parentProduct = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($id);
|
127 |
+
|
128 |
+
// If a product is an associated product
|
129 |
+
if (!empty($parentProduct) && isset($parentProduct[0]))
|
130 |
+
{
|
131 |
+
// Get the parent configurable product id
|
132 |
+
$productId = $parentProduct[0];
|
133 |
+
}
|
134 |
+
else
|
135 |
+
{
|
136 |
+
// Get the simple product id
|
137 |
+
$productId = $id;
|
138 |
+
}
|
139 |
+
|
140 |
+
// Get all categories of this product
|
141 |
+
$categories = Mage::getResourceModel('catalog/category_collection')
|
142 |
+
->joinField('product_id',
|
143 |
+
'catalog/category_product',
|
144 |
+
'product_id',
|
145 |
+
'category_id = entity_id',
|
146 |
+
null)
|
147 |
+
->addAttributeToSelect('name')
|
148 |
+
->addAttributeToSelect('parent_id')
|
149 |
+
->addFieldToFilter('product_id', $productId);
|
150 |
+
|
151 |
+
// Export this collection to array so we could iterate on it's elements
|
152 |
+
$categories = $categories->exportToArray();
|
153 |
+
// Get categories names
|
154 |
+
foreach($categories as $category)
|
155 |
+
{
|
156 |
+
// Get Category ID
|
157 |
+
$categoryID = $category['entity_id'];
|
158 |
+
// Get Category Name
|
159 |
+
$categoryName = $category['name'];
|
160 |
+
|
161 |
+
// If category already in the array, we add data
|
162 |
+
if (array_key_exists($categoryID, $arrayWorstSellers))
|
163 |
+
{
|
164 |
+
// We update the ordered quantity
|
165 |
+
$arrayWorstSellers[$categoryID]['ordered_qty'] += $orderedQty;
|
166 |
+
|
167 |
+
// We udpate the ordered total
|
168 |
+
$arrayWorstSellers[$categoryID]['views'] += $views;
|
169 |
+
}
|
170 |
+
else
|
171 |
+
{
|
172 |
+
// For the categories called 'ALL' we need to add the parent category name
|
173 |
+
if (strtolower($categoryName)=='all')
|
174 |
+
{
|
175 |
+
// Get the parent category Name
|
176 |
+
$parentCategoryName = Mage::getModel('catalog/category')->load($category['parent_id'])->getName();
|
177 |
+
// Add the parent category name
|
178 |
+
$categoryName = $parentCategoryName . " > " . $categoryName;
|
179 |
+
}
|
180 |
+
|
181 |
+
// Else we create a new entry with the data
|
182 |
+
$arrayWorstSellers[$categoryID] = array(
|
183 |
+
'name' => $categoryName,
|
184 |
+
'ordered_qty' => $orderedQty,
|
185 |
+
'views' => $views
|
186 |
+
);
|
187 |
+
}
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
// Obtain a list of columns to sort the array using subkeys
|
192 |
+
$views = array();
|
193 |
+
$qty = array();
|
194 |
+
foreach ($arrayWorstSellers as $key => $row) {
|
195 |
+
$views[$key] = $row['views'];
|
196 |
+
$qty[$key] = $row['ordered_qty'];
|
197 |
+
}
|
198 |
+
|
199 |
+
// Sort the data with qty ascending, views descending
|
200 |
+
// Add $arrayWorstSellers as the last parameter, to sort by the common key
|
201 |
+
array_multisort($qty, SORT_ASC, $views, SORT_DESC, $arrayWorstSellers);
|
202 |
+
|
203 |
+
// Convert the array to a collection
|
204 |
+
$collection = new Varien_Data_Collection();
|
205 |
+
foreach($arrayWorstSellers as $category){
|
206 |
+
$rowObj = new Varien_Object();
|
207 |
+
$rowObj->setData($category);
|
208 |
+
$collection->addItem($rowObj);
|
209 |
+
}
|
210 |
+
|
211 |
+
$this->setCollection($collection);
|
212 |
+
|
213 |
+
Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
|
214 |
+
|
215 |
+
return $this;
|
216 |
+
}
|
217 |
+
|
218 |
+
protected function _prepareColumns()
|
219 |
+
{
|
220 |
+
$this->addColumn('name', array(
|
221 |
+
'header' => Mage::helper('reports')->__('Category Name'),
|
222 |
+
'width' => '50',
|
223 |
+
'index' => 'name'
|
224 |
+
));
|
225 |
+
|
226 |
+
$this->addColumn('ordered_qty', array(
|
227 |
+
'header' => Mage::helper('reports')->__('Ordered Quantity'),
|
228 |
+
'width' => '150',
|
229 |
+
'index' => 'ordered_qty',
|
230 |
+
));
|
231 |
+
|
232 |
+
$this->addColumn('views', array(
|
233 |
+
'header' => Mage::helper('reports')->__('Views'),
|
234 |
+
'width' => '150',
|
235 |
+
'index' => 'views',
|
236 |
+
));
|
237 |
+
|
238 |
+
$this->addExportType('*/*/exportWorstsellersbycategoryCsv', Mage::helper('reports')->__('CSV'));
|
239 |
+
$this->addExportType('*/*/exportWorstsellersbycategoryExcel', Mage::helper('reports')->__('Excel'));
|
240 |
+
|
241 |
+
return Mage_Adminhtml_Block_Widget_Grid::_prepareColumns();
|
242 |
+
}
|
243 |
+
|
244 |
+
}
|
app/code/community/DigitalPianism/CustomReports/Model/Reports/Resource/Product/Collection.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Add a method to retrieve the bestsellers correctly
|
4 |
+
*/
|
5 |
+
class FactoryX_CustomReports_Model_Reports_Resource_Product_Collection extends Mage_Reports_Model_Resource_Product_Collection
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Add ordered qty's
|
9 |
+
*
|
10 |
+
* @param string $from
|
11 |
+
* @param string $to
|
12 |
+
* @return Mage_Reports_Model_Resource_Product_Collection
|
13 |
+
*/
|
14 |
+
public function addOrderedQtyAndTotal($from = '', $to = '')
|
15 |
+
{
|
16 |
+
$adapter = $this->getConnection();
|
17 |
+
$compositeTypeIds = Mage::getSingleton('catalog/product_type')->getCompositeTypes();
|
18 |
+
$orderTableAliasName = $adapter->quoteIdentifier('order');
|
19 |
+
|
20 |
+
$orderJoinCondition = array(
|
21 |
+
$orderTableAliasName . '.entity_id = order_items.order_id',
|
22 |
+
$adapter->quoteInto("{$orderTableAliasName}.state = ?", Mage_Sales_Model_Order::STATE_COMPLETE),
|
23 |
+
|
24 |
+
);
|
25 |
+
|
26 |
+
$productJoinCondition = array('e.entity_id = order_items.product_id');
|
27 |
+
|
28 |
+
if ($from != '' && $to != '') {
|
29 |
+
$fieldName = $orderTableAliasName . '.created_at';
|
30 |
+
$orderJoinCondition[] = $this->_prepareBetweenSql($fieldName, $from, $to);
|
31 |
+
}
|
32 |
+
|
33 |
+
$this->getSelect()->reset()
|
34 |
+
->from(
|
35 |
+
array('order_items' => $this->getTable('sales/order_item')),
|
36 |
+
array(
|
37 |
+
'ordered_qty' => 'SUM(order_items.qty_ordered)',
|
38 |
+
'order_items_name' => 'order_items.name',
|
39 |
+
'order_items_sku' => 'order_items.sku',
|
40 |
+
'ordered_total' => 'SUM(IF(order_items.base_row_total>0,order_items.base_row_total, order_items2.base_row_total))'
|
41 |
+
))
|
42 |
+
->joinInner(
|
43 |
+
array('order' => $this->getTable('sales/order')),
|
44 |
+
implode(' AND ', $orderJoinCondition),
|
45 |
+
array())
|
46 |
+
->joinLeft(
|
47 |
+
array('order_items2' => $this->getTable('sales/order_item')), "(order_items.parent_item_id = order_items2.item_id AND order_items2.product_type = 'configurable')", array())
|
48 |
+
->joinLeft(
|
49 |
+
array('e' => $this->getProductEntityTableName()),
|
50 |
+
implode(' AND ', $productJoinCondition),
|
51 |
+
array(
|
52 |
+
'entity_id' => 'order_items.product_id',
|
53 |
+
'entity_type_id' => 'e.entity_type_id',
|
54 |
+
'attribute_set_id' => 'e.attribute_set_id',
|
55 |
+
'type_id' => 'e.type_id',
|
56 |
+
'sku' => 'e.sku',
|
57 |
+
'has_options' => 'e.has_options',
|
58 |
+
'required_options' => 'e.required_options',
|
59 |
+
'created_at' => 'e.created_at',
|
60 |
+
'updated_at' => 'e.updated_at'
|
61 |
+
))
|
62 |
+
->where('(order_items.parent_item_id IS NULL
|
63 |
+
AND order_items.product_type NOT IN ("configurable","bundle")
|
64 |
+
)
|
65 |
+
OR (
|
66 |
+
order_items.parent_item_id IS NOT NULL
|
67 |
+
AND order_items.product_type NOT IN ("configurable","bundle")
|
68 |
+
)')
|
69 |
+
->group('e.entity_id');
|
70 |
+
|
71 |
+
return $this;
|
72 |
+
}
|
73 |
+
}
|
app/code/community/DigitalPianism/CustomReports/controllers/BestsellersbycategoryController.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_BestsellersbycategoryController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
// Get the session
|
7 |
+
$session = Mage::getSingleton('core/session');
|
8 |
+
|
9 |
+
// Get the dates
|
10 |
+
$_from = $this->getRequest()->getParam('from');
|
11 |
+
$_to = $this->getRequest()->getParam('to');
|
12 |
+
|
13 |
+
// Use the session to manage the dates
|
14 |
+
if ($_from != "") $session->setFrom($_from);
|
15 |
+
if ($_to != "") $session->setTo($_to);
|
16 |
+
|
17 |
+
$this->loadLayout()
|
18 |
+
->_setActiveMenu('customreports/bestsellersbycategory')
|
19 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Custom Bestsellers By Category Report'), Mage::helper('adminhtml')->__('Custom Bestsellers By Category Report'))
|
20 |
+
->_addContent( $this->getLayout()->createBlock('customreports/bestsellersbycategory') )
|
21 |
+
->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Export bestsellersbycategory report grid to CSV format
|
26 |
+
*/
|
27 |
+
public function exportBestsellersbycategoryCsvAction()
|
28 |
+
{
|
29 |
+
$fileName = 'bestsellersbycategory.csv';
|
30 |
+
$content = $this->getLayout()->createBlock('customreports/bestsellersbycategory_grid')
|
31 |
+
->getCsvFile();
|
32 |
+
|
33 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Export bestsellersbycategory report to Excel XML format
|
38 |
+
*/
|
39 |
+
public function exportBestsellersbycategoryExcelAction()
|
40 |
+
{
|
41 |
+
$fileName = 'bestsellersbycategory.xml';
|
42 |
+
$content = $this->getLayout()->createBlock('customreports/bestsellersbycategory_grid')
|
43 |
+
->getExcelFile($fileName);
|
44 |
+
|
45 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
46 |
+
}
|
47 |
+
}
|
app/code/community/DigitalPianism/CustomReports/controllers/LifetimesalesController.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_LifetimesalesController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
// Get the session
|
7 |
+
$session = Mage::getSingleton('core/session');
|
8 |
+
|
9 |
+
// Get the dates
|
10 |
+
$_from = $this->getRequest()->getParam('from');
|
11 |
+
$_to = $this->getRequest()->getParam('to');
|
12 |
+
|
13 |
+
// Use the session to manage the dates
|
14 |
+
if ($_from != "") $session->setLifetimesalesFrom($_from);
|
15 |
+
if ($_to != "") $session->setLifetimesalesTo($_to);
|
16 |
+
|
17 |
+
$this->loadLayout()
|
18 |
+
->_setActiveMenu('customreports/lifetimesales')
|
19 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Custom Lifetimesales Report'), Mage::helper('adminhtml')->__('Custom Lifetimesales Report'))
|
20 |
+
->_addContent( $this->getLayout()->createBlock('customreports/lifetimesales') )
|
21 |
+
->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Export lifetimesales report grid to CSV format
|
26 |
+
*/
|
27 |
+
public function exportLifetimesalesCsvAction()
|
28 |
+
{
|
29 |
+
$fileName = 'lifetimesales.csv';
|
30 |
+
$content = $this->getLayout()->createBlock('customreports/lifetimesales_grid')
|
31 |
+
->getCsvFile();
|
32 |
+
|
33 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Export lifetimesales report to Excel XML format
|
38 |
+
*/
|
39 |
+
public function exportLifetimesalesExcelAction()
|
40 |
+
{
|
41 |
+
$fileName = 'lifetimesales.xml';
|
42 |
+
$content = $this->getLayout()->createBlock('customreports/lifetimesales_grid')
|
43 |
+
->getExcelFile($fileName);
|
44 |
+
|
45 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
46 |
+
}
|
47 |
+
}
|
app/code/community/DigitalPianism/CustomReports/controllers/NoupsellsController.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_NoupsellsController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout()
|
7 |
+
->_setActiveMenu('customreports/noupsells')
|
8 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Custom No Upsells Report'), Mage::helper('adminhtml')->__('Custom No Upsells Report'))
|
9 |
+
->_addContent( $this->getLayout()->createBlock('customreports/noupsells') )
|
10 |
+
->renderLayout();
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Export no upsells report grid to CSV format
|
15 |
+
*/
|
16 |
+
public function exportNoupsellsCsvAction()
|
17 |
+
{
|
18 |
+
$fileName = 'noupsells.csv';
|
19 |
+
$content = $this->getLayout()->createBlock('customreports/noupsells_grid')
|
20 |
+
->getCsvFile();
|
21 |
+
|
22 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Export no upsells report to Excel XML format
|
27 |
+
*/
|
28 |
+
public function exportNoupsellsExcelAction()
|
29 |
+
{
|
30 |
+
$fileName = 'noupsellss.xml';
|
31 |
+
$content = $this->getLayout()->createBlock('customreports/noupsells_grid')
|
32 |
+
->getExcelFile($fileName);
|
33 |
+
|
34 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
35 |
+
}
|
36 |
+
}
|
app/code/community/DigitalPianism/CustomReports/controllers/ShoppedonceController.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_ShoppedonceController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout()
|
7 |
+
->_setActiveMenu('customreports/shoppedonce')
|
8 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Custom Shopped Once And Never Again Report'), Mage::helper('adminhtml')->__('Custom Shopped Once And Never Again Report'))
|
9 |
+
->_addContent( $this->getLayout()->createBlock('customreports/shoppedonce') )
|
10 |
+
->renderLayout();
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Export shoppedonce report grid to CSV format
|
15 |
+
*/
|
16 |
+
public function exportShoppedonceCsvAction()
|
17 |
+
{
|
18 |
+
$fileName = 'shoppedonce.csv';
|
19 |
+
$content = $this->getLayout()->createBlock('customreports/shoppedonce_grid')
|
20 |
+
->getCsvFile();
|
21 |
+
|
22 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Export shoppedonce report to Excel XML format
|
27 |
+
*/
|
28 |
+
public function exportShoppedonceExcelAction()
|
29 |
+
{
|
30 |
+
$fileName = 'shoppedonce.xml';
|
31 |
+
$content = $this->getLayout()->createBlock('customreports/shoppedonce_grid')
|
32 |
+
->getExcelFile($fileName);
|
33 |
+
|
34 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
35 |
+
}
|
36 |
+
}
|
app/code/community/DigitalPianism/CustomReports/controllers/SignedupnoorderController.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_SignedupnoorderController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout()
|
7 |
+
->_setActiveMenu('customreports/signedupnoorder')
|
8 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Custom Signed Up But Never Shopped Report'), Mage::helper('adminhtml')->__('Custom Signed Up But Never Shopped Report'))
|
9 |
+
->_addContent( $this->getLayout()->createBlock('customreports/signedupnoorder') )
|
10 |
+
->renderLayout();
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Export signedupnoorder report grid to CSV format
|
15 |
+
*/
|
16 |
+
public function exportSignedupnoorderCsvAction()
|
17 |
+
{
|
18 |
+
$fileName = 'signedupnoorder.csv';
|
19 |
+
$content = $this->getLayout()->createBlock('customreports/signedupnoorder_grid')
|
20 |
+
->getCsvFile();
|
21 |
+
|
22 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Export signedupnoorder report to Excel XML format
|
27 |
+
*/
|
28 |
+
public function exportSignedupnoorderExcelAction()
|
29 |
+
{
|
30 |
+
$fileName = 'signedupnoorder.xml';
|
31 |
+
$content = $this->getLayout()->createBlock('customreports/signedupnoorder_grid')
|
32 |
+
->getExcelFile($fileName);
|
33 |
+
|
34 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
35 |
+
}
|
36 |
+
}
|
app/code/community/DigitalPianism/CustomReports/controllers/WishlistController.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_WishlistController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
// Get the session
|
7 |
+
$session = Mage::getSingleton('core/session');
|
8 |
+
|
9 |
+
// Get the dates
|
10 |
+
$_from = $this->getRequest()->getParam('from');
|
11 |
+
$_to = $this->getRequest()->getParam('to');
|
12 |
+
|
13 |
+
// Use the session to manage the dates
|
14 |
+
if ($_from != "") $session->setWishlistFrom($_from);
|
15 |
+
if ($_to != "") $session->setWishlistTo($_to);
|
16 |
+
|
17 |
+
$this->loadLayout()
|
18 |
+
->_setActiveMenu('customreports/wishlist')
|
19 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Custom Wishlist Report'), Mage::helper('adminhtml')->__('Custom Wishlist Report'))
|
20 |
+
->_addContent( $this->getLayout()->createBlock('customreports/wishlist') )
|
21 |
+
->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Export wishlist report grid to CSV format
|
26 |
+
*/
|
27 |
+
public function exportWishlistCsvAction()
|
28 |
+
{
|
29 |
+
$fileName = 'wishlist.csv';
|
30 |
+
$content = $this->getLayout()->createBlock('customreports/wishlist_grid')
|
31 |
+
->getCsvFile();
|
32 |
+
|
33 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Export wishlist report to Excel XML format
|
38 |
+
*/
|
39 |
+
public function exportWishlistExcelAction()
|
40 |
+
{
|
41 |
+
$fileName = 'wishlist.xml';
|
42 |
+
$content = $this->getLayout()->createBlock('customreports/wishlist_grid')
|
43 |
+
->getExcelFile($fileName);
|
44 |
+
|
45 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
46 |
+
}
|
47 |
+
}
|
app/code/community/DigitalPianism/CustomReports/controllers/WorstsellersController.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_WorstsellersController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
// Get the session
|
7 |
+
$session = Mage::getSingleton('core/session');
|
8 |
+
|
9 |
+
// Get the dates
|
10 |
+
$_from = $this->getRequest()->getParam('from');
|
11 |
+
$_to = $this->getRequest()->getParam('to');
|
12 |
+
|
13 |
+
// Use the session to manage the dates
|
14 |
+
if ($_from != "") $session->setWorstsellersFrom($_from);
|
15 |
+
if ($_to != "") $session->setWorstsellersTo($_to);
|
16 |
+
|
17 |
+
$this->loadLayout()
|
18 |
+
->_setActiveMenu('customreports/worstsellers')
|
19 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Custom Worstsellers Report'), Mage::helper('adminhtml')->__('Custom Worstsellers Report'))
|
20 |
+
->_addContent( $this->getLayout()->createBlock('customreports/worstsellers') )
|
21 |
+
->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Export worstsellers report grid to CSV format
|
26 |
+
*/
|
27 |
+
public function exportWorstsellersCsvAction()
|
28 |
+
{
|
29 |
+
$fileName = 'worstsellers.csv';
|
30 |
+
$content = $this->getLayout()->createBlock('customreports/worstsellers_grid')
|
31 |
+
->getCsvFile();
|
32 |
+
|
33 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Export worstsellers report to Excel XML format
|
38 |
+
*/
|
39 |
+
public function exportWorstsellersExcelAction()
|
40 |
+
{
|
41 |
+
$fileName = 'worstsellers.xml';
|
42 |
+
$content = $this->getLayout()->createBlock('customreports/worstsellers_grid')
|
43 |
+
->getExcelFile($fileName);
|
44 |
+
|
45 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
46 |
+
}
|
47 |
+
}
|
app/code/community/DigitalPianism/CustomReports/controllers/WorstsellersbycategoryController.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalPianism_CustomReports_WorstsellersbycategoryController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
// Get the session
|
7 |
+
$session = Mage::getSingleton('core/session');
|
8 |
+
|
9 |
+
// Get the dates
|
10 |
+
$_from = $this->getRequest()->getParam('from');
|
11 |
+
$_to = $this->getRequest()->getParam('to');
|
12 |
+
|
13 |
+
// Use the session to manage the dates
|
14 |
+
if ($_from != "") $session->setFrom($_from);
|
15 |
+
if ($_to != "") $session->setTo($_to);
|
16 |
+
|
17 |
+
$this->loadLayout()
|
18 |
+
->_setActiveMenu('customreports/worstsellersbycategory')
|
19 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Custom Worstsellers By Category Report'), Mage::helper('adminhtml')->__('Custom Worstsellers By Category Report'))
|
20 |
+
->_addContent( $this->getLayout()->createBlock('customreports/worstsellersbycategory') )
|
21 |
+
->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Export worstsellersbycategory report grid to CSV format
|
26 |
+
*/
|
27 |
+
public function exportWorstsellersbycategoryCsvAction()
|
28 |
+
{
|
29 |
+
$fileName = 'worstsellersbycategory.csv';
|
30 |
+
$content = $this->getLayout()->createBlock('customreports/worstsellersbycategory_grid')
|
31 |
+
->getCsvFile();
|
32 |
+
|
33 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Export worstsellersbycategory report to Excel XML format
|
38 |
+
*/
|
39 |
+
public function exportWorstsellersbycategoryExcelAction()
|
40 |
+
{
|
41 |
+
$fileName = 'worstsellersbycategory.xml';
|
42 |
+
$content = $this->getLayout()->createBlock('customreports/worstsellersbycategory_grid')
|
43 |
+
->getExcelFile($fileName);
|
44 |
+
|
45 |
+
$this->_prepareDownloadResponse($fileName, $content);
|
46 |
+
}
|
47 |
+
}
|
app/code/community/DigitalPianism/CustomReports/etc/adminhtml.xml
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" ?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<report translate="title" module="reports">
|
5 |
+
<title>Reports</title>
|
6 |
+
<sort_order>80</sort_order>
|
7 |
+
<children>
|
8 |
+
<categories translate="titl" module="reports">
|
9 |
+
<title>Categories</title>
|
10 |
+
<sort_order>25</sort_order>
|
11 |
+
<children>
|
12 |
+
<bestsellersbycategory translate="title" module="reports">
|
13 |
+
<title>Bestsellers</title>
|
14 |
+
<action>customreports/bestsellersbycategory</action>
|
15 |
+
</bestsellersbycategory>
|
16 |
+
<worstsellersbycategory translate="title" module="reports">
|
17 |
+
<title>Worstsellers</title>
|
18 |
+
<action>customreports/worstsellersbycategory</action>
|
19 |
+
</worstsellersbycategory>
|
20 |
+
</children>
|
21 |
+
</categories>
|
22 |
+
<products translate="title" module="reports">
|
23 |
+
<title>Products</title>
|
24 |
+
<children>
|
25 |
+
<noupsells translate="title" module="reports">
|
26 |
+
<title>No Upsells</title>
|
27 |
+
<action>customreports/noupsells</action>
|
28 |
+
</noupsells>
|
29 |
+
<worstsellers translate="title" module="reports">
|
30 |
+
<title>Worstsellers</title>
|
31 |
+
<action>customreports/worstsellers</action>
|
32 |
+
</worstsellers>
|
33 |
+
</children>
|
34 |
+
</products>
|
35 |
+
<customers translate="title" module="reports">
|
36 |
+
<title>Customers</title>
|
37 |
+
<children>
|
38 |
+
<lifetimesales translate="title" module="reports">
|
39 |
+
<title>Lifetime Sales</title>
|
40 |
+
<action>customreports/lifetimesales</action>
|
41 |
+
</lifetimesales>
|
42 |
+
<shoppedonce translate="title" module="reports">
|
43 |
+
<title>Shopped Once And Never Again</title>
|
44 |
+
<action>customreports/shoppedonce</action>
|
45 |
+
</shoppedonce>
|
46 |
+
<signedupnoorder translate="title" module="reports">
|
47 |
+
<title>Signed Up And Never Order</title>
|
48 |
+
<action>customreports/signedupnoorder</action>
|
49 |
+
</signedupnoorder>
|
50 |
+
</children>
|
51 |
+
</customers>
|
52 |
+
<wishlist translate="title" module="reports">
|
53 |
+
<title>Wishlist</title>
|
54 |
+
<action>customreports/wishlist</action>
|
55 |
+
</wishlist>
|
56 |
+
</children>
|
57 |
+
</report>
|
58 |
+
</menu>
|
59 |
+
<acl>
|
60 |
+
<resources>
|
61 |
+
<all>
|
62 |
+
<title>Allow Everything</title>
|
63 |
+
</all>
|
64 |
+
<admin>
|
65 |
+
<children>
|
66 |
+
<report translate="title" module="reports">
|
67 |
+
<title>Reports</title>
|
68 |
+
<children>
|
69 |
+
<categories translate="titl" module="reports">
|
70 |
+
<title>Categories</title>
|
71 |
+
<children>
|
72 |
+
<bestsellersbycategory translate="title" module="reports">
|
73 |
+
<title>Bestsellers</title>
|
74 |
+
</bestsellersbycategory>
|
75 |
+
<worstsellersbycategory translate="title" module="reports">
|
76 |
+
<title>Worstsellers</title>
|
77 |
+
</worstsellersbycategory>
|
78 |
+
</children>
|
79 |
+
</categories>
|
80 |
+
<products translate="title" module="reports">
|
81 |
+
<title>Products</title>
|
82 |
+
<children>
|
83 |
+
<noupsells translate="title" module="reports">
|
84 |
+
<title>No Upsells</title>
|
85 |
+
</noupsells>
|
86 |
+
<worstsellers translate="title" module="reports">
|
87 |
+
<title>Worst Sellers</title>
|
88 |
+
</worstsellers>
|
89 |
+
</children>
|
90 |
+
</products>
|
91 |
+
<customers translate="title" module="reports">
|
92 |
+
<title>Customers</title>
|
93 |
+
<children>
|
94 |
+
<lifetimesales translate="title" module="reports">
|
95 |
+
<title>Lifetime Sales</title>
|
96 |
+
</lifetimesales>
|
97 |
+
<shoppedonce translate="title" module="reports">
|
98 |
+
<title>Shopped Once And Never Again</title>
|
99 |
+
</shoppedonce>
|
100 |
+
<signedupnoorder translate="title" module="reports">
|
101 |
+
<title>Signed Up And Never Order</title>
|
102 |
+
</signedupnoorder>
|
103 |
+
</children>
|
104 |
+
</customers>
|
105 |
+
<wishlist translate="title" module="reports">
|
106 |
+
<title>Wishlist</title>
|
107 |
+
</wishlist>
|
108 |
+
</children>
|
109 |
+
</report>
|
110 |
+
</children>
|
111 |
+
</admin>
|
112 |
+
</resources>
|
113 |
+
</acl>
|
114 |
+
</config>
|
app/code/community/DigitalPianism/CustomReports/etc/config.xml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<FactoryX_CustomReports>
|
5 |
+
<version>0.0.12</version>
|
6 |
+
</FactoryX_CustomReports>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<frontend>
|
10 |
+
<!-- Translation file -->
|
11 |
+
<translate>
|
12 |
+
<modules>
|
13 |
+
<FactoryX_CustomReports>
|
14 |
+
<files>
|
15 |
+
<default>FactoryX_CustomReports.csv</default>
|
16 |
+
</files>
|
17 |
+
</FactoryX_CustomReports>
|
18 |
+
</modules>
|
19 |
+
</translate>
|
20 |
+
</frontend>
|
21 |
+
|
22 |
+
<adminhtml>
|
23 |
+
<!-- Backend translation file -->
|
24 |
+
<translate>
|
25 |
+
<modules>
|
26 |
+
<FactoryX_CustomReports>
|
27 |
+
<files>
|
28 |
+
<default>FactoryX_CustomReports.csv</default>
|
29 |
+
</files>
|
30 |
+
</FactoryX_CustomReports>
|
31 |
+
</modules>
|
32 |
+
</translate>
|
33 |
+
</adminhtml>
|
34 |
+
|
35 |
+
<global>
|
36 |
+
<models>
|
37 |
+
<reports_resource>
|
38 |
+
<rewrite>
|
39 |
+
<!-- Mage_Reports_Model_Resource_Product_Collection -->
|
40 |
+
<product_collection>FactoryX_CustomReports_Model_Reports_Resource_Product_Collection</product_collection>
|
41 |
+
</rewrite>
|
42 |
+
</reports_resource>
|
43 |
+
</models>
|
44 |
+
|
45 |
+
<blocks>
|
46 |
+
<customreports>
|
47 |
+
<class>FactoryX_CustomReports_Block</class>
|
48 |
+
</customreports>
|
49 |
+
</blocks>
|
50 |
+
</global>
|
51 |
+
|
52 |
+
<admin>
|
53 |
+
<routers>
|
54 |
+
<customreports>
|
55 |
+
<use>admin</use>
|
56 |
+
<args>
|
57 |
+
<module>FactoryX_CustomReports</module>
|
58 |
+
<frontName>customreports</frontName>
|
59 |
+
</args>
|
60 |
+
</customreports>
|
61 |
+
</routers>
|
62 |
+
</admin>
|
63 |
+
</config>
|
app/design/adminhtml/default/default/template/digitalpianism/customreports/advancedgrid.phtml
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
<table cellspacing="0">
|
1 |
<tr>
|
2 |
<td><h3 class="icon-head head-online-visitors"><?php echo $this->getTitle() ?></h3></td>
|
3 |
</tr>
|
4 |
</table>
|
1 |
+
<div class="content-header">
|
2 |
<table cellspacing="0">
|
3 |
<tr>
|
4 |
<td><h3 class="icon-head head-online-visitors"><?php echo $this->getTitle() ?></h3></td>
|
5 |
</tr>
|
6 |
</table>
|
app/design/adminhtml/default/default/template/digitalpianism/customreports/grid.phtml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="content-header">
|
2 |
+
<table cellspacing="0">
|
3 |
+
<tr>
|
4 |
+
<td><h3 class="icon-head head-online-visitors"><?php echo $this->getTitle(); ?></h3></td>
|
5 |
+
</tr>
|
6 |
+
</table>
|
7 |
+
</div>
|
8 |
+
<?php if ($nb = $this->getSideNote()): ?>
|
9 |
+
<div class="nb">
|
10 |
+
<p><?php echo $nb; ?></p>
|
11 |
+
</div>
|
12 |
+
<?php endif; ?>
|
13 |
+
<?php echo $this->getChildHtml('grid') ?>
|
app/etc/modules/DigitalPianism_CustomReports.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<DigitalPianism_CustomReports>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</DigitalPianism_CustomReports>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/locale/en_US/DigitalPianism_CustomReports.csv
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Bestsellers,Bestsellers
|
2 |
+
Worstsellers,Worstsellers
|
3 |
+
No Upsells,No Upsells
|
4 |
+
Lifetime Sales,Lifetime Sales
|
5 |
+
Shopped Once And Never Again,Shopped Once And Never Again
|
6 |
+
Signed Up And Never Order,Signed Up And Never Order
|
7 |
+
Wishlist,Wishlist
|
8 |
+
Category Name,Category Name
|
9 |
+
Ordered Quantity,Ordered Quantity
|
10 |
+
Ordered Total,Ordered Total
|
11 |
+
Sale Date,Sale Date
|
12 |
+
Subscription Date,Subscription Date
|
13 |
+
Has Been Shared ?,Has Been Shared ?
|
14 |
+
Ordered Quantity,Ordered Quantity
|
15 |
+
Views,Views
|
16 |
+
Custom Bestsellers By Category Report,Custom Bestsellers By Category Report
|
17 |
+
Custom Lifetimesales Report,Custom Lifetimesales Report
|
18 |
+
Custom No Upsells Report,Custom No Upsells Report
|
19 |
+
Custom Shopped Once And Never Again Report,Custom Shopped Once And Never Again Report
|
20 |
+
Custom Signed Up But Never Shopped Report,Custom Signed Up But Never Shopped Report
|
21 |
+
Custom Wishlist Report,Custom Wishlist Report
|
22 |
+
Custom Worstsellers By Category Report,Custom Worstsellers By Category Report
|
23 |
+
Custom Worstsellers Report,Custom Worstsellers Report
|
24 |
+
The default date range is set to 30 days.,The default date range is set to 30 days.
|
25 |
+
Attention: please note that these data may not be totally accurate due to the following reasons:,Attention: please note that these data may not be totally accurate due to the following reasons:
|
26 |
+
- A product can be moved to a different category after an order has been placed.,- A product can be moved to a different category after an order has been placed.
|
27 |
+
- A category can be deleted,- A category can be deleted
|
28 |
+
- A product can be in more than one category,- A product can be in more than one category
|
29 |
+
"For these reasons, if a product is in several categories, it will be counted as a sale for all of these categories.","For these reasons, if a product is in several categories, it will be counted as a sale for all of these categories."
|
30 |
+
Set Dates,Set Dates
|
31 |
+
Custom Products With No Upsells Report,Custom Products With No Upsells Report
|
32 |
+
"N.B.: the grid displays only configurable products. You can use the visibility and status filter to only get the products which are available on the store.","N.B.: the grid displays only configurable products. You can use the visibility and status filter to only get the products which are available on the store."
|
package.xml
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>DigitalPianism_CustomReports</name>
|
4 |
+
<version>0.0.12</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>Adds several custom reports to Magento.</summary>
|
10 |
+
<description><h2>Overview</h2>
|
11 |
+

|
12 |
+
This module includes the following reports to Magento:
|
13 |
+
<ul>
|
14 |
+
<li>Worstsellers: list the worstsellers products (viewed the most, purchased the least)</li>
|
15 |
+
<li>Bestsellers categories: list the categories which sold the most</li>
|
16 |
+
<li>Worstsellers categories: list the categories which have been viewed the most but sold the least.</li>
|
17 |
+
<li>Lifetime sales: list of the customers who purchased the most over the time.</li>
|
18 |
+
<li>No Upsells: list the products with no upsells</li>
|
19 |
+
<li>Shopped Once: list the customers who shopped once and only once</li>
|
20 |
+
<li>Signed Up No Order: list the people who subscribed to the newsletter but never ordered</li>
|
21 |
+
<li>Wishlist: list the wishlists that have been created</li>
|
22 |
+
</ul>
|
23 |
+

|
24 |
+
<p>With this extension, you can improve your marketing and your shop management by looking at data which are not provided with the default Magento installation.</p>
|
25 |
+

|
26 |
+
<h2>Access the reports</h2>
|
27 |
+

|
28 |
+
<ul>
|
29 |
+
<li>Worstsellers: under Reports > Products > Worstsellers</li>
|
30 |
+
<li>Bestsellers categories: under Reports > Categories > Bestsellers</li>
|
31 |
+
<li>Worstsellers categories: under Reports > Categories > Worstsellers</li>
|
32 |
+
<li>Lifetime sales: under Reports > Customers > Lifetime Sales</li>
|
33 |
+
<li>No Upsells: under Reports > Products > No Upsells</li>
|
34 |
+
<li>Shopped Once: under Reports > Customers > Shopped Once And Never Again</li>
|
35 |
+
<li>Signed Up No Order: under Reports > Customers > Signed Up And Never Order</li>
|
36 |
+
<li>Wishlist: under Reports > Wishlist</li>
|
37 |
+
</ul>
|
38 |
+

|
39 |
+
<h2>Nota Bene regarding the category reports</h2>
|
40 |
+

|
41 |
+
<p>Please note that the data displayed by these reports may not be totally accurate for the following reasons:</p>
|
42 |
+
<ul>
|
43 |
+
<li>A product can be moved to a different category after an order has been placed.</li>
|
44 |
+
<li>A category can be deleted.</li>
|
45 |
+
<li>A product can be in more than one category.</li>
|
46 |
+
</ul>
|
47 |
+

|
48 |
+
<p>Thus, if a product is in several categories, it will be counted as a sale for all of these categories.</p>
|
49 |
+
</p></description>
|
50 |
+
<notes>Includes the following reports: 
|
51 |
+

|
52 |
+
- Worstsellers
|
53 |
+
- Bestsellers Categories
|
54 |
+
- Worstsellers Categories
|
55 |
+
- Signed Up Never Order
|
56 |
+
- Shopped Once And Never Again
|
57 |
+
- Lifetime Sales
|
58 |
+
- Wishlist
|
59 |
+
- Products With No Upsells
|
60 |
+
</notes>
|
61 |
+
<authors><author><name>Digital Pianism</name><user>digitalpianism</user><email>contact@digital-pianism.com</email></author></authors>
|
62 |
+
<date>2014-08-08</date>
|
63 |
+
<time>10:34:20</time>
|
64 |
+
<contents><target name="magecommunity"><dir name="DigitalPianism"><dir name="CustomReports"><dir name="Block"><dir name="Bestsellersbycategory"><file name="Grid.php" hash="525a1ae5e21decffd3fcb899362be083"/></dir><file name="Bestsellersbycategory.php" hash="60483ad3e57dc461f5943c805d149c01"/><file name="Customreport.php" hash="e6bbb8a7baf7acc47f39b02e64ccbc94"/><dir name="Lifetimesales"><file name="Grid.php" hash="b36706d8594b934d1d13b236537b39cd"/></dir><file name="Lifetimesales.php" hash="94d685421ecb611a871d99c1c593ac46"/><dir name="Noupsells"><file name="Grid.php" hash="5e43d95bcb21bbdfae240c8db4dd26b3"/></dir><file name="Noupsells.php" hash="19cccc31220589cc6c7964373d6612d9"/><dir name="Shoppedonce"><file name="Grid.php" hash="28401d7c968100aec911545a8074dd70"/></dir><file name="Shoppedonce.php" hash="bc3b20a05d2859a710850cde353599d5"/><dir name="Signedupnoorder"><file name="Grid.php" hash="1d4b1aa83d3aaa560f59043f8e0b09c1"/></dir><file name="Signedupnoorder.php" hash="30d952fcc1fa6e913c98134f195342eb"/><dir name="Wishlist"><file name="Grid.php" hash="94cd0ac0dd2b46e759510ba6f120c93e"/></dir><file name="Wishlist.php" hash="ee711134bdecd35b26fd9ae0f933195a"/><dir name="Worstsellers"><file name="Grid.php" hash="90f13fa28b33da82da46c3bb3b63f300"/></dir><file name="Worstsellers.php" hash="f31350020ae1d4207a49270a226a6df4"/><dir name="Worstsellersbycategory"><file name="Grid.php" hash="3c0a3bc72f687a56046436d121ce7d5e"/></dir><file name="Worstsellersbycategory.php" hash="4b94e31f8297c38904a073240b7af85e"/></dir><dir name="Model"><dir name="Reports"><dir name="Resource"><dir name="Product"><file name="Collection.php" hash="0c08ef3656ba7948aad06b9dfe2df704"/></dir></dir></dir></dir><dir name="controllers"><file name="BestsellersbycategoryController.php" hash="bcb8ba02dbfbb37880830c24c88c4791"/><file name="LifetimesalesController.php" hash="36c23ba7464e5b23d7803babdc092097"/><file name="NoupsellsController.php" hash="ccdf273757694494daec860361c0ec52"/><file name="ShoppedonceController.php" hash="0c599676dbb5722feb9bc437cfb985f1"/><file name="SignedupnoorderController.php" hash="0d996537ef4affe736b1aa3437152bc6"/><file name="WishlistController.php" hash="1ee8c24d7ce1ffc28493aedba17505a5"/><file name="WorstsellersController.php" hash="20e935b7f822abd346f76e6a934234da"/><file name="WorstsellersbycategoryController.php" hash="bc37e6b7a41c4ed918018ecdf2042259"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2233874893d9dcc82540d61aa0668328"/><file name="config.xml" hash="58c60ef0738249cbe9c9ce19f19c4288"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DigitalPianism_CustomReports.xml" hash="2244af82c076ed3abf5064672036ef0b"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="digitalpianism"><dir name="customreports"><file name="advancedgrid.phtml" hash="21e1ea8ed294994613c8db99cda35515"/><file name="grid.phtml" hash="a8d2cbad8327390e2b9cd3b7717c384d"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="DigitalPianism_CustomReports.csv" hash="0fcee0228d1044be8c0b76f02079bf55"/></dir></target></contents>
|
65 |
+
<compatible/>
|
66 |
+
<dependencies><required><php><min>4.1.0</min><max>6.0.0</max></php></required></dependencies>
|
67 |
+
</package>
|