Glew - Version 1.0.0

Version Notes

Initial release.

Download this release

Release Info

Developer Glew
Extension Glew
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (39) hide show
  1. app/code/community/Glew/Service/Block/Adminhtml/Widget/Info/Info.php +25 -0
  2. app/code/community/Glew/Service/Block/SecretKey.php +19 -0
  3. app/code/community/Glew/Service/Helper/Data.php +101 -0
  4. app/code/community/Glew/Service/Model/Glew.php +32 -0
  5. app/code/community/Glew/Service/Model/Resource/Mysql4/Setup.php +25 -0
  6. app/code/community/Glew/Service/Model/Types/AbandonedCart.php +41 -0
  7. app/code/community/Glew/Service/Model/Types/AbandonedCarts.php +47 -0
  8. app/code/community/Glew/Service/Model/Types/Address.php +45 -0
  9. app/code/community/Glew/Service/Model/Types/Categories.php +38 -0
  10. app/code/community/Glew/Service/Model/Types/Category.php +27 -0
  11. app/code/community/Glew/Service/Model/Types/Customer.php +42 -0
  12. app/code/community/Glew/Service/Model/Types/Customers.php +42 -0
  13. app/code/community/Glew/Service/Model/Types/Extension.php +14 -0
  14. app/code/community/Glew/Service/Model/Types/Extensions.php +26 -0
  15. app/code/community/Glew/Service/Model/Types/Inventory.php +30 -0
  16. app/code/community/Glew/Service/Model/Types/InventoryItem.php +14 -0
  17. app/code/community/Glew/Service/Model/Types/Order.php +36 -0
  18. app/code/community/Glew/Service/Model/Types/OrderItem.php +85 -0
  19. app/code/community/Glew/Service/Model/Types/OrderItems.php +47 -0
  20. app/code/community/Glew/Service/Model/Types/Orders.php +41 -0
  21. app/code/community/Glew/Service/Model/Types/Product.php +49 -0
  22. app/code/community/Glew/Service/Model/Types/ProductAlert.php +15 -0
  23. app/code/community/Glew/Service/Model/Types/ProductAlerts.php +36 -0
  24. app/code/community/Glew/Service/Model/Types/Products.php +93 -0
  25. app/code/community/Glew/Service/Model/Types/Refund.php +16 -0
  26. app/code/community/Glew/Service/Model/Types/RefundItem.php +21 -0
  27. app/code/community/Glew/Service/Model/Types/RefundItems.php +39 -0
  28. app/code/community/Glew/Service/Model/Types/Refunds.php +38 -0
  29. app/code/community/Glew/Service/Model/Types/Store.php +13 -0
  30. app/code/community/Glew/Service/Model/Types/Stores.php +23 -0
  31. app/code/community/Glew/Service/Model/Types/Subscriber.php +13 -0
  32. app/code/community/Glew/Service/Model/Types/Subscribers.php +31 -0
  33. app/code/community/Glew/Service/controllers/ModuleController.php +227 -0
  34. app/code/community/Glew/Service/etc/adminhtml.xml +20 -0
  35. app/code/community/Glew/Service/etc/config.xml +135 -0
  36. app/code/community/Glew/Service/etc/system.xml +63 -0
  37. app/code/community/Glew/Service/sql/glew_setup/mysql4-install-0.0.2.php +7 -0
  38. app/etc/modules/Glew_Service.xml +9 -0
  39. package.xml +18 -0
app/code/community/Glew/Service/Block/Adminhtml/Widget/Info/Info.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Block_Adminhtml_Widget_Info_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
4
+
5
+ public function render(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ $html = '<div style="background:url(\'http://glew.io/wp-content/uploads/2015/04/Glew-white_Artboard7.png\') no-repeat scroll 15px center #EAF0EE;background-size:160px;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 200px;">
8
+ <h4>About Glew.&trade;</h4>
9
+ <p>Glew.&trade; Empowers Marketers to Take Action, Increase Team Efficiency and Maximize Revenue.<br>
10
+ <br />
11
+ <table width="500px" border="0">
12
+ <tr>
13
+ <td>Questions, comments, need help? Send us an email.</td>
14
+ <td><a href="mailto:support@glew.io">support@glew.io</a></td>
15
+ </tr>
16
+ <tr>
17
+ <td height="30">Visit our website:</td>
18
+ <td><a href="http://glew.io" target="_blank">glew.io</a></td>
19
+ </tr>
20
+ </table>
21
+ </div>';
22
+
23
+ return $html;
24
+ }
25
+ }
app/code/community/Glew/Service/Block/SecretKey.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Block_SecretKey extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ $this->setElement($element);
8
+ $helper = Mage::helper('glew');
9
+ $config = $helper->getConfig();
10
+ $glew = Mage::getModel('glew/glew');
11
+ if(!$config['security_token']) {
12
+ $token = $glew->createSecurityToken();
13
+ } else {
14
+ $token = $config['security_token'];
15
+ }
16
+
17
+ return trim($token);
18
+ }
19
+ }
app/code/community/Glew/Service/Helper/Data.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ private static $connRead;
6
+ private static $connWrite;
7
+ private static $console;
8
+ private static $filename = "glew.log";
9
+ private static $debug = true;
10
+ private $_config;
11
+
12
+ public function getBaseDir()
13
+ {
14
+ return Mage::getBaseDir() . '/app/code/community/Glew/';
15
+ }
16
+
17
+ public function getLogDir()
18
+ {
19
+ return Mage::getBaseDir('log');
20
+ }
21
+
22
+ public function getDatabaseConnection()
23
+ {
24
+ return Mage::getSingleton('core/resource')->getConnection('glew_write');
25
+ }
26
+
27
+ public function getDatabaseReadConnection()
28
+ {
29
+ return Mage::getSingleton('core/resource')->getConnection('glew_read');
30
+ }
31
+
32
+ public function getConfig()
33
+ {
34
+ $config = array();
35
+ $config['enabled'] = Mage::getStoreConfig('glew_settings/general/enabled');
36
+ $config['security_token'] = Mage::getStoreConfig('glew_settings/general/security_token');
37
+
38
+ $this->_config = $config;
39
+ return $config;
40
+ }
41
+
42
+ public function formatDate($str)
43
+ {
44
+ if ($str) {
45
+ if (stripos($str, ' ')) {
46
+ $str = substr($str, 0, stripos($str, ' '));
47
+ }
48
+ }
49
+ return $str;
50
+ }
51
+
52
+ public function toArray($value, $create = false)
53
+ {
54
+ if ($value !== false) {
55
+ return is_array($value) ? $value : array($value);
56
+ } else {
57
+ return $create ? array() : $value;
58
+ }
59
+ }
60
+
61
+ public function logException($ex, $msg)
62
+ {
63
+ if ($this->_logging()) {
64
+ $msg = "an exception has occurred during $msg: " . $ex->getMessage();
65
+ $this->_write($msg);
66
+ }
67
+ return false;
68
+ }
69
+
70
+ private function _logging($verbose = false)
71
+ {
72
+ return true;
73
+ }
74
+
75
+ private function _write($msg)
76
+ {
77
+ if (!self::$console) {
78
+ date_default_timezone_set('UTC');
79
+ $uri = $this->getLogDir() . self::$filename;
80
+ self::$console = fopen($uri, "a");
81
+ }
82
+
83
+ if (self::$console) {
84
+ $stats = fstat(self::$console);
85
+ if ($stats) {
86
+ $size = $stats['size'] / (1024*1000);
87
+ if ($size > 10) {
88
+ @fclose(self::$console);
89
+ self::$console = @fopen($uri, "w");
90
+ }
91
+ }
92
+ }
93
+
94
+ if (self::$console) {
95
+ $msg = strftime("%Y-%m-%d %H:%M:%S ") . " " . $msg;
96
+
97
+ fwrite(self::$console, print_r($msg, true)."\n");
98
+ fflush(self::$console);
99
+ }
100
+ }
101
+ }
app/code/community/Glew/Service/Model/Glew.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Glew
4
+ {
5
+
6
+ private $_helper;
7
+ private $_config;
8
+
9
+ public function __construct()
10
+ {
11
+ $this->_helper = Mage::helper('glew');
12
+ $this->_config = $this->_helper->getConfig();
13
+ }
14
+
15
+ public function createSecurityToken()
16
+ {
17
+ if (!$this->_isGenerated()) {
18
+ $setup = Mage::getModel('glew/resource_mysql4_setup');
19
+ $token = $setup->createSecurityToken($this->_helper->getDatabaseReadConnection());
20
+ return $token;
21
+ } else {
22
+ return $this->_config['security_token'];
23
+ }
24
+ }
25
+
26
+ private function _isGenerated()
27
+ {
28
+ $securityToken = $this->_config['security_token'];
29
+ return !empty($securityToken);
30
+ }
31
+
32
+ }
app/code/community/Glew/Service/Model/Resource/Mysql4/Setup.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Resource_Mysql4_Setup extends Mage_Core_Model_Resource_Setup
4
+ {
5
+
6
+ public function createSecurityToken()
7
+ {
8
+ $hostname = version_compare(phpversion(),'5.3','>=') ? gethostname() : php_uname('n');
9
+ $prefix = md5($hostname);
10
+ $token = sha1(uniqid($prefix, true) . rand().microtime());
11
+ $this->_saveSecurityToken($token);
12
+ return $token;
13
+ }
14
+
15
+ private function _getSecurityToken()
16
+ {
17
+ return Mage::getStoreConfig('glew_settings/general/security_token');
18
+ }
19
+
20
+ private function _saveSecurityToken($token)
21
+ {
22
+ Mage::app()->getStore()->setConfig('glew_settings/general/security_token', $token);
23
+ Mage::getModel('core/config')->saveConfig('glew_settings/general/security_token', $token);
24
+ }
25
+ }
app/code/community/Glew/Service/Model/Types/AbandonedCart.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_AbandonedCart
4
+ {
5
+ public function parse($cart)
6
+ {
7
+
8
+ $products = array();
9
+
10
+ foreach($cart->getAllItems() as $item) {
11
+ $obj = new stdClass();
12
+ $obj->product_id = $item->getProduct()->getId();
13
+ $obj->qty = $item->getQty();
14
+ $products[] = $obj;
15
+ }
16
+
17
+ $this->id = $cart->getId();
18
+ $this->email = $cart->getCustomerEmail();
19
+ $this->customer_id = $cart->getCustomerId() ? $cart->getCustomerId() : 0;
20
+ $this->customer_group_id = $cart->getCustomerGroupId() ? $cart->getCustomerGroupId() : null;
21
+ $customerGroup = Mage::getModel('customer/group')->load( $cart->getCustomerGroupId() );
22
+ $this->customer_group = $customerGroup->getCode();
23
+ $this->created_at = $cart->getCreatedAt();
24
+ $this->updated_at = $cart->getUpdatedAt();
25
+ $this->items_count = $cart->getItemsCount();
26
+ $this->items_qty = $cart->getItemsQty();
27
+ $this->products = $products;
28
+ $this->total = round($cart->getSubtotal(), 2);
29
+
30
+ $this->discount_amount = round($cart->getDiscountAmount(), 2);
31
+ $this->discount_description = $cart->getDiscountDescription();
32
+ $this->coupon_code = $cart->getCouponCode();
33
+ $this->weight = $cart->getWeight();
34
+ $this->remote_ip = $cart->getRemoteIp();
35
+ $this->store = $cart->getStore()->getCode();
36
+ $this->currency = $cart->getQuoteCurrencyCode();
37
+
38
+ return $this;
39
+ }
40
+
41
+ }
app/code/community/Glew/Service/Model/Types/AbandonedCarts.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_AbandonedCarts
4
+ {
5
+ public $carts;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $startDate = null, $endDate = null, $sortDir)
9
+ {
10
+ $helper = Mage::helper('glew');
11
+ $config = $helper->getConfig();
12
+ if($startDate && $endDate) {
13
+ $filter = array(
14
+ 'datetime' => 1,
15
+ 'locale' => 'en_US',
16
+ 'from' => new Zend_Date(strtotime($startDate), Zend_Date::TIMESTAMP),
17
+ 'to' => new Zend_Date(strtotime($endDate), Zend_Date::TIMESTAMP),
18
+ );
19
+
20
+ $collection = Mage::getResourceModel('reports/quote_collection')
21
+ ->addFieldToFilter('main_table.updated_at', $filter);
22
+ } else {
23
+ $collection = Mage::getResourceModel('reports/quote_collection');
24
+ }
25
+ $collection->prepareForAbandonedReport();
26
+ $collection->setOrder('created_at', $sortDir);
27
+ $collection->setCurPage($pageNum);
28
+ $collection->setPageSize($pageSize);
29
+ $this->pageNum = $pageNum;
30
+
31
+ if($collection->getLastPageNumber() < $pageNum){
32
+ return $this;
33
+ }
34
+
35
+ foreach($collection as $cart) {
36
+ if ($cart) {
37
+ $model = Mage::getModel('glew/types_abandonedCart')->parse($cart);
38
+ if ($model) {
39
+ $this->carts[] = $model;
40
+ }
41
+ }
42
+ }
43
+
44
+ return $this;
45
+ }
46
+
47
+ }
app/code/community/Glew/Service/Model/Types/Address.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Address
4
+ {
5
+ const BILLING_ADDRESS_TYPE = 1;
6
+ const SHIPPING_ADDRESS_TYPE = 2;
7
+ public $address_id;
8
+ public $address_type;
9
+ public $firstname;
10
+ public $lastname;
11
+ public $e_mail;
12
+ public $company;
13
+ public $street;
14
+ public $zip_code;
15
+ public $city;
16
+ public $state;
17
+ public $country_id;
18
+ public $telephone;
19
+ public $fax;
20
+
21
+ public function parse($address)
22
+ {
23
+ $this->address_id = $address['entity_id'];
24
+ $this->address_type = $address['address_type'] == self::BILLING_ADDRESS_TYPE ? 'billing' : 'shipping';
25
+ $this->firstname = $address['firstname'];
26
+ $this->lastname = $address['lastname'];
27
+ $this->e_mail = $address['email'];
28
+ if (isset($address['company'])) {
29
+ $this->company = $address['company'];
30
+ }
31
+ $this->street = Mage::helper('glew')->toArray($address['street']);
32
+ if ($this->street) {
33
+ $this->street = implode(', ', $this->street);
34
+ }
35
+ $this->zip_code = $address['postcode'];
36
+ $this->city = $address['city'];
37
+ $region = Mage::getModel('directory/region')->loadByName($address['region'], $address['country_id']);
38
+ $this->state = $region->getData('code');
39
+ $this->country_id = $address['country_id'];
40
+ $this->telephone = $address['telephone'];
41
+ $this->fax = $address['fax'];
42
+ return $this;
43
+ }
44
+
45
+ }
app/code/community/Glew/Service/Model/Types/Categories.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Categories
4
+ {
5
+ public $categories;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $startDate = null, $endDate = null, $sortDir)
9
+ {
10
+ $config = Mage::helper('glew')->getConfig();
11
+ if($startDate && $endDate) {
12
+ $from = date('Y-m-d 00:00:00', strtotime($startDate));
13
+ $to = date('Y-m-d 23:59:59', strtotime($endDate));
14
+
15
+ $categories = Mage::getModel('catalog/category')->getCollection()
16
+ ->addAttributeToFilter('updated_at', array('from'=>$from, 'to'=>$to));
17
+ } else {
18
+ $categories = Mage::getModel('catalog/category')->getCollection();
19
+ }
20
+ $this->pageNum = $pageNum;
21
+ $categories->setOrder('created_at', $sortDir);
22
+ $categories->setCurPage($pageNum);
23
+ $categories->setPageSize($pageSize);
24
+
25
+ if($categories->getLastPageNumber() < $pageNum){
26
+ return $this;
27
+ }
28
+
29
+ foreach ($categories as $category){
30
+ $model = Mage::getModel('glew/types_category')->parse($category);
31
+ if ($model) {
32
+ $this->categories[] = $model;
33
+ }
34
+ }
35
+ return $this;
36
+ }
37
+
38
+ }
app/code/community/Glew/Service/Model/Types/Category.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Category
4
+ {
5
+ public function parse($category)
6
+ {
7
+ $category = Mage::getModel('catalog/category')->load($category->getId());
8
+ $this->category_id = $category->getId();
9
+ $this->entity_id = $category->getData('entity_id');
10
+ $this->entity_type_id = $category->getData('entity_type_id');
11
+ $this->attribute_set_id = $category->getData('attribute_set_id');
12
+ $this->parent_id = $category->getData('parent_id');
13
+ $this->created_at = $category->getData('created_at');
14
+ $this->updated_at = $category->getData('updated_at');
15
+ $this->path = $category->getData('path');
16
+ $this->position = $category->getData('position');
17
+ $this->level = $category->getData('level');
18
+ $this->children_count = $category->getData('children_count');
19
+ $this->available_sort_by = $category->getData('available_sort_by');
20
+ $this->include_in_menu = $category->getData('include_in_menu');
21
+ $this->name = $category->getData('name');
22
+ $this->url_key = $category->getData('url_key');
23
+
24
+ return $this;
25
+ }
26
+
27
+ }
app/code/community/Glew/Service/Model/Types/Customer.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Customer
4
+ {
5
+ public function parse($customer)
6
+ {
7
+ if (!$customer) {
8
+ return $this;
9
+ }
10
+ $this->id = $customer->getId();
11
+ $this->e_mail = $customer->getData('email');
12
+ $groupId = $customer->getGroupId();
13
+ $customerGroup = Mage::getModel('customer/group')->load($groupId);
14
+ $this->group_id = $groupId;
15
+ $this->group = $customerGroup->getCode();
16
+ $this->created_at = $customer->getCreatedAt();
17
+ $this->updated_at = $customer->getUpdatedAt();
18
+ $this->name = $customer->getName();
19
+ $this->first_name = $customer->getFirstname();
20
+ $this->last_name = $customer->getLastname();
21
+ $this->gender = (!!$customer->getGender()) ? $customer->getGender() : "";
22
+ $this->dob = (!!$customer->getDob()) ? Mage::helper('glew')->formatDate($customer->getDob()) : "";
23
+ $this->store = (!!$customer->getStore()->getCode()) ? $customer->getStore()->getCode() : "";
24
+ $this->addresses = array();
25
+
26
+ if ($customer->getPrimaryShippingAddress()) {
27
+ $address = Mage::getModel('glew/types_address')->parse($customer->getPrimaryShippingAddress());
28
+ if ($address) {
29
+ $this->addresses[] = $address;
30
+ } else {
31
+ $address = Mage::getModel('glew/types_address')->parse($customer->getPrimaryBillingAddress());
32
+ $this->addresses[] = $address;
33
+ }
34
+ }else{
35
+ $address =Mage::getModel('glew/types_address');
36
+ $this->addresses[] = $address;
37
+ }
38
+
39
+ return $this;
40
+ }
41
+
42
+ }
app/code/community/Glew/Service/Model/Types/Customers.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Customers
4
+ {
5
+ public $customers;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $startDate = null, $endDate = null, $sortDir)
9
+ {
10
+ $helper = Mage::helper('glew');
11
+ $config = $helper->getConfig();
12
+ if($startDate && $endDate) {
13
+ $from = date('Y-m-d 00:00:00', strtotime($startDate));
14
+ $to = date('Y-m-d 23:59:59', strtotime($endDate));
15
+
16
+ $collection = Mage::getModel('customer/customer')->getCollection()
17
+ ->addAttributeToFilter('updated_at', array('from'=>$from, 'to'=>$to));
18
+ } else {
19
+ $collection = Mage::getModel('customer/customer')->getCollection();
20
+ }
21
+ $collection->setOrder('created_at', $sortDir);
22
+ $collection->setCurPage($pageNum);
23
+ $collection->setPageSize($pageSize);
24
+ $this->pageNum = $pageNum;
25
+
26
+ if($collection->getLastPageNumber() < $pageNum){
27
+ return $this;
28
+ }
29
+ foreach($collection as $customer) {
30
+ $customer = Mage::getModel('customer/customer')->load($customer->getId());
31
+ if ($customer && $customer->getId()) {
32
+ $model = Mage::getModel('glew/types_customer')->parse($customer);
33
+ if ($model) {
34
+ $this->customers[] = $model;
35
+ }
36
+ }
37
+ }
38
+
39
+ return $this;
40
+ }
41
+
42
+ }
app/code/community/Glew/Service/Model/Types/Extension.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Extension
4
+ {
5
+ public function parse($extension, $attr)
6
+ {
7
+ $this->name = $extension;
8
+ $this->active = (string)$attr->active;
9
+ $this->version = (string)$attr->version;
10
+
11
+ return $this;
12
+ }
13
+
14
+ }
app/code/community/Glew/Service/Model/Types/Extensions.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Extensions
4
+ {
5
+ public $extensions;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $sortDir)
9
+ {
10
+ $helper = Mage::helper('glew');
11
+ $config = $helper->getConfig();
12
+
13
+ $collection = $modules = Mage::getConfig()->getNode('modules')->children();
14
+ $this->pageNum = $pageNum;
15
+
16
+ foreach($collection as $extension => $attributes) {
17
+ $model = Mage::getModel('glew/types_extension')->parse($extension, $attributes);
18
+ if($model) {
19
+ $this->extensions[] = $model;
20
+ }
21
+ }
22
+
23
+ return $this;
24
+ }
25
+
26
+ }
app/code/community/Glew/Service/Model/Types/Inventory.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Inventory
4
+ {
5
+ public $inventory;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $sortDir)
9
+ {
10
+ $config = Mage::helper('glew')->getConfig();
11
+ $inventory = Mage::getModel('cataloginventory/stock_item')->getCollection();
12
+ $inventory->setOrder('entity_id', $sortDir);
13
+ $this->pageNum = $pageNum;
14
+ $inventory->setCurPage($pageNum);
15
+ $inventory->setPageSize($pageSize);
16
+
17
+ if($inventory->getLastPageNumber() < $pageNum){
18
+ return $this;
19
+ }
20
+
21
+ foreach ($inventory as $inventoryItem){
22
+ $model = Mage::getModel('glew/types_inventoryItem')->parse($inventoryItem);
23
+ if ($model) {
24
+ $this->inventory[] = $model;
25
+ }
26
+ }
27
+ return $this;
28
+ }
29
+
30
+ }
app/code/community/Glew/Service/Model/Types/InventoryItem.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_InventoryItem
4
+ {
5
+ public function parse($item)
6
+ {
7
+ $this->id = $item->getItemId();
8
+ $this->product_id = $item->getProductId();
9
+ $this->qty = $item->getQty();
10
+
11
+ return $this;
12
+ }
13
+
14
+ }
app/code/community/Glew/Service/Model/Types/Order.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Order
4
+ {
5
+ public function parse($order)
6
+ {
7
+ $this->id = $order->getId();
8
+ $this->email = $order->getCustomerEmail();
9
+ $this->increment_id = $order->getIncrementId();
10
+ $this->customer_id = $order->getCustomerId() ? $order->getCustomerId() : 0;
11
+ $this->customer_group_id = $order->getCustomerGroupId() ? $order->getCustomerGroupId() : null;
12
+ $customerGroup = Mage::getModel('customer/group')->load( $order->getCustomerGroupId() );
13
+ $this->customer_group = $customerGroup->getCode();
14
+ $this->created_at = $order->getCreatedAt();
15
+ $this->state = $order->getState();
16
+ $this->status = $order->getStatus();
17
+ $this->customer_is_guest = $order->getCustomerIsGuest();
18
+ $this->total_qty_ordered = (int)$order->getTotalQtyOrdered();
19
+ $this->currency = $order->getOrderCurrencyCode();
20
+ $this->total = round($order->getGrandTotal(), 2);
21
+ $this->tax = round($order->getTaxAmount(), 2);
22
+ $this->shipping_total = round($order->getShippingAmount(), 2);
23
+ $this->shipping_tax = round($order->getShippingTaxAmount(), 2);
24
+ $this->shipping_description = $order->getShippingDescription();
25
+ $this->payment_method = $order->getPayment()->getMethodInstance()->getTitle();
26
+
27
+ $this->discount_amount = round($order->getDiscountAmount(), 2);
28
+ $this->discount_description = $order->getDiscountDescription();
29
+ $this->weight = $order->getWeight();
30
+ $this->remote_ip = $order->getRemoteIp();
31
+ $this->store = $order->getStore()->getCode();
32
+
33
+ return $this;
34
+ }
35
+
36
+ }
app/code/community/Glew/Service/Model/Types/OrderItem.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_OrderItem
4
+ {
5
+ public function parse($orderItem)
6
+ {
7
+ $this->order_item_id = $orderItem->getId();
8
+ $this->order_id = $orderItem->getOrderId();
9
+ $this->created_at = $orderItem->getCreatedAt();
10
+ $this->updated_at = $orderItem->getUpdatedAt();
11
+ $this->weight = $orderItem->getWeight();
12
+ $this->sku = $orderItem->getSku();
13
+ $this->product_id = $orderItem->getProductId();
14
+ $this->name = $orderItem->getName();
15
+ $this->description = $orderItem->getDescription();
16
+ $this->visibility = '';
17
+ $this->brand = '';
18
+ $this->website_names = '';
19
+ $this->store = $orderItem->getOrder()->getStore()->getCode();
20
+
21
+ $this->qty_ordered = (int)$orderItem->getQtyOrdered();
22
+ $this->qty_refunded = (int)$orderItem->getQtyRefunded();
23
+ $this->qty_shipped = (int)$orderItem->getQtyShipped();
24
+ $this->qty_backordered = (int)$orderItem->getQtyBackordered();
25
+
26
+ $this->price = round($orderItem->getPrice(), 2);
27
+ $this->original_price = round($orderItem->getOriginalPrice(), 2);
28
+ $this->cost = round($orderItem->getCost(), 2);
29
+ $this->row_total = round($orderItem->getRowTotal(), 2);
30
+ $this->tax_percent = round($orderItem->getTaxPercent(), 2);
31
+ $this->tax_amount = round($orderItem->getTaxAmount(), 2);
32
+ $this->discount_percent = round($orderItem->getDiscountPercent(), 2);
33
+ $this->discount_amount = round($orderItem->getDiscountAmount(), 2);
34
+
35
+ $this->weight = round($orderItem->getWeight(), 2);
36
+ $this->row_weight = round($orderItem->getRowWeight(), 2);
37
+ $this->additional_data = $orderItem->getAdditionalData();
38
+ return $this;
39
+ }
40
+
41
+ private function _getSelectAttributeLabel($attrCode, $value)
42
+ {
43
+ try {
44
+ $api = Mage::getSingleton('catalog/product_attribute_api');
45
+ $info = $api->info($attrCode);
46
+ if ($info) {
47
+ if (isset($info['options'])) {
48
+ foreach($info['options'] as $option) {
49
+ $label = str_ireplace(' ', '', $option['label']);
50
+ if ($option['value'] == $value) {
51
+ return $label;
52
+ }
53
+ }
54
+ }
55
+ }
56
+ return '';
57
+ } catch(Exception $ex) {
58
+ $helper = Mage::helper('glew');
59
+ $helper->ex($ex, 'process');
60
+ }
61
+
62
+ }
63
+
64
+ protected function _getProductCategories($product)
65
+ {
66
+ $maxlevel = 0;
67
+ foreach($product->getCategoryIds() as $k => $categoryId) {
68
+ $category = Mage::getModel('catalog/category')->
69
+ load($categoryId);
70
+ $level = $category->getLevel();
71
+
72
+ if($category->getLevel() > $maxlevel){
73
+ while($level >= 2){
74
+ $categoryK = 'category'.($level - 1);
75
+ if($level <= 4){
76
+ $this->$categoryK = $category->getName();
77
+ }
78
+ $category = Mage::getModel('catalog/category')->load($category->parent_id);
79
+ $level = $category->getLevel();
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+
app/code/community/Glew/Service/Model/Types/OrderItems.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_OrderItems
4
+ {
5
+ public $orderItems;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $startDate = null, $endDate = null, $sortDir)
9
+ {
10
+ $helper = Mage::helper('glew');
11
+ $config = $helper->getConfig();
12
+ $attribute = Mage::getSingleton('eav/config')->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'cost');
13
+ if($startDate && $endDate) {
14
+ $from = date('Y-m-d 00:00:00', strtotime($startDate));
15
+ $to = date('Y-m-d 23:59:59', strtotime($endDate));
16
+
17
+ $collection = Mage::getModel('sales/order_item')->getCollection()
18
+ ->addAttributeToFilter('updated_at', array('from'=>$from, 'to'=>$to));
19
+ } else {
20
+ $collection = Mage::getModel('sales/order_item')->getCollection();
21
+ }
22
+ $collection->getSelect()->joinLeft(
23
+ array('cost' => 'catalog_product_entity_decimal'),
24
+ "main_table.product_id = cost.entity_id AND cost.attribute_id = {$attribute->getId()}",
25
+ array('cost' => 'value')
26
+ );
27
+ $collection->setOrder('created_at', $sortDir);
28
+ $this->pageNum = $pageNum;
29
+ $collection->setCurPage($pageNum);
30
+ $collection->setPageSize($pageSize);
31
+ if($collection->getLastPageNumber() < $pageNum){
32
+ return $this;
33
+ }
34
+
35
+ foreach($collection as $orderItem) {
36
+ if ($orderItem && $orderItem->getId()) {
37
+ $model = Mage::getModel('glew/types_orderItem')->parse($orderItem);
38
+ if ($model) {
39
+ $this->orderItems[] = $model;
40
+ }
41
+ }
42
+ }
43
+
44
+ return $this;
45
+ }
46
+
47
+ }
app/code/community/Glew/Service/Model/Types/Orders.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Orders
4
+ {
5
+ public $orders;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $startDate = null, $endDate = null, $sortDir)
9
+ {
10
+ $helper = Mage::helper('glew');
11
+ $config = $helper->getConfig();
12
+
13
+ if($startDate && $endDate) {
14
+ $from = date('Y-m-d 00:00:00', strtotime($startDate));
15
+ $to = date('Y-m-d 23:59:59', strtotime($endDate));
16
+ $collection = Mage::getModel('sales/order')->getCollection()
17
+ ->addAttributeToFilter('updated_at', array('from'=>$from, 'to'=>$to));
18
+ } else {
19
+ $collection = Mage::getModel('sales/order')->getCollection();
20
+ }
21
+ $collection->addAttributeToSort('created_at', $sortDir);
22
+ $collection->setCurPage($pageNum);
23
+ $collection->setPageSize($pageSize);
24
+ $this->pageNum = $pageNum;
25
+
26
+ if($collection->getLastPageNumber() < $pageNum){
27
+ return $this;
28
+ }
29
+ foreach($collection as $order) {
30
+ if ($order && $order->getId()) {
31
+ $model = Mage::getModel('glew/types_order')->parse($order);
32
+ if ($model) {
33
+ $this->orders[] = $model;
34
+ }
35
+ }
36
+ }
37
+
38
+ return $this;
39
+ }
40
+
41
+ }
app/code/community/Glew/Service/Model/Types/Product.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Product
4
+ {
5
+ public function parse($productId, $productAttributes)
6
+ {
7
+ $product = Mage::getModel('catalog/product')->load($productId);
8
+
9
+
10
+ $this->product_id = $productId;
11
+ $this->entity_id = $product->getData('entity_id');
12
+ $this->entity_type_id = $product->getData('entity_type_id');
13
+ $this->attribute_set_id = $product->getData('attribute_set_id');
14
+ $this->type_id = $product->getData('type_id');
15
+
16
+ foreach ( $productAttributes as $field => $usesSource){
17
+ $value = $product->getData($field);
18
+ if(is_array($value) || is_object($value)){
19
+ continue;
20
+ }
21
+
22
+ if($field == 'image') {
23
+ $imageUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $value;
24
+ $this->$field = $imageUrl;
25
+ continue;
26
+ }
27
+
28
+ if ($usesSource) {
29
+ $option = $product->getAttributeText($field);
30
+ if ($value && empty($option) && $option != '0') {
31
+ continue;
32
+ }
33
+ if (is_array($option)) {
34
+ $value = implode(',', $option);
35
+ } else {
36
+ $value = $option;
37
+ }
38
+ }
39
+ if($field == 'category_ids'){
40
+ $value = $product->getCategoryIds();
41
+ }
42
+
43
+ $this->$field = $value;
44
+ }
45
+
46
+ return $this;
47
+ }
48
+
49
+ }
app/code/community/Glew/Service/Model/Types/ProductAlert.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_ProductAlert
4
+ {
5
+ public function parse($alert)
6
+ {
7
+ $this->id = $alert->getAlertStockId();
8
+ $this->customer_id = $alert->getCustomerId();
9
+ $this->product_id = $alert->getProductId();
10
+ $this->created_at = $alert->getAddDate();
11
+
12
+ return $this;
13
+ }
14
+
15
+ }
app/code/community/Glew/Service/Model/Types/ProductAlerts.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_ProductAlerts
4
+ {
5
+ public $alerts;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $startDate = null, $endDate = null, $sortDir)
9
+ {
10
+ $config = Mage::helper('glew')->getConfig();
11
+ if($startDate && $endDate) {
12
+ $condition = "add_date BETWEEN '" . date('Y-m-d 00:00:00', strtotime($startDate)) . "' AND '" . date('Y-m-d 23:59:59', strtotime($endDate)) . "'";
13
+ $alerts = Mage::getModel('productalert/stock')->getCollection()
14
+ ->addFilter('add_date', $condition, 'string');
15
+ } else {
16
+ $alerts = Mage::getModel('productalert/stock')->getCollection();
17
+ }
18
+ $alerts->setOrder('add_date', $sortDir);
19
+ $this->pageNum = $pageNum;
20
+ $alerts->setCurPage($pageNum);
21
+ $alerts->setPageSize($pageSize);
22
+
23
+ if($alerts->getLastPageNumber() < $pageNum){
24
+ return $this;
25
+ }
26
+
27
+ foreach ($alerts as $alert){
28
+ $model = Mage::getModel('glew/types_productAlert')->parse($alert);
29
+ if ($model) {
30
+ $this->alerts[] = $model;
31
+ }
32
+ }
33
+ return $this;
34
+ }
35
+
36
+ }
app/code/community/Glew/Service/Model/Types/Products.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Products
4
+ {
5
+ public $products;
6
+ private $productAttributes = array();
7
+ private $pageNum;
8
+
9
+ public function load($pageSize, $pageNum, $startDate = null, $endDate = null, $sortDir)
10
+ {
11
+ $config = Mage::helper('glew')->getConfig();
12
+ $this->_getProductAttribtues();
13
+ if($startDate && $endDate) {
14
+ $from = date('Y-m-d 00:00:00', strtotime($startDate));
15
+ $to = date('Y-m-d 23:59:59', strtotime($endDate));
16
+
17
+ $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')
18
+ ->addAttributeToFilter('updated_at', array('from'=>$from, 'to'=>$to));
19
+ } else {
20
+ $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');
21
+ }
22
+ $this->pageNum = $pageNum;
23
+ $products->setOrder('updated_at', $sortDir);
24
+ $products->setCurPage($pageNum);
25
+ $products->setPageSize($pageSize);
26
+
27
+ if($products->getLastPageNumber() < $pageNum){
28
+ return $this;
29
+ }
30
+
31
+ foreach ($products as $product){
32
+ $productId = $product->getId();
33
+ $model = Mage::getModel('glew/types_product')->parse($productId, $this->productAttributes);
34
+ if ($model) {
35
+ $model->cross_sell_products = $this->_getCrossSellProducts($product);
36
+ $model->up_sell_products = $this->_getUpSellProducts($product);
37
+ $model->related_products = $this->_getRelatedProducts($product);
38
+ $this->products[] = $model;
39
+ }
40
+ }
41
+ return $this;
42
+ }
43
+
44
+ protected function _getProductAttribtues()
45
+ {
46
+ if(!$this->productAttributes){
47
+ $attributes = Mage::getResourceModel('catalog/product_attribute_collection')->getItems();
48
+ foreach ($attributes as $attribute){
49
+ if (!$attribute) {
50
+ continue;
51
+ }
52
+ $this->productAttributes[$attribute->getData('attribute_code')] = $attribute->usesSource();
53
+ }
54
+ }
55
+ }
56
+
57
+ protected function _getCrossSellProducts($product)
58
+ {
59
+ $productArray = array();
60
+ $collection = $product->getCrossSellProductCollection()
61
+ ->addAttributetoSort('position', 'asc');
62
+ if($collection) {
63
+ foreach($collection as $item) {
64
+ $productArray[] = $item->getId();
65
+ }
66
+ }
67
+ return $productArray;
68
+ }
69
+
70
+ protected function _getUpSellProducts($product)
71
+ {
72
+ $productArray = array();
73
+ $collection = $product->getUpSellProductCollection();
74
+ if($collection) {
75
+ foreach($collection as $item) {
76
+ $productArray[] = $item->getId();
77
+ }
78
+ }
79
+ return $productArray;
80
+ }
81
+
82
+ protected function _getRelatedProducts($product)
83
+ {
84
+ $productArray = array();
85
+ $collection = $product->getRelatedProductCollection();
86
+ if($collection) {
87
+ foreach($collection as $item) {
88
+ $productArray[] = $item->getId();
89
+ }
90
+ }
91
+ return $productArray;
92
+ }
93
+ }
app/code/community/Glew/Service/Model/Types/Refund.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Refund
4
+ {
5
+ public function parse($refund)
6
+ {
7
+ $this->refund_id = $refund->getId();
8
+ $this->order_id = $refund->getData('order_id');;
9
+ $this->amount = $refund->getData('grand_total');
10
+ $this->created_at = $refund->getCreatedAt();
11
+ $this->updated_at = $refund->getUpdatedAt();
12
+
13
+ return $this;
14
+ }
15
+
16
+ }
app/code/community/Glew/Service/Model/Types/RefundItem.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_RefundItem
4
+ {
5
+ public function parse($refund)
6
+ {
7
+ $this->refund_item_id = $refund->getId();
8
+ $this->parent_id = $refund->getData('parent_id');
9
+ $this->product_id = $refund->getData('product_id');
10
+ $this->order_item_id = $refund->getData('order_item_id');
11
+ $this->qty = $refund->getData('qty');
12
+ $this->row_total = $refund->getData('row_total');
13
+ $this->tax_amount = $refund->getData('tax_amount');
14
+ $this->price = $refund->getData('base_price');
15
+ $this->created_at = $refund->getCreatedAt();
16
+ $this->updated_at = $refund->getUpdatedAt();
17
+
18
+ return $this;
19
+ }
20
+
21
+ }
app/code/community/Glew/Service/Model/Types/RefundItems.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_RefundItems
4
+ {
5
+ public $refundItems;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $startDate = null, $endDate = null, $sortDir)
9
+ {
10
+ $config = Mage::helper('glew')->getConfig();
11
+ if($startDate && $endDate) {
12
+ $from = date('Y-m-d 00:00:00', strtotime($startDate));
13
+ $to = date('Y-m-d 23:59:59', strtotime($endDate));
14
+
15
+ $refunds = Mage::getResourceModel('sales/order_creditmemo_collection')
16
+ ->addAttributeToFilter('updated_at', array('from'=>$from, 'to'=>$to));
17
+ } else {
18
+ $refunds = Mage::getResourceModel('sales/order_creditmemo_collection');
19
+ }
20
+ $refunds->getSelect()->join(array('credit_item' => 'sales_flat_creditmemo_item'), 'credit_item.parent_id = main_table.entity_id', array('*'));
21
+ $refunds->setOrder('created_at', $sortDir);
22
+ $this->pageNum = $pageNum;
23
+ $refunds->setCurPage($pageNum);
24
+ $refunds->setPageSize($pageSize);
25
+
26
+ if($refunds->getLastPageNumber() < $pageNum){
27
+ return $this;
28
+ }
29
+
30
+ foreach ($refunds as $refund){
31
+ $model = Mage::getModel('glew/types_refundItem')->parse($refund);
32
+ if ($model) {
33
+ $this->refundItems[] = $model;
34
+ }
35
+ }
36
+ return $this;
37
+ }
38
+
39
+ }
app/code/community/Glew/Service/Model/Types/Refunds.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Refunds
4
+ {
5
+ public $refunds;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $startDate = null, $endDate = null, $sortDir)
9
+ {
10
+ $config = Mage::helper('glew')->getConfig();
11
+ if($startDate && $endDate) {
12
+ $from = date('Y-m-d 00:00:00', strtotime($startDate));
13
+ $to = date('Y-m-d 23:59:59', strtotime($endDate));
14
+
15
+ $refunds = Mage::getResourceModel('sales/order_creditmemo_collection')
16
+ ->addAttributeToFilter('updated_at', array('from'=>$from, 'to'=>$to));
17
+ } else {
18
+ $refunds = Mage::getResourceModel('sales/order_creditmemo_collection');
19
+ }
20
+ $refunds->setOrder('created_at', $sortDir);
21
+ $this->pageNum = $pageNum;
22
+ $refunds->setCurPage($pageNum);
23
+ $refunds->setPageSize($pageSize);
24
+
25
+ if($refunds->getLastPageNumber() < $pageNum){
26
+ return $this;
27
+ }
28
+
29
+ foreach ($refunds as $refund){
30
+ $model = Mage::getModel('glew/types_refund')->parse($refund);
31
+ if ($model) {
32
+ $this->refunds[] = $model;
33
+ }
34
+ }
35
+ return $this;
36
+ }
37
+
38
+ }
app/code/community/Glew/Service/Model/Types/Store.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Store
4
+ {
5
+ public function parse($store)
6
+ {
7
+ foreach ( $store->getData() as $key => $value){
8
+ $this->$key = $value;
9
+ }
10
+ return $this;
11
+ }
12
+
13
+ }
app/code/community/Glew/Service/Model/Types/Stores.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Stores
4
+ {
5
+ public $stores;
6
+ private $pageNum;
7
+
8
+ public function load()
9
+ {
10
+ $helper = Mage::helper('glew');
11
+ $config = $helper->getConfig();
12
+
13
+ $stores = Mage::app()->getStores();
14
+ foreach ($stores as $store){
15
+ $model = Mage::getModel('glew/types_store')->parse($store);
16
+ if ($model) {
17
+ $this->stores[] = $model;
18
+ }
19
+ }
20
+ return $this;
21
+ }
22
+
23
+ }
app/code/community/Glew/Service/Model/Types/Subscriber.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Subscriber
4
+ {
5
+ public function parse($subscriber)
6
+ {
7
+ foreach ( $subscriber->getData() as $key => $value){
8
+ $this->$key = $value;
9
+ }
10
+ return $this;
11
+ }
12
+
13
+ }
app/code/community/Glew/Service/Model/Types/Subscribers.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_Model_Types_Subscribers
4
+ {
5
+ public $subscribers;
6
+ private $pageNum;
7
+
8
+ public function load($pageSize, $pageNum, $sortDir)
9
+ {
10
+ $helper = Mage::helper('glew');
11
+ $config = $helper->getConfig();
12
+ $subscribers = Mage::getModel('newsletter/subscriber')->getCollection();
13
+ $this->pageNum = $pageNum;
14
+ $subscribers->setOrder('subscriber_id', $sortDir);
15
+ $subscribers->setCurPage($pageNum);
16
+ $subscribers->setPageSize($pageSize);
17
+
18
+ if($subscribers->getLastPageNumber() < $pageNum){
19
+ return $this;
20
+ }
21
+
22
+ foreach ($subscribers as $subscriber){
23
+ $model = Mage::getModel('glew/types_subscriber')->parse($subscriber);
24
+ if ($model) {
25
+ $this->subscribers[] = $model;
26
+ }
27
+ }
28
+ return $this;
29
+ }
30
+
31
+ }
app/code/community/Glew/Service/controllers/ModuleController.php ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ protected $_helper = null;
6
+ protected $_config = null;
7
+ protected $_pageSize = null;
8
+ protected $_pageNum = null;
9
+ protected $_startDate = null;
10
+ protected $_endDate = null;
11
+ protected $_sortDir = 'asc';
12
+
13
+ protected function _construct()
14
+ {
15
+ $this->_helper = Mage::helper('glew');
16
+ $this->_config = $this->_helper->getConfig();
17
+ if (!!$pageSize = $this->getRequest()->getParam('page_size')) {
18
+ $this->_pageSize = $pageSize;
19
+ }
20
+ if (!!$pageNum = $this->getRequest()->getParam('page_num')) {
21
+ $this->_pageNum = $pageNum;
22
+ }
23
+ if (!!$startDate = $this->getRequest()->getParam('start_date')) {
24
+ $this->_startDate = $startDate;
25
+ }
26
+ if (!!$endDate = $this->getRequest()->getParam('end_date')) {
27
+ $this->_endDate = $endDate;
28
+ }
29
+ if (!!$sortDir = $this->getRequest()->getParam('sort_dir')) {
30
+ $this->_sortDir = $sortDir;
31
+ }
32
+ }
33
+
34
+ public function gotoglewAction() {
35
+ $this->_redirectUrl('https://app.glew.io');
36
+ }
37
+
38
+ public function abandoned_cartsAction()
39
+ {
40
+ try {
41
+ $this->_initRequest();
42
+ $collection = Mage::getModel('glew/types_abandonedCarts')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir);
43
+ $this->_sendResponse($collection);
44
+ } catch(Exception $e) {
45
+ $this->_helper->logException($e, 'abandonedCarts');
46
+ }
47
+ }
48
+
49
+ public function customersAction()
50
+ {
51
+ try {
52
+ $this->_initRequest();
53
+ $collection = Mage::getModel('glew/types_customers')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir);
54
+ $this->_sendResponse($collection);
55
+ } catch(Exception $e) {
56
+ $this->_helper->logException($e, 'customers');
57
+ }
58
+ }
59
+
60
+
61
+ public function ordersAction()
62
+ {
63
+ try {
64
+ $this->_initRequest();
65
+ $collection = Mage::getModel('glew/types_orders')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir);
66
+ $this->_sendResponse($collection);
67
+ } catch(Exception $e) {
68
+ $this->_helper->logException($e, 'orders');
69
+ }
70
+ }
71
+
72
+ public function order_itemsAction()
73
+ {
74
+ try {
75
+ $this->_initRequest();
76
+ $collection = Mage::getModel('glew/types_orderItems')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir);
77
+ $this->_sendResponse($collection);
78
+ } catch(Exception $e) {
79
+ $this->_helper->logException($e, 'orderItems');
80
+ }
81
+ }
82
+
83
+ public function storesAction()
84
+ {
85
+ try {
86
+ $this->_initRequest();
87
+ $collection = Mage::getModel('glew/types_stores')->load();
88
+ $this->_sendResponse($collection);
89
+ } catch(Exception $e) {
90
+ $this->_helper->logException($e, 'stores');
91
+ }
92
+ }
93
+
94
+ public function newsletter_subscribersAction()
95
+ {
96
+ try {
97
+ $this->_initRequest();
98
+ $collection = Mage::getModel('glew/types_subscribers')->load($this->_pageSize, $this->_pageNum, $this->_sortDir);
99
+ $this->_sendResponse($collection);
100
+ } catch(Exception $e) {
101
+ $this->_helper->logException($e, 'subscribers');
102
+ }
103
+ }
104
+
105
+ public function productsAction()
106
+ {
107
+ try {
108
+ $this->_initRequest();
109
+ $collection = Mage::getModel('glew/types_products')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir);
110
+ $this->_sendResponse($collection);
111
+ } catch(Exception $e) {
112
+ $this->_helper->logException($e, 'products');
113
+ }
114
+ }
115
+
116
+ public function product_alertsAction()
117
+ {
118
+ try {
119
+ $this->_initRequest();
120
+ $collection = Mage::getModel('glew/types_productAlerts')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir);
121
+ $this->_sendResponse($collection);
122
+ } catch(Exception $e) {
123
+ $this->_helper->logException($e, 'productAlerts');
124
+ }
125
+ }
126
+
127
+ public function categoriesAction()
128
+ {
129
+ try {
130
+ $this->_initRequest();
131
+ $collection = Mage::getModel('glew/types_categories')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir);
132
+ $this->_sendResponse($collection);
133
+ } catch(Exception $e) {
134
+ $this->_helper->logException($e, 'categories');
135
+ }
136
+ }
137
+
138
+ public function inventoryAction() {
139
+ try {
140
+ $this->_initRequest();
141
+ $collection = Mage::getModel('glew/types_inventory')->load($this->_pageSize, $this->_pageNum, $this->_sortDir);
142
+ $this->_sendResponse($collection);
143
+ } catch(Exception $e) {
144
+ $this->_helper->logException($e, 'inventory');
145
+ }
146
+ }
147
+
148
+
149
+
150
+ public function versionAction()
151
+ {
152
+ try {
153
+ $obj = new stdClass();
154
+ $obj->version = (string)Mage::getConfig()->getNode()->modules->Glew_Service->version;
155
+ $this->_sendResponse($obj);
156
+ } catch(Exception $ex) {
157
+ $this->_helper->logException($ex, 'version');
158
+ }
159
+ }
160
+
161
+ public function extensionsAction()
162
+ {
163
+ try {
164
+ $this->_initRequest();
165
+ $collection = Mage::getModel('glew/types_extensions')->load($this->_pageSize, $this->_pageNum, $this->_sortDir);
166
+ $this->_sendResponse($collection);
167
+ } catch(Exception $e) {
168
+ $this->_helper->logException($e, 'extensions');
169
+ }
170
+ }
171
+
172
+ public function refund_itemsAction()
173
+ {
174
+ try {
175
+ $this->_initRequest();
176
+ $collection = Mage::getModel('glew/types_refundItems')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir);
177
+ $this->_sendResponse($collection);
178
+ } catch(Exception $e) {
179
+ $this->_helper->logException($e, 'refund items');
180
+ }
181
+ }
182
+
183
+ public function refundsAction()
184
+ {
185
+ try {
186
+ $this->_initRequest();
187
+ $collection = Mage::getModel('glew/types_refunds')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir);
188
+ $this->_sendResponse($collection);
189
+ } catch(Exception $e) {
190
+ $this->_helper->logException($e, 'refunds');
191
+ }
192
+ }
193
+
194
+
195
+ protected function _sendResponse($items)
196
+ {
197
+ $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);
198
+ $this->getResponse()->setBody(json_encode($items));
199
+ }
200
+
201
+ private function _initRequest()
202
+ {
203
+ if (! $this->_config['enabled']) {
204
+ $this->_reject();
205
+ return true;
206
+ }
207
+
208
+ if (! $this->_config['security_token']) {
209
+ $setup = Mage::getModel('glew/resource_mysql4_setup');
210
+ $setup->createSecurityToken();
211
+ }
212
+
213
+ $authToken = $_SERVER['HTTP_AUTHORIZATION'];
214
+
215
+ if (trim( $this->_config['security_token']) != trim($authToken)) {
216
+ Mage::log('Glew feed request with invalid security token: ' . $this->getRequest()->getParam('token'));
217
+ $this->_reject();
218
+ }
219
+ }
220
+
221
+ private function _reject()
222
+ {
223
+ $this->getResponse()->setHttpResponseCode(401)->setBody('Invalid security token or module disabled');
224
+ throw new Exception('Invalid security token or module disabled');
225
+ }
226
+
227
+ }
app/code/community/Glew/Service/etc/adminhtml.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <menu>
3
+ <glew translate="title" module="glew">
4
+ <title>Glew</title>
5
+ <sort_order>50</sort_order>
6
+ <action>glew/module/gotoglew</action>
7
+ </glew>
8
+ </menu>
9
+ <acl>
10
+ <resources>
11
+ <admin>
12
+ <children>
13
+ <glew translate="title" module="glew">
14
+ <title>Glew</title>
15
+ </glew>
16
+ </children>
17
+ </admin>
18
+ </resources>
19
+ </acl>
20
+ </config>
app/code/community/Glew/Service/etc/config.xml ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Glew_Service>
5
+ <version>0.0.2</version>
6
+ <depends>
7
+ <Mage_Shipping />
8
+ </depends>
9
+ </Glew_Service>
10
+ </modules>
11
+ <global>
12
+ <models>
13
+ <glew>
14
+ <class>Glew_Service_Model</class>
15
+ </glew>
16
+ </models>
17
+ <helpers>
18
+ <glew>
19
+ <class>Glew_Service_Helper</class>
20
+ </glew>
21
+ </helpers>
22
+ <resources>
23
+ <glew_setup>
24
+ <connection>
25
+ <use>core_setup</use>
26
+ </connection>
27
+ <setup>
28
+ <module>Glew_Service</module>
29
+ <class>Glew_Service_Model_Resource_Mysql4_Setup</class>
30
+ </setup>
31
+ </glew_setup>
32
+ <glew_read>
33
+ <connection>
34
+ <use>core_read</use>
35
+ </connection>
36
+ </glew_read>
37
+ <glew_write>
38
+ <connection>
39
+ <use>core_write</use>
40
+ </connection>
41
+ </glew_write>
42
+ </resources>
43
+ <blocks>
44
+ <glew><class>Glew_Service_Block</class></glew>
45
+ </blocks>
46
+ </global>
47
+ <default>
48
+ <glew_settings>
49
+ <behavior>
50
+ <order_stock_reduction>1</order_stock_reduction>
51
+ <order_invoice_creation>1</order_invoice_creation>
52
+ </behavior>
53
+ <history>
54
+ <limit>100</limit>
55
+ </history>
56
+ <debug>
57
+ <logging>1</logging>
58
+ </debug>
59
+ <general>
60
+ <enabled>1</enabled>
61
+ </general>
62
+ </glew_settings>
63
+ </default>
64
+
65
+ <frontend>
66
+ <secure_url>
67
+ <glew>/glew/</glew>
68
+ </secure_url>
69
+ <routers>
70
+ <glew>
71
+ <use>standard</use>
72
+ <args>
73
+ <module>Glew_Service</module>
74
+ <frontName>glew</frontName>
75
+ </args>
76
+ </glew>
77
+ </routers>
78
+ </frontend>
79
+
80
+ <admin>
81
+ <routers>
82
+ <adminhtml>
83
+ <args>
84
+ <modules>
85
+ <glew before="Mage_Adminhtml">Glew_Service</glew>
86
+ </modules>
87
+ </args>
88
+ </adminhtml>
89
+ </routers>
90
+ </admin>
91
+ <adminhtml>
92
+ <acl>
93
+ <resources>
94
+ <all>
95
+ <title>Allow Everything</title>
96
+ </all>
97
+ <admin>
98
+ <children>
99
+ <system>
100
+ <children>
101
+ <config>
102
+ <children>
103
+ <glew_settings>
104
+ <title>glew</title>
105
+ </glew_settings>
106
+ </children>
107
+ </config>
108
+ </children>
109
+ </system>
110
+ </children>
111
+ </admin>
112
+ </resources>
113
+ </acl>
114
+ </adminhtml>
115
+
116
+
117
+ <menu>
118
+ <glew translate="title" module="glew">
119
+ <title>Glew</title>
120
+ <sort_order>99</sort_order>
121
+ </glew>
122
+ </menu>
123
+ <acl>
124
+ <resources>
125
+ <admin>
126
+ <children>
127
+ <glew translate="title" module="glew">
128
+ <title>Glew</title>
129
+ </glew>
130
+ </children>
131
+ </admin>
132
+ </resources>
133
+ </acl>
134
+ </config>
135
+
app/code/community/Glew/Service/etc/system.xml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <glew translate="label" module="glew">
5
+ <label>Glew</label>
6
+ <sort_order>99999</sort_order>
7
+ </glew>
8
+ </tabs>
9
+ <sections>
10
+
11
+ <glew_settings translate="label" module="glew" >
12
+ <label>Service</label>
13
+ <tab>glew</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>1000</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <info>
21
+ <frontend_model>glew/adminhtml_widget_info_info</frontend_model>
22
+ <sort_order>1</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ </info>
27
+ <general translate="label">
28
+ <label>Glew Settings</label>
29
+ <frontend_type>text</frontend_type>
30
+ <sort_order>100</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ <fields>
35
+ <enabled translate="label">
36
+ <label>Enabled</label>
37
+ <frontend_type>select</frontend_type>
38
+ <source_model>adminhtml/system_config_source_yesno</source_model>
39
+ <sort_order>10</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ <comment>Is Glew Enabled?</comment>
44
+ </enabled>
45
+ <secret translate="label">
46
+ <label>Secret Key</label>
47
+ <frontend_type>button</frontend_type>
48
+ <frontend_model>glew/secretKey</frontend_model>
49
+ <sort_order>200</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ <comment>Your Glew Secret Key</comment>
54
+ </secret>
55
+ </fields>
56
+ </general>
57
+
58
+ </groups>
59
+ </glew_settings>
60
+
61
+
62
+ </sections>
63
+ </config>
app/code/community/Glew/Service/sql/glew_setup/mysql4-install-0.0.2.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->endSetup();
app/etc/modules/Glew_Service.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Glew_Service>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Glew_Service>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Glew</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Magento analytics &amp; reporting.</summary>
10
+ <description>Glew provides Magento store owners with reporting, insights and predictive tools that enable growth and drive profitability.</description>
11
+ <notes>Initial release.</notes>
12
+ <authors><author><name>Glew</name><user>Glew</user><email>jed.young@glew.io</email></author></authors>
13
+ <date>2015-09-24</date>
14
+ <time>14:00:07</time>
15
+ <contents><target name="magecommunity"><dir name="Glew"><dir name="Service"><dir name="Block"><dir name="Adminhtml"><dir name="Widget"><dir name="Info"><file name="Info.php" hash="cb7f32c9a9d9032d9af801834e4ed5af"/></dir></dir></dir><file name="SecretKey.php" hash="22ecb01340e09eec8708abccea746637"/></dir><dir name="Helper"><file name="Data.php" hash="29d28355f96e4ddc9a35ca320a297249"/></dir><dir name="Model"><file name="Glew.php" hash="66742d93d1fe3d0f56dc1d4e32eae93f"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="da1514e6a516eeb5635712375fbb5868"/></dir></dir><dir name="Types"><file name="AbandonedCart.php" hash="ca99b85c3b2b93795013e1929a0d3613"/><file name="AbandonedCarts.php" hash="9de3a1fe27a1942a8c36cb0e5e7fd5c4"/><file name="Address.php" hash="dac4e96501d687ce8c84ddfcc18a8327"/><file name="Categories.php" hash="6d091126af276c49ed77dc6b9b031328"/><file name="Category.php" hash="a75878be202411265d91a20dd4afa457"/><file name="Customer.php" hash="e1f2058d9358d89a48715f151ab45755"/><file name="Customers.php" hash="07b53433e6307a8133502aef9893fe46"/><file name="Extension.php" hash="3a0bc967154cfd1ac5e9534ae96921fc"/><file name="Extensions.php" hash="101f7c9c22c38f919209aa549c968590"/><file name="Inventory.php" hash="89a18320a542979e313f9dd4d9d84849"/><file name="InventoryItem.php" hash="01403ce6dd1f0042654d0c8f0bb18e7a"/><file name="Order.php" hash="4c2c8bcd8a8dd50953faa80d2b881192"/><file name="OrderItem.php" hash="26158c6d23d695ed6cd377bdd12f544f"/><file name="OrderItems.php" hash="567df875c97adce80805a24cb1cea469"/><file name="Orders.php" hash="fc28afe7cb8547f789a34b1dfe194161"/><file name="Product.php" hash="1de04f263ab58b423dbfc10141ddfbec"/><file name="ProductAlert.php" hash="e7ca7668907dad5547d80ad581519e78"/><file name="ProductAlerts.php" hash="c30a35a2d3a085156e49d5ca22bb9ac0"/><file name="Products.php" hash="678aeb7fdbe1c579b81480771990a7ee"/><file name="Refund.php" hash="1b79b89a2ac66cc0dfb05e1f3100f98c"/><file name="RefundItem.php" hash="1d43007ec2bb990eb08b8d0a2812f4ca"/><file name="RefundItems.php" hash="d5dd96946cddfa2e55b37cc62409c7e3"/><file name="Refunds.php" hash="5d91006c24fffed7bc2b9e7e32bb9791"/><file name="Store.php" hash="455923168b5d2550af6b862d776db3f2"/><file name="Stores.php" hash="87248aa7d8d61e348b3b9f76611efc88"/><file name="Subscriber.php" hash="727153725fc7be3fd093422d6a67dfa1"/><file name="Subscribers.php" hash="0c5a3d5d593cedabe79d3c1ef4778af5"/></dir></dir><dir name="controllers"><file name="ModuleController.php" hash="2beb13b475aa04aee5f77d609851dd2c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d2d95c59dc81f92df0ed6adaba801a52"/><file name="config.xml" hash="5e8b7f10dc2ce0e559c30d4b366c1355"/><file name="system.xml" hash="07aa4da88108940bf267cb2abb854eab"/></dir><dir name="sql"><dir name="glew_setup"><file name="mysql4-install-0.0.2.php" hash="b403d80422a7f4d80957d0405d55e2d7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Glew_Service.xml" hash="db2470cc1c1c36b01cea61416a3f6f37"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>8.0.0</max></php><package><name>PHP</name><channel>community</channel><min>5.2.0</min><max>8.0.0</max></package></required></dependencies>
18
+ </package>