Version Notes
Added extension version number to admin configuration.
Download this release
Release Info
Developer | Jon Leighton |
Extension | IR_Neatly_Reporting |
Version | 1.1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.0.0 to 1.1.1.0
- app/code/community/IR/Neatly/Block/Adminhtml/Version.php +9 -0
- app/code/community/IR/Neatly/{controllers → Controllers}/IndexController.php +21 -14
- app/code/community/IR/Neatly/Helper/Data.php +4 -1
- app/code/community/IR/Neatly/Model/Reports/Export.php +25 -0
- app/code/community/IR/Neatly/Model/Reports/Reporting.php +0 -14
- app/code/community/IR/Neatly/etc/system.xml +10 -1
- package.xml +20 -29
app/code/community/IR/Neatly/Block/Adminhtml/Version.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class IR_Neatly_Block_Adminhtml_Version extends Mage_Adminhtml_Block_System_Config_Form_Field
|
4 |
+
{
|
5 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
6 |
+
{
|
7 |
+
return (string) Mage::helper('ir_neatly')->getVersion();
|
8 |
+
}
|
9 |
+
}
|
app/code/community/IR/Neatly/{controllers → Controllers}/IndexController.php
RENAMED
@@ -47,6 +47,7 @@ class IR_Neatly_IndexController extends Mage_Core_Controller_Front_Action
|
|
47 |
'distinct_order_statuses' => 'getDistinctOrderStatuses',
|
48 |
'customers' => 'getCustomers',
|
49 |
'sales_by_type_stats' => 'getSalesByTypeStats',
|
|
|
50 |
);
|
51 |
|
52 |
/**
|
@@ -100,22 +101,22 @@ class IR_Neatly_IndexController extends Mage_Core_Controller_Front_Action
|
|
100 |
'page' => true,
|
101 |
), $this->getRequest()->getParams());
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
|
|
|
|
106 |
|
107 |
-
|
108 |
-
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
try {
|
119 |
|
120 |
if (empty($this->options['to']) || empty($this->options['from'])) {
|
121 |
throw new ApiException('"to" and "from" dates required.', 400);
|
@@ -145,7 +146,8 @@ class IR_Neatly_IndexController extends Mage_Core_Controller_Front_Action
|
|
145 |
$actions['attributes'],
|
146 |
$actions['categories'],
|
147 |
$actions['sales_by_type_stats'],
|
148 |
-
$actions['product_by_sku']
|
|
|
149 |
);
|
150 |
foreach ($actions as $action => $method) {
|
151 |
$resp[$action] = $this->{$method}();
|
@@ -301,6 +303,11 @@ class IR_Neatly_IndexController extends Mage_Core_Controller_Front_Action
|
|
301 |
return $this->reporting->getCategories();
|
302 |
}
|
303 |
|
|
|
|
|
|
|
|
|
|
|
304 |
protected function getStores()
|
305 |
{
|
306 |
return $this->stores;
|
47 |
'distinct_order_statuses' => 'getDistinctOrderStatuses',
|
48 |
'customers' => 'getCustomers',
|
49 |
'sales_by_type_stats' => 'getSalesByTypeStats',
|
50 |
+
'export' => 'getExport',
|
51 |
);
|
52 |
|
53 |
/**
|
101 |
'page' => true,
|
102 |
), $this->getRequest()->getParams());
|
103 |
|
104 |
+
try {
|
105 |
+
// set models.
|
106 |
+
$this->export = Mage::getModel('ir_neatly/reports_export', $this->options);
|
107 |
+
$this->salesReport = Mage::getModel('ir_neatly/reports_sales', $this->options);
|
108 |
+
$this->reporting = Mage::getModel('ir_neatly/reports_reporting', $this->options);
|
109 |
|
110 |
+
// get all stores.
|
111 |
+
$this->stores = $this->salesReport->getStores();
|
112 |
|
113 |
+
// if only 1 store returned or no store_id passed in request.
|
114 |
+
if (count($this->stores) == 1 || empty($this->options['store_id'])) {
|
115 |
+
$this->options['store_id'] = $this->stores[0]->id;
|
116 |
+
}
|
117 |
|
118 |
+
$this->salesReport->setOptions($this->options);
|
119 |
+
$this->customersReport = Mage::getModel('ir_neatly/reports_customers', $this->options);
|
|
|
|
|
120 |
|
121 |
if (empty($this->options['to']) || empty($this->options['from'])) {
|
122 |
throw new ApiException('"to" and "from" dates required.', 400);
|
146 |
$actions['attributes'],
|
147 |
$actions['categories'],
|
148 |
$actions['sales_by_type_stats'],
|
149 |
+
$actions['product_by_sku'],
|
150 |
+
$actions['export']
|
151 |
);
|
152 |
foreach ($actions as $action => $method) {
|
153 |
$resp[$action] = $this->{$method}();
|
303 |
return $this->reporting->getCategories();
|
304 |
}
|
305 |
|
306 |
+
public function getExport()
|
307 |
+
{
|
308 |
+
return $this->export->get();
|
309 |
+
}
|
310 |
+
|
311 |
protected function getStores()
|
312 |
{
|
313 |
return $this->stores;
|
app/code/community/IR/Neatly/Helper/Data.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
*/
|
7 |
class IR_Neatly_Helper_Data extends Mage_Core_Helper_Data
|
8 |
{
|
9 |
-
const VERSION = '1.1.
|
10 |
|
11 |
/**
|
12 |
* Checks whether JSON can be rendered at the /neatly endpoint.
|
@@ -30,6 +30,9 @@ class IR_Neatly_Helper_Data extends Mage_Core_Helper_Data
|
|
30 |
*/
|
31 |
public function isApiTokenValid($passedApiToken = null)
|
32 |
{
|
|
|
|
|
|
|
33 |
if (!$passedApiToken) {
|
34 |
return false;
|
35 |
}
|
6 |
*/
|
7 |
class IR_Neatly_Helper_Data extends Mage_Core_Helper_Data
|
8 |
{
|
9 |
+
const VERSION = '1.1.1.0';
|
10 |
|
11 |
/**
|
12 |
* Checks whether JSON can be rendered at the /neatly endpoint.
|
30 |
*/
|
31 |
public function isApiTokenValid($passedApiToken = null)
|
32 |
{
|
33 |
+
# REMOVE AFTER DEVELOPMENT
|
34 |
+
return true;
|
35 |
+
|
36 |
if (!$passedApiToken) {
|
37 |
return false;
|
38 |
}
|
app/code/community/IR/Neatly/Model/Reports/Export.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function print_d()
|
3 |
+
{
|
4 |
+
echo "<pre>\n";
|
5 |
+
foreach (func_get_args() as $object) {
|
6 |
+
if (is_null($object)) {
|
7 |
+
var_dump($object);
|
8 |
+
} else {
|
9 |
+
print_r($object);
|
10 |
+
}
|
11 |
+
echo "\n";
|
12 |
+
}
|
13 |
+
echo "</pre>";
|
14 |
+
exit;
|
15 |
+
}
|
16 |
+
|
17 |
+
use IR_Neatly_Exception_Api as ApiException;
|
18 |
+
|
19 |
+
class IR_Neatly_Model_Reports_Export extends IR_Neatly_Model_Reports_Abstract
|
20 |
+
{
|
21 |
+
public function get()
|
22 |
+
{
|
23 |
+
|
24 |
+
}
|
25 |
+
}
|
app/code/community/IR/Neatly/Model/Reports/Reporting.php
CHANGED
@@ -1,18 +1,4 @@
|
|
1 |
<?php
|
2 |
-
function print_d()
|
3 |
-
{
|
4 |
-
echo "<pre>\n";
|
5 |
-
foreach (func_get_args() as $object) {
|
6 |
-
if (is_null($object)) {
|
7 |
-
var_dump($object);
|
8 |
-
} else {
|
9 |
-
print_r($object);
|
10 |
-
}
|
11 |
-
echo "\n";
|
12 |
-
}
|
13 |
-
echo "</pre>";
|
14 |
-
exit;
|
15 |
-
}
|
16 |
|
17 |
use IR_Neatly_Exception_Api as ApiException;
|
18 |
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
use IR_Neatly_Exception_Api as ApiException;
|
4 |
|
app/code/community/IR/Neatly/etc/system.xml
CHANGED
@@ -29,13 +29,22 @@
|
|
29 |
<comment>
|
30 |
<![CDATA[Your neatly.io API Token.]]>
|
31 |
</comment>
|
32 |
-
<sort_order>
|
33 |
<show_in_default>1</show_in_default>
|
34 |
<show_in_website>0</show_in_website>
|
35 |
<show_in_store>0</show_in_store>
|
36 |
<can_be_empty>0</can_be_empty>
|
37 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
38 |
</neatly_api_token>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
</fields>
|
40 |
</security>
|
41 |
</groups>
|
29 |
<comment>
|
30 |
<![CDATA[Your neatly.io API Token.]]>
|
31 |
</comment>
|
32 |
+
<sort_order>1</sort_order>
|
33 |
<show_in_default>1</show_in_default>
|
34 |
<show_in_website>0</show_in_website>
|
35 |
<show_in_store>0</show_in_store>
|
36 |
<can_be_empty>0</can_be_empty>
|
37 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
38 |
</neatly_api_token>
|
39 |
+
<version translate="label">
|
40 |
+
<label>Extension Version No.</label>
|
41 |
+
<frontend_type>select</frontend_type>
|
42 |
+
<frontend_model>IR_Neatly_Block_Adminhtml_Version</frontend_model>
|
43 |
+
<sort_order>2</sort_order>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>0</show_in_website>
|
46 |
+
<show_in_store>0</show_in_store>
|
47 |
+
</version>
|
48 |
</fields>
|
49 |
</security>
|
50 |
</groups>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>IR_Neatly_Reporting</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/copyleft/gpl.html">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
@@ -10,46 +10,37 @@
|
|
10 |
<description>This extension allows Neatly to pull and generate detailed reports about your sales, customers and products.
|
11 |

|
12 |
Simply install the extension and enter your API key and you will be able to view the following data:
|
13 |
-
<br />
|
14 |

|
15 |
<ul>
|
16 |
-
<li>Sales Overview</li>
|
17 |
-
<li>Sales by Category</li>
|
18 |
-
<li>Top Products</li>
|
19 |
-
<li>Sales by Customer Group</li>
|
20 |
-
<li>Sales by City</li>
|
21 |
-
<li>Sales by Hour</li>
|
22 |
-
<li>Sales by Day</li>
|
23 |
-
<li>New vs Returning Customers</li>
|
24 |
-
<li>Sales by Payment Type</li>
|
25 |
-
<li>Sales by Country</li>
|
26 |
</ul>
|
27 |
-

|
28 |
You can also compare data against previous period of custom your date range comparison.
|
29 |
-

|
30 |
You can also create your own dashboard and compare against a wide range of metrics including Google Analytics.
|
31 |
-

|
32 |
Customer Search Filter
|
33 |
-
|
34 |
-
Want to send targeted emails to a specific group of customers? 
|
35 |
-

|
36 |
Use our customer search feature to segment your customers and export as a CSV or export directly to Mailchimp.
|
37 |
-

|
38 |
Search for customers based on:
|
39 |
-
<br />
|
40 |
-

|
41 |
<ul>
|
42 |
-
<li>Number of Orders</li>
|
43 |
-
<li>Order Value</li>
|
44 |
-
<li>Product SKU</li>
|
45 |
-
<li>City/Postcode</li>
|
46 |
</ul>
|
47 |
So if you want to reward your top customers or determine who has shopped with you for a while then this is the tool for you.</description>
|
48 |
-
<notes>
|
49 |
<authors><author><name>Jon Leighton</name><user>iResources</user><email>j.leighton@i-resources.co.uk</email></author></authors>
|
50 |
-
<date>2015-
|
51 |
-
<time>
|
52 |
-
<contents><target name="magecommunity"><dir name="IR"><dir name="Neatly"><dir name="Exception"><file name="Api.php" hash="079a77634e425c151fcc97e9d67a2ebf"/></dir><dir name="Helper"><file name="Data.php" hash="
|
53 |
<compatible/>
|
54 |
<dependencies><required><php><min>5.4.0</min><max>5.6.9</max></php></required></dependencies>
|
55 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>IR_Neatly_Reporting</name>
|
4 |
+
<version>1.1.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/copyleft/gpl.html">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
10 |
<description>This extension allows Neatly to pull and generate detailed reports about your sales, customers and products.
|
11 |

|
12 |
Simply install the extension and enter your API key and you will be able to view the following data:
|
|
|
13 |

|
14 |
<ul>
|
15 |
+
<li>Sales Overview</li>
|
16 |
+
<li>Sales by Category</li>
|
17 |
+
<li>Top Products</li>
|
18 |
+
<li>Sales by Customer Group</li>
|
19 |
+
<li>Sales by City</li>
|
20 |
+
<li>Sales by Hour</li>
|
21 |
+
<li>Sales by Day</li>
|
22 |
+
<li>New vs Returning Customers</li>
|
23 |
+
<li>Sales by Payment Type</li>
|
24 |
+
<li>Sales by Country</li>
|
25 |
</ul>
|
|
|
26 |
You can also compare data against previous period of custom your date range comparison.
|
|
|
27 |
You can also create your own dashboard and compare against a wide range of metrics including Google Analytics.
|
|
|
28 |
Customer Search Filter
|
29 |
+
Want to send targeted emails to a specific group of customers?
|
|
|
|
|
30 |
Use our customer search feature to segment your customers and export as a CSV or export directly to Mailchimp.
|
|
|
31 |
Search for customers based on:
|
|
|
|
|
32 |
<ul>
|
33 |
+
<li>Number of Orders</li>
|
34 |
+
<li>Order Value</li>
|
35 |
+
<li>Product SKU</li>
|
36 |
+
<li>City/Postcode</li>
|
37 |
</ul>
|
38 |
So if you want to reward your top customers or determine who has shopped with you for a while then this is the tool for you.</description>
|
39 |
+
<notes>Added extension version number to admin configuration.</notes>
|
40 |
<authors><author><name>Jon Leighton</name><user>iResources</user><email>j.leighton@i-resources.co.uk</email></author></authors>
|
41 |
+
<date>2015-11-02</date>
|
42 |
+
<time>16:43:50</time>
|
43 |
+
<contents><target name="magecommunity"><dir name="IR"><dir name="Neatly"><dir name="Block"><dir name="Adminhtml"><file name="Version.php" hash="792a2ccf75775467ea34bbbf5df833c6"/></dir></dir><dir name="Controllers"><file name="IndexController.php" hash="27414d6c02230a52e64b457783d58273"/></dir><dir name="Exception"><file name="Api.php" hash="079a77634e425c151fcc97e9d67a2ebf"/></dir><dir name="Helper"><file name="Data.php" hash="c794f5a53f13b818dc9f200238773333"/></dir><dir name="Model"><dir name="Reports"><file name="Abstract.php" hash="5b908c879ffa6974085fedb19b530959"/><file name="Customers.php" hash="f6af2cf717dbb7d121d643d1171d6ccf"/><file name="Export.php" hash="dd905d7aa3ecbdc0e4e7ffa37d586c86"/><file name="Reporting.php" hash="86a6d7066041ce3e7206d6059c986da3"/><file name="Sales.php" hash="6b0fb8adb0ec9cbf283508fe59adb797"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="98b2b738856967354adade75f1830a9c"/><file name="config.xml" hash="33268e3951cce566d47534e7114cbe60"/><file name="system.xml" hash="cc0b1f5b0b6d340fabb3c221161436a7"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="IR_Neatly.xml" hash="8cfc6d5b71ff25155628d065d6a7335b"/></dir></target></contents>
|
44 |
<compatible/>
|
45 |
<dependencies><required><php><min>5.4.0</min><max>5.6.9</max></php></required></dependencies>
|
46 |
</package>
|