Version Notes
Added feature to import error logs.
Download this release
Release Info
Developer | Increasingly |
Extension | increasingly_key |
Version | 1.0.11 |
Comparing to | |
See all releases |
Code changes from version 1.0.10 to 1.0.11
- app/code/community/Increasingly/Analytics/Helper/ProductFormatter.php~ +0 -265
- app/code/community/Increasingly/Analytics/controllers/ImportLogsController.php +81 -0
- app/code/community/Increasingly/Analytics/controllers/ProductsApiController.php~ +0 -208
- app/code/community/Increasingly/Analytics/etc/config.xml +1 -1
- app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.11.php +29 -0
- app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/{mysql4-install-1.0.10.php~ → mysql4-install-1.0.11.php~} +0 -0
- app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.9.php~ +0 -0
- package.xml +5 -5
app/code/community/Increasingly/Analytics/Helper/ProductFormatter.php~
DELETED
@@ -1,265 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Increasingly
|
22 |
-
* @package Increasingly_Analytics
|
23 |
-
* @author Increasingly Pvt Ltd
|
24 |
-
* @copyright Copyright (c) 2015-2016 Increasingly Ltd (http://www.increasingly.co)
|
25 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
-
*/
|
27 |
-
/**
|
28 |
-
* Formats product details to be sent to increasingly
|
29 |
-
*/
|
30 |
-
class Increasingly_Analytics_Helper_ProductFormatter extends Mage_Core_Helper_Abstract
|
31 |
-
{
|
32 |
-
|
33 |
-
public function formatProductInfo($product)
|
34 |
-
{
|
35 |
-
$productData = null;
|
36 |
-
|
37 |
-
try
|
38 |
-
{
|
39 |
-
$priceFormatter = Mage::helper('increasingly_analytics/PriceFormatter');
|
40 |
-
$dateFormatter = Mage::helper('increasingly_analytics/DateFormatter');
|
41 |
-
|
42 |
-
$productData = array(
|
43 |
-
'product_id' => $product->getId(),
|
44 |
-
//'product_sku' => $product->getSku(),
|
45 |
-
//'product_name' => $product->getName(),
|
46 |
-
'categories' => array(),
|
47 |
-
//'currency' => Mage::app()->getStore()->getDefaultCurrencyCode(),
|
48 |
-
// 'product_price' => $priceFormatter->format($product->getPrice()),
|
49 |
-
// 'special_price' => $priceFormatter->format($product->getSpecialPrice()),
|
50 |
-
'product_url' => $product->getProductUrl(),
|
51 |
-
//'description' => $product->getDescription(),
|
52 |
-
//'short_description' => $product->getShortDescription(),
|
53 |
-
//'status' => (int)$product->getStatus(),
|
54 |
-
'product_type' => $product->getTypeId(),
|
55 |
-
'created_at' => $dateFormatter->getFormattedDate($product->getCreatedAt()),
|
56 |
-
'updated_at' => $dateFormatter->getFormattedDate($product->getUpdatedAt())
|
57 |
-
);
|
58 |
-
|
59 |
-
if($product->getResource()->getAttribute('sku'))
|
60 |
-
{
|
61 |
-
$productData['product_sku'] = $product->getSku();
|
62 |
-
}
|
63 |
-
|
64 |
-
if($product->getResource()->getAttribute('name'))
|
65 |
-
{
|
66 |
-
$productData['product_name'] = $product->getName();
|
67 |
-
}
|
68 |
-
|
69 |
-
if($product->getResource()->getAttribute('price'))
|
70 |
-
{
|
71 |
-
$productData['product_price'] = $priceFormatter->format($product->getPrice());
|
72 |
-
}
|
73 |
-
|
74 |
-
if($product->getResource()->getAttribute('special_price'))
|
75 |
-
{
|
76 |
-
$productData['special_price'] = $priceFormatter->format($product->getSpecialPrice());
|
77 |
-
}
|
78 |
-
|
79 |
-
if($product->getResource()->getAttribute('description'))
|
80 |
-
{
|
81 |
-
$productData['description'] = $product->getDescription();
|
82 |
-
}
|
83 |
-
|
84 |
-
if($product->getResource()->getAttribute('short_description'))
|
85 |
-
{
|
86 |
-
$productData['short_description'] = $product->getShortDescription();
|
87 |
-
}
|
88 |
-
|
89 |
-
if($product->getResource()->getAttribute('status'))
|
90 |
-
{
|
91 |
-
$productData['status'] = (int)$product->getStatus();
|
92 |
-
}
|
93 |
-
|
94 |
-
$productDefaultImage = '';
|
95 |
-
if($product->getResource()->getAttribute('image'))
|
96 |
-
{
|
97 |
-
$productDefaultImage = $product->getData('image');
|
98 |
-
if(!empty($productDefaultImage) && $productDefaultImage !== 'no_selection')
|
99 |
-
{
|
100 |
-
//$productData['image_url'] = $product->getImageUrl();
|
101 |
-
$productData['image_url'] = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage());
|
102 |
-
}
|
103 |
-
else
|
104 |
-
{
|
105 |
-
$productData['image_url'] = '';
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
if($product->getResource()->getAttribute('manufacturer'))
|
110 |
-
{
|
111 |
-
$manufacturer = $product->getAttributeText('manufacturer');
|
112 |
-
if(strlen($manufacturer) > 0 && $manufacturer != false)
|
113 |
-
{
|
114 |
-
$productData['manufacturer'] = $manufacturer;
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
if($product->getResource()->getAttribute('color'))
|
119 |
-
{
|
120 |
-
$color = $product->getAttributeText('color');
|
121 |
-
if(strlen($color) > 0 && $color != false)
|
122 |
-
{
|
123 |
-
$productData['color'] = $color;
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
if($product->getResource()->getAttribute('weight'))
|
128 |
-
{
|
129 |
-
$weight = $product->getWeight();
|
130 |
-
if(strlen($weight) > 0 && $weight != false)
|
131 |
-
{
|
132 |
-
$productData['weight'] = $weight;
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
if($product->getResource()->getAttribute('size'))
|
137 |
-
{
|
138 |
-
$size = $product->getAttributeText('size');
|
139 |
-
if(strlen($size) > 0 && $size != false)
|
140 |
-
{
|
141 |
-
$productData['size'] = $size;
|
142 |
-
}
|
143 |
-
}
|
144 |
-
|
145 |
-
if($product->getResource()->getAttribute('visibility'))
|
146 |
-
{
|
147 |
-
$visibility = $product->getAttributeText('visibility');
|
148 |
-
if(strlen($visibility) > 0 && $visibility != false)
|
149 |
-
{
|
150 |
-
$productData['visibility'] = $visibility;
|
151 |
-
}
|
152 |
-
}
|
153 |
-
|
154 |
-
if($productData['product_type'] == "configurable")
|
155 |
-
{
|
156 |
-
$configurableProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($productData['product_id']);
|
157 |
-
$configurable_items = array();
|
158 |
-
foreach($configurableProducts as $key=>$configurableProductList)
|
159 |
-
{
|
160 |
-
foreach($configurableProductList as $itemValue)
|
161 |
-
{
|
162 |
-
$configurable_items[] = $itemValue;
|
163 |
-
}
|
164 |
-
}
|
165 |
-
$productData['associated_products'] = $configurable_items;
|
166 |
-
}
|
167 |
-
|
168 |
-
if($productData['product_type'] == "grouped")
|
169 |
-
{
|
170 |
-
$groupedProducts = Mage::getModel('catalog/product_type_grouped')->getChildrenIds($productData['product_id']);
|
171 |
-
$grouped_items = array();
|
172 |
-
|
173 |
-
foreach($groupedProducts as $key=>$groupedProductList)
|
174 |
-
{
|
175 |
-
foreach($groupedProductList as $itemValue)
|
176 |
-
{
|
177 |
-
$grouped_items[] = $itemValue;
|
178 |
-
}
|
179 |
-
}
|
180 |
-
$productData['associated_products'] = $grouped_items;
|
181 |
-
}
|
182 |
-
|
183 |
-
if($productData['product_type'] == "bundle")
|
184 |
-
{
|
185 |
-
$selectionCollection = $product->getTypeInstance(true)->getSelectionsCollection(
|
186 |
-
$product->getTypeInstance(true)->getOptionsIds($product), $product);
|
187 |
-
|
188 |
-
$bundled_items = array();
|
189 |
-
foreach($selectionCollection as $option)
|
190 |
-
{
|
191 |
-
$bundled_items[] = $option->getId();
|
192 |
-
}
|
193 |
-
$productData['associated_products'] = $bundled_items;
|
194 |
-
}
|
195 |
-
|
196 |
-
$relatedProducts = $product->getRelatedProductIds();
|
197 |
-
if(count($relatedProducts) > 0)
|
198 |
-
{
|
199 |
-
$productData['related_products'] = $relatedProducts;
|
200 |
-
}
|
201 |
-
|
202 |
-
$upSellProducts = $product->getUpSellProductIds();
|
203 |
-
if(count($upSellProducts) > 0)
|
204 |
-
{
|
205 |
-
$productData['up_sell_products'] = $upSellProducts;
|
206 |
-
}
|
207 |
-
|
208 |
-
$crossSellProducts = $product->getCrossSellProductIds();
|
209 |
-
if(count($crossSellProducts) > 0)
|
210 |
-
{
|
211 |
-
$productData['cross_sell_products'] = $crossSellProducts;
|
212 |
-
}
|
213 |
-
|
214 |
-
// get stock info
|
215 |
-
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
|
216 |
-
$productData['qty'] = (int)$stock->getQty();
|
217 |
-
|
218 |
-
$categories = $product->getCategoryCollection()
|
219 |
-
->addAttributeToSelect('id')
|
220 |
-
->addAttributeToSelect('name');
|
221 |
-
|
222 |
-
foreach($categories as $category)
|
223 |
-
{
|
224 |
-
$categoryInfo = array();
|
225 |
-
$categoryInfo['id'] = $category->getId();
|
226 |
-
$categoryInfo['name'] = $category->getName();
|
227 |
-
$productData['categories'][] = $categoryInfo;
|
228 |
-
}
|
229 |
-
|
230 |
-
if($product->getResource()->getAttribute('media_gallery'))
|
231 |
-
{
|
232 |
-
$otherImages = $product->getMediaGalleryImages();
|
233 |
-
|
234 |
-
if($otherImages == '' || count($otherImages) == 0)
|
235 |
-
{
|
236 |
-
$productImage_Data = Mage::getModel('catalog/product')->load($product->getId());
|
237 |
-
$otherImages = $productImage_Data->getMediaGalleryImages();
|
238 |
-
}
|
239 |
-
|
240 |
-
if(count($otherImages) > 1)
|
241 |
-
{
|
242 |
-
foreach($otherImages as $img)
|
243 |
-
{
|
244 |
-
if(!empty($productDefaultImage) && $img->getFile() != $productDefaultImage)
|
245 |
-
{
|
246 |
-
$productData['other_image_list'][] = $img->getUrl();
|
247 |
-
}
|
248 |
-
}
|
249 |
-
}
|
250 |
-
|
251 |
-
}
|
252 |
-
|
253 |
-
|
254 |
-
}
|
255 |
-
catch(Exception $e)
|
256 |
-
{
|
257 |
-
Mage::log($e, null, 'Increasingly_Analytics.log');
|
258 |
-
}
|
259 |
-
|
260 |
-
return $productData;
|
261 |
-
}
|
262 |
-
|
263 |
-
}
|
264 |
-
|
265 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Increasingly/Analytics/controllers/ImportLogsController.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Increasingly
|
22 |
+
* @package Increasingly_Analytics
|
23 |
+
* @author Increasingly Pvt Ltd
|
24 |
+
* @copyright Copyright (c) 2015-2016 Increasingly Ltd (http://www.increasingly.co)
|
25 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
+
*/
|
27 |
+
/**
|
28 |
+
* Returns error log details to increasingly on API call
|
29 |
+
*/
|
30 |
+
|
31 |
+
class Increasingly_Analytics_ImportLogsController extends Mage_Core_Controller_Front_Action
|
32 |
+
{
|
33 |
+
|
34 |
+
public function getLogsAction()
|
35 |
+
{
|
36 |
+
try
|
37 |
+
{
|
38 |
+
$errorLines = "";
|
39 |
+
|
40 |
+
/* exception log */
|
41 |
+
$exceptionLogFilePath = Mage::getBaseDir('log')."/exception.log";
|
42 |
+
|
43 |
+
if(file_exists($exceptionLogFilePath))
|
44 |
+
{
|
45 |
+
$errorLines = $errorLines.file_get_contents($exceptionLogFilePath);
|
46 |
+
}
|
47 |
+
|
48 |
+
/* system log */
|
49 |
+
$systemLogFilePath = Mage::getBaseDir('log')."/system.log";
|
50 |
+
|
51 |
+
if(file_exists($systemLogFilePath))
|
52 |
+
{
|
53 |
+
$errorLines = $errorLines.file_get_contents($systemLogFilePath);
|
54 |
+
}
|
55 |
+
|
56 |
+
/* increasingly log */
|
57 |
+
$increasinglyLogFilePath = Mage::getBaseDir('log')."/Increasingly_Analytics.log";
|
58 |
+
|
59 |
+
if(file_exists($increasinglyLogFilePath))
|
60 |
+
{
|
61 |
+
$errorLines = $errorLines.file_get_contents($increasinglyLogFilePath);
|
62 |
+
}
|
63 |
+
|
64 |
+
$this->getResponse()
|
65 |
+
->setBody($errorLines)
|
66 |
+
->setHttpResponseCode(200)
|
67 |
+
->setHeader('Content-type', 'application/text', true);
|
68 |
+
|
69 |
+
}
|
70 |
+
catch(Exception $e) {
|
71 |
+
|
72 |
+
Mage::log($e->getMessage(), null, 'Increasingly_Analytics.log');
|
73 |
+
|
74 |
+
$this->getResponse()
|
75 |
+
->setBody(json_encode(array('status' => 'error', 'message' => $e->getMessage(), 'version' => $version)))
|
76 |
+
->setHttpResponseCode(500)
|
77 |
+
->setHeader('Content-type', 'application/json', true);
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
}
|
app/code/community/Increasingly/Analytics/controllers/ProductsApiController.php~
DELETED
@@ -1,208 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Increasingly
|
22 |
-
* @package Increasingly_Analytics
|
23 |
-
* @author Increasingly Pvt Ltd
|
24 |
-
* @copyright Copyright (c) 2015-2016 Increasingly Ltd (http://www.increasingly.co)
|
25 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
-
*/
|
27 |
-
/**
|
28 |
-
* Returns product details to increasingly on API call
|
29 |
-
*/
|
30 |
-
|
31 |
-
class Increasingly_Analytics_ProductsApiController extends Mage_Core_Controller_Front_Action
|
32 |
-
{
|
33 |
-
|
34 |
-
public function productsAction()
|
35 |
-
{
|
36 |
-
try
|
37 |
-
{
|
38 |
-
$version = (string)Mage::getConfig()->getModuleConfig("Increasingly_Analytics")->version;
|
39 |
-
|
40 |
-
if(!$this->isRequestAuthorized())
|
41 |
-
{
|
42 |
-
return $this;
|
43 |
-
}
|
44 |
-
|
45 |
-
$products = array();
|
46 |
-
$productFormatHelper = Mage::helper('increasingly_analytics/ProductFormatter');
|
47 |
-
|
48 |
-
// $attributes = array(
|
49 |
-
// 'name',
|
50 |
-
// 'sku',
|
51 |
-
// 'image',
|
52 |
-
// 'manufacturer',
|
53 |
-
// 'price',
|
54 |
-
// 'final_price',
|
55 |
-
// 'special_price',
|
56 |
-
// 'description',
|
57 |
-
// 'short_description',
|
58 |
-
// 'color',
|
59 |
-
// 'weight',
|
60 |
-
// 'size'
|
61 |
-
// );
|
62 |
-
|
63 |
-
$limit = $this->getRequest()->getParam('limit', 200);
|
64 |
-
$offset = $this->getRequest()->getParam('offset', 1);
|
65 |
-
$tempAttributes = array();
|
66 |
-
$productsCollection = Mage::getModel('catalog/product')->getCollection();
|
67 |
-
$tempProduct = $productsCollection->getFirstItem();
|
68 |
-
$attributes = $tempProduct->getAttributes();
|
69 |
-
foreach ($attributes as $attribute) {
|
70 |
-
if($attribute->getAttributeCode() == 'name')
|
71 |
-
{
|
72 |
-
array_push($tempAttributes,'name');
|
73 |
-
}
|
74 |
-
if($attribute->getAttributeCode() == 'sku')
|
75 |
-
{
|
76 |
-
array_push($tempAttributes,'sku');
|
77 |
-
}
|
78 |
-
if($attribute->getAttributeCode() == 'image')
|
79 |
-
{
|
80 |
-
array_push($tempAttributes,'image');
|
81 |
-
}
|
82 |
-
if($attribute->getAttributeCode() == 'manufacturer')
|
83 |
-
{
|
84 |
-
array_push($tempAttributes,'manufacturer');
|
85 |
-
}
|
86 |
-
if($attribute->getAttributeCode() == 'price')
|
87 |
-
{
|
88 |
-
array_push($tempAttributes,'price');
|
89 |
-
}
|
90 |
-
if($attribute->getAttributeCode() == 'special_price')
|
91 |
-
{
|
92 |
-
array_push($tempAttributes,'special_price');
|
93 |
-
}
|
94 |
-
if($attribute->getAttributeCode() == 'description')
|
95 |
-
{
|
96 |
-
array_push($tempAttributes,'description');
|
97 |
-
}
|
98 |
-
if($attribute->getAttributeCode() == 'short_description')
|
99 |
-
{
|
100 |
-
array_push($tempAttributes,'short_description');
|
101 |
-
}
|
102 |
-
if($attribute->getAttributeCode() == 'color')
|
103 |
-
{
|
104 |
-
array_push($tempAttributes,'color');
|
105 |
-
}
|
106 |
-
if($attribute->getAttributeCode() == 'weight')
|
107 |
-
{
|
108 |
-
array_push($tempAttributes,'weight');
|
109 |
-
}
|
110 |
-
if($attribute->getAttributeCode() == 'size')
|
111 |
-
{
|
112 |
-
array_push($tempAttributes,'size');
|
113 |
-
}
|
114 |
-
}
|
115 |
-
$attributes = $tempAttributes;
|
116 |
-
$productsCollection = Mage::getModel('catalog/product')->getCollection();
|
117 |
-
|
118 |
-
$productsCollection->addAttributeToSelect($attributes)->getSelect()->limit($limit, $offset);
|
119 |
-
|
120 |
-
$totalProductCount = Mage::getModel('catalog/product')->getCollection()->count();
|
121 |
-
|
122 |
-
foreach($productsCollection as $product)
|
123 |
-
{
|
124 |
-
$product = $productFormatHelper->formatProductInfo($product);
|
125 |
-
|
126 |
-
if($product !== null)
|
127 |
-
{
|
128 |
-
$products[] = $product;
|
129 |
-
}
|
130 |
-
}
|
131 |
-
|
132 |
-
$this->getResponse()
|
133 |
-
->setBody(json_encode(array('products' => $products,'version' => $version, 'total_product_count' => $totalProductCount)))
|
134 |
-
->setHttpResponseCode(200)
|
135 |
-
->setHeader('Content-type', 'application/json', true);
|
136 |
-
|
137 |
-
|
138 |
-
} catch(Exception $e) {
|
139 |
-
|
140 |
-
Mage::log($e->getMessage(), null, 'Increasingly_Analytics.log');
|
141 |
-
|
142 |
-
$this->getResponse()
|
143 |
-
->setBody(json_encode(array('status' => 'error', 'message' => $e->getMessage(), 'version' => $version)))
|
144 |
-
->setHttpResponseCode(500)
|
145 |
-
->setHeader('Content-type', 'application/json', true);
|
146 |
-
}
|
147 |
-
|
148 |
-
return $this;
|
149 |
-
|
150 |
-
}
|
151 |
-
|
152 |
-
private function isRequestAuthorized()
|
153 |
-
{
|
154 |
-
$helper = Mage::helper('increasingly_analytics');
|
155 |
-
|
156 |
-
if ($helper->isEnabled())
|
157 |
-
{
|
158 |
-
$apiKey = $helper->getApiToken();
|
159 |
-
$version = (string)Mage::getConfig()->getModuleConfig("Increasingly_Analytics")->version;
|
160 |
-
|
161 |
-
// Check for api key
|
162 |
-
if(!$apiKey && strlen($apiKey) === 0) {
|
163 |
-
|
164 |
-
$this->getResponse()
|
165 |
-
->setBody(json_encode(array('status' => 'error', 'message' => 'API key is missing', 'version' => $version)))
|
166 |
-
->setHttpResponseCode(403)
|
167 |
-
->setHeader('Content-type', 'application/json', true);
|
168 |
-
return false;
|
169 |
-
}
|
170 |
-
|
171 |
-
$authKey = $this->getRequest()->getHeader('authKey');
|
172 |
-
|
173 |
-
if (!$authKey || strlen($authKey) == 0) {
|
174 |
-
$authKey = $this->getRequest()->getParam('authKey');
|
175 |
-
}
|
176 |
-
|
177 |
-
if (!$authKey) {
|
178 |
-
|
179 |
-
$this->getResponse()
|
180 |
-
->setBody(json_encode(array('status' => 'error', 'message' => 'Error,Authorization header not found', 'version' => $version)))
|
181 |
-
->setHttpResponseCode(500)
|
182 |
-
->setHeader('Content-type', 'application/json', true);
|
183 |
-
return false;
|
184 |
-
}
|
185 |
-
|
186 |
-
if(trim($authKey) !== trim($apiKey)) {
|
187 |
-
|
188 |
-
$this->getResponse()
|
189 |
-
->setBody(json_encode(array('status' => 'error', 'message' => 'Authorization failed', 'version' => $version)))
|
190 |
-
->setHttpResponseCode(401)
|
191 |
-
->setHeader('Content-type', 'application/json', true);
|
192 |
-
return false;
|
193 |
-
}
|
194 |
-
|
195 |
-
return true;
|
196 |
-
}
|
197 |
-
else {
|
198 |
-
|
199 |
-
$this->getResponse()
|
200 |
-
->setBody(json_encode(array('status' => 'error', 'message' => 'Increasingly module is disabled', 'version' => $version)))
|
201 |
-
->setHttpResponseCode(403)
|
202 |
-
->setHeader('Content-type', 'application/json', true);
|
203 |
-
return false;
|
204 |
-
}
|
205 |
-
|
206 |
-
}
|
207 |
-
|
208 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Increasingly/Analytics/etc/config.xml
CHANGED
@@ -32,7 +32,7 @@
|
|
32 |
<config>
|
33 |
<modules>
|
34 |
<Increasingly_Analytics>
|
35 |
-
<version>1.0.
|
36 |
</Increasingly_Analytics>
|
37 |
</modules>
|
38 |
<global>
|
32 |
<config>
|
33 |
<modules>
|
34 |
<Increasingly_Analytics>
|
35 |
+
<version>1.0.11</version>
|
36 |
</Increasingly_Analytics>
|
37 |
</modules>
|
38 |
<global>
|
app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.11.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
CREATE TABLE IF NOT EXISTS {$this->getTable('increasingly_analytics_bundle')} (
|
10 |
+
|
11 |
+
`id` int NOT NULL auto_increment,
|
12 |
+
|
13 |
+
`bundle_id` int NOT NULL default 0,
|
14 |
+
|
15 |
+
`product_ids` varchar(100) NOT NULL,
|
16 |
+
|
17 |
+
`increasingly_visitor_id` varchar(100) NOT NULL,
|
18 |
+
|
19 |
+
`discount_price` decimal(12,4) NULL,
|
20 |
+
|
21 |
+
`total_price` decimal(12,4) NOT NULL,
|
22 |
+
|
23 |
+
PRIMARY KEY (`id`)
|
24 |
+
|
25 |
+
);
|
26 |
+
|
27 |
+
");
|
28 |
+
|
29 |
+
$installer->endSetup();
|
app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/{mysql4-install-1.0.10.php~ → mysql4-install-1.0.11.php~}
RENAMED
File without changes
|
app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.9.php~
DELETED
File without changes
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>increasingly_key</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -44,11 +44,11 @@ It's free to try & we have a 14-day trial where you can test it for no-risk
|
|
44 |

|
45 |
We have a dashboard which provides you with in depth analytics and insights on what's sells together & allows you to administer and manage your bundles.
|
46 |
</description>
|
47 |
-
<notes>Added
|
48 |
<authors><author><name>Increasingly</name><user>Increasingly</user><email>renu@increasingly.co</email></author><author><name>Increasingly</name><user>Increasingly</user><email>shree@increasingly.co</email></author><author><name>Increasingly</name><user>Increasingly</user><email>satish@increasingly.co</email></author></authors>
|
49 |
-
<date>2016-08-
|
50 |
-
<time>
|
51 |
-
<contents><target name="magecommunity"><dir name="Increasingly"><dir name="Analytics"><dir name="Block"><file name="Addtocart.php" hash="3429b60b501c7681a3c79fd46138b787"/><dir name="Adminhtml"><file name="DataIntegration.php" hash="b7c543b33f563ef458d403df94c62a4c"/></dir><file name="Cart.php" hash="56c9f503b7c55d835cbd93c675dcc338"/><file name="Category.php" hash="3b87f305e0957dd1fdace455c1f0fa7c"/><file name="Element.php" hash="8d533705e7a3c1ada7d775a6d9282f43"/><file name="Embed.php" hash="5ba08a6642ed22d8bb1a84ab0501f8dc"/><file name="Pagetype.php" hash="f670440a3f90bfa9a48b406fc37d538c"/><file name="Product.php" hash="2da759eb9bd2bf13e5a8a92087981206"/><file name="Track.php" hash="aa6a9d870f14c4e3721675658dfb276e"/></dir><dir name="Helper"><file name="Data.php" hash="5040e70b54e323a88a319d4b8088a47c"/><file name="DateFormatter.php" hash="d8f963bd1f9fe390e038a2065fd5c4c4"/><file name="PriceFormatter.php" hash="9bc46d3afb4612131a29b9a1c2b82fad"/><file name="ProductFormatter.php" hash="1649d3e66567749adaf30ea69240c485"
|
52 |
<compatible/>
|
53 |
<dependencies><required><php><min>5.2.0</min><max>7.0.7</max></php></required></dependencies>
|
54 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>increasingly_key</name>
|
4 |
+
<version>1.0.11</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
44 |

|
45 |
We have a dashboard which provides you with in depth analytics and insights on what's sells together & allows you to administer and manage your bundles.
|
46 |
</description>
|
47 |
+
<notes>Added feature to import error logs.</notes>
|
48 |
<authors><author><name>Increasingly</name><user>Increasingly</user><email>renu@increasingly.co</email></author><author><name>Increasingly</name><user>Increasingly</user><email>shree@increasingly.co</email></author><author><name>Increasingly</name><user>Increasingly</user><email>satish@increasingly.co</email></author></authors>
|
49 |
+
<date>2016-08-11</date>
|
50 |
+
<time>13:09:26</time>
|
51 |
+
<contents><target name="magecommunity"><dir name="Increasingly"><dir name="Analytics"><dir name="Block"><file name="Addtocart.php" hash="3429b60b501c7681a3c79fd46138b787"/><dir name="Adminhtml"><file name="DataIntegration.php" hash="b7c543b33f563ef458d403df94c62a4c"/></dir><file name="Cart.php" hash="56c9f503b7c55d835cbd93c675dcc338"/><file name="Category.php" hash="3b87f305e0957dd1fdace455c1f0fa7c"/><file name="Element.php" hash="8d533705e7a3c1ada7d775a6d9282f43"/><file name="Embed.php" hash="5ba08a6642ed22d8bb1a84ab0501f8dc"/><file name="Pagetype.php" hash="f670440a3f90bfa9a48b406fc37d538c"/><file name="Product.php" hash="2da759eb9bd2bf13e5a8a92087981206"/><file name="Track.php" hash="aa6a9d870f14c4e3721675658dfb276e"/></dir><dir name="Helper"><file name="Data.php" hash="5040e70b54e323a88a319d4b8088a47c"/><file name="DateFormatter.php" hash="d8f963bd1f9fe390e038a2065fd5c4c4"/><file name="PriceFormatter.php" hash="9bc46d3afb4612131a29b9a1c2b82fad"/><file name="ProductFormatter.php" hash="1649d3e66567749adaf30ea69240c485"/></dir><dir name="Model"><file name="Base.php" hash="957cc5bb083e9b49b5468c986a1e846a"/><file name="Bundle.php" hash="767a26eaefaed893d163737d64930933"/><file name="DataIntegration.php" hash="ff9dc202ea17e49ceaba09c6190492cd"/><dir name="Meta"><file name="Product.php" hash="6a037e5325193fae3147fc1a9891606c"/></dir><dir name="Mysql4"><dir name="Bundle"><file name="Collection.php" hash="021c49a92767b78e238477a3dc8da783"/></dir><file name="Bundle.php" hash="83ad548248f3ebcfc73158ab672cb683"/><file name="Setup.php" hash="664019080c6c0ebdbc50b889eac1e1e0"/></dir><file name="Observer.php" hash="3f50c7b59b931584b18a2f9693cb7c72"/><file name="Product.php" hash="f473c25a470a2509b00a4a15ed8b857f"/></dir><dir name="controllers"><file name="AddbundletocartController.php" hash="d9de59fcb68d0d27326f8ccfa24d1486"/><dir name="Adminhtml"><file name="DataIntegrationController.php" hash="0758d4716d337002a8c49f843e06cec2"/></dir><file name="ImportLogsController.php" hash="6bd66caf8ca7fd21f6a95230adcb7f32"/><file name="ProductsApiController.php" hash="273e67873d1f005310182863b3c4576b"/></dir><dir name="etc"><file name="config.xml" hash="300ebe2f4fcc426f3c7cb9f5b955963a"/><file name="config.xml~" hash="172a5e5b79afffc27ba28ace695bc61d"/></dir><dir name="sql"><dir name="increasingly_analytics_setup"><file name="mysql-install-1.0.0.php" hash="bddf4e67e7b69c5604b448e3b1fa27a0"/><file name="mysql4-install-1.0.10.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.11.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.11.php~" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="mysql4-install-1.0.3.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.4.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.5.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.6.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.7.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.8.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.9.php" hash="e857df177cfbb887cece6de0ff5498b6"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="increasingly"><file name="dataintegration.phtml" hash="8a730e566c21b2155d6f3e4ca73a1b6d"/></dir></dir><dir name="layout"><file name="increasingly_analytics.xml" hash="d859a26dba5142f02e514f28f507891c"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="increasingly"><file name="addtocart.phtml" hash="e3af2445ac014887b3072cf85dd81d4f"/><file name="cart.phtml" hash="1c5ee986109cfb4600d3e15057263d36"/><file name="category.phtml" hash="75e77b9d1cbbd1e0129c0c10737461e6"/><file name="element.phtml" hash="c5f1cbbc02801009247409890172ca4e"/><file name="embed.phtml" hash="52cde76a239e3084ce3a1254b004a742"/><file name="pagetype.phtml" hash="fe1a7f313c82f355f14d5f13c284cb28"/><file name="product.phtml" hash="14d24b0ced5abc85619aa3538b21f2f7"/><file name="track.phtml" hash="4473f97cc5aa3a02bf0a87877b14b5eb"/></dir></dir><dir name="layout"><file name="increasingly_analytics.xml" hash="8fdd89adb4a85e83237ada872ba43f88"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Increasingly_Analytics.xml" hash="d285a9ae62b5b0624b727e341fe8e005"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="increasingly"><file name="loader.gif" hash="a51c5608d01acf32df728f299767f82b"/></dir></dir></dir></dir></target></contents>
|
52 |
<compatible/>
|
53 |
<dependencies><required><php><min>5.2.0</min><max>7.0.7</max></php></required></dependencies>
|
54 |
</package>
|