Version Notes
Added code to check product attribute availability.
Fetching Visibility attribute for product.
Download this release
Release Info
Developer | Increasingly |
Extension | increasingly_key |
Version | 1.0.9 |
Comparing to | |
See all releases |
Code changes from version 1.0.8 to 1.0.9
- app/code/community/Increasingly/Analytics/Helper/ProductFormatter.php +80 -15
- app/code/community/Increasingly/Analytics/Helper/ProductFormatter.php~ +264 -0
- app/code/community/Increasingly/Analytics/controllers/ProductsApiController.php +5 -1
- app/code/community/Increasingly/Analytics/controllers/ProductsApiController.php~ +208 -0
- app/code/community/Increasingly/Analytics/etc/config.xml +1 -1
- app/code/community/Increasingly/Analytics/etc/config.xml~ +250 -0
- app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.9.php +29 -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
CHANGED
@@ -41,21 +41,58 @@ class Increasingly_Analytics_Helper_ProductFormatter extends Mage_Core_Helper_Ab
|
|
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 |
-
|
49 |
-
|
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 |
$productDefaultImage = $product->getData('image');
|
60 |
if(!empty($productDefaultImage) && $productDefaultImage !== 'no_selection')
|
61 |
{
|
@@ -66,30 +103,53 @@ class Increasingly_Analytics_Helper_ProductFormatter extends Mage_Core_Helper_Ab
|
|
66 |
{
|
67 |
$productData['image_url'] = '';
|
68 |
}
|
|
|
|
|
|
|
|
|
69 |
$manufacturer = $product->getAttributeText('manufacturer');
|
70 |
if(strlen($manufacturer) > 0 && $manufacturer != false)
|
71 |
{
|
72 |
$productData['manufacturer'] = $manufacturer;
|
73 |
}
|
|
|
74 |
|
|
|
|
|
75 |
$color = $product->getAttributeText('color');
|
76 |
if(strlen($color) > 0 && $color != false)
|
77 |
{
|
78 |
$productData['color'] = $color;
|
|
|
79 |
}
|
80 |
|
81 |
-
$
|
82 |
-
if(strlen($weight) > 0 && $weight != false)
|
83 |
{
|
84 |
-
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
|
87 |
-
$
|
88 |
-
if(strlen($size) > 0 && $size != false)
|
89 |
{
|
90 |
-
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
if($productData['product_type'] == "configurable")
|
94 |
{
|
95 |
$configurableProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($productData['product_id']);
|
@@ -106,7 +166,6 @@ class Increasingly_Analytics_Helper_ProductFormatter extends Mage_Core_Helper_Ab
|
|
106 |
|
107 |
if($productData['product_type'] == "grouped")
|
108 |
{
|
109 |
-
|
110 |
$groupedProducts = Mage::getModel('catalog/product_type_grouped')->getChildrenIds($productData['product_id']);
|
111 |
$grouped_items = array();
|
112 |
|
@@ -167,6 +226,8 @@ class Increasingly_Analytics_Helper_ProductFormatter extends Mage_Core_Helper_Ab
|
|
167 |
$productData['categories'][] = $categoryInfo;
|
168 |
}
|
169 |
|
|
|
|
|
170 |
$otherImages = $product->getMediaGalleryImages();
|
171 |
|
172 |
if($otherImages == '' || count($otherImages) == 0)
|
@@ -184,7 +245,11 @@ class Increasingly_Analytics_Helper_ProductFormatter extends Mage_Core_Helper_Ab
|
|
184 |
$productData['other_image_list'][] = $img->getUrl();
|
185 |
}
|
186 |
}
|
187 |
-
}
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
catch(Exception $e)
|
190 |
{
|
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 |
+
if($product->getResource()->getAttribute('image'))
|
95 |
+
{
|
96 |
$productDefaultImage = $product->getData('image');
|
97 |
if(!empty($productDefaultImage) && $productDefaultImage !== 'no_selection')
|
98 |
{
|
103 |
{
|
104 |
$productData['image_url'] = '';
|
105 |
}
|
106 |
+
}
|
107 |
+
|
108 |
+
if($product->getResource()->getAttribute('manufacturer'))
|
109 |
+
{
|
110 |
$manufacturer = $product->getAttributeText('manufacturer');
|
111 |
if(strlen($manufacturer) > 0 && $manufacturer != false)
|
112 |
{
|
113 |
$productData['manufacturer'] = $manufacturer;
|
114 |
}
|
115 |
+
}
|
116 |
|
117 |
+
if($product->getResource()->getAttribute('color'))
|
118 |
+
{
|
119 |
$color = $product->getAttributeText('color');
|
120 |
if(strlen($color) > 0 && $color != false)
|
121 |
{
|
122 |
$productData['color'] = $color;
|
123 |
+
}
|
124 |
}
|
125 |
|
126 |
+
if($product->getResource()->getAttribute('weight'))
|
|
|
127 |
{
|
128 |
+
$weight = $product->getWeight();
|
129 |
+
if(strlen($weight) > 0 && $weight != false)
|
130 |
+
{
|
131 |
+
$productData['weight'] = $weight;
|
132 |
+
}
|
133 |
}
|
134 |
|
135 |
+
if($product->getResource()->getAttribute('size'))
|
|
|
136 |
{
|
137 |
+
$size = $product->getAttributeText('size');
|
138 |
+
if(strlen($size) > 0 && $size != false)
|
139 |
+
{
|
140 |
+
$productData['size'] = $size;
|
141 |
+
}
|
142 |
}
|
143 |
|
144 |
+
if($product->getResource()->getAttribute('visibility'))
|
145 |
+
{
|
146 |
+
$visibility = $product->getAttributeText('visibility');
|
147 |
+
if(strlen($visibility) > 0 && $visibility != false)
|
148 |
+
{
|
149 |
+
$productData['visibility'] = $visibility;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
if($productData['product_type'] == "configurable")
|
154 |
{
|
155 |
$configurableProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($productData['product_id']);
|
166 |
|
167 |
if($productData['product_type'] == "grouped")
|
168 |
{
|
|
|
169 |
$groupedProducts = Mage::getModel('catalog/product_type_grouped')->getChildrenIds($productData['product_id']);
|
170 |
$grouped_items = array();
|
171 |
|
226 |
$productData['categories'][] = $categoryInfo;
|
227 |
}
|
228 |
|
229 |
+
if($product->getResource()->getAttribute('media_gallery'))
|
230 |
+
{
|
231 |
$otherImages = $product->getMediaGalleryImages();
|
232 |
|
233 |
if($otherImages == '' || count($otherImages) == 0)
|
245 |
$productData['other_image_list'][] = $img->getUrl();
|
246 |
}
|
247 |
}
|
248 |
+
}
|
249 |
+
|
250 |
+
}
|
251 |
+
|
252 |
+
|
253 |
}
|
254 |
catch(Exception $e)
|
255 |
{
|
app/code/community/Increasingly/Analytics/Helper/ProductFormatter.php~
ADDED
@@ -0,0 +1,264 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
if($product->getResource()->getAttribute('image'))
|
95 |
+
{
|
96 |
+
$productDefaultImage = $product->getData('image');
|
97 |
+
if(!empty($productDefaultImage) && $productDefaultImage !== 'no_selection')
|
98 |
+
{
|
99 |
+
//$productData['image_url'] = $product->getImageUrl();
|
100 |
+
$productData['image_url'] = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage());
|
101 |
+
}
|
102 |
+
else
|
103 |
+
{
|
104 |
+
$productData['image_url'] = '';
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
if($product->getResource()->getAttribute('manufacturer'))
|
109 |
+
{
|
110 |
+
$manufacturer = $product->getAttributeText('manufacturer');
|
111 |
+
if(strlen($manufacturer) > 0 && $manufacturer != false)
|
112 |
+
{
|
113 |
+
$productData['manufacturer'] = $manufacturer;
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
if($product->getResource()->getAttribute('color'))
|
118 |
+
{
|
119 |
+
$color = $product->getAttributeText('color');
|
120 |
+
if(strlen($color) > 0 && $color != false)
|
121 |
+
{
|
122 |
+
$productData['color'] = $color;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
if($product->getResource()->getAttribute('weight'))
|
127 |
+
{
|
128 |
+
$weight = $product->getWeight();
|
129 |
+
if(strlen($weight) > 0 && $weight != false)
|
130 |
+
{
|
131 |
+
$productData['weight'] = $weight;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
if($product->getResource()->getAttribute('size'))
|
136 |
+
{
|
137 |
+
$size = $product->getAttributeText('size');
|
138 |
+
if(strlen($size) > 0 && $size != false)
|
139 |
+
{
|
140 |
+
$productData['size'] = $size;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
if($product->getResource()->getAttribute('visibility'))
|
145 |
+
{
|
146 |
+
$visibility = $product->getAttributeText('visibility');
|
147 |
+
if(strlen($visibility) > 0 && $visibility != false)
|
148 |
+
{
|
149 |
+
$productData['visibility'] = $visibility;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
if($productData['product_type'] == "configurable")
|
154 |
+
{
|
155 |
+
$configurableProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($productData['product_id']);
|
156 |
+
$configurable_items = array();
|
157 |
+
foreach($configurableProducts as $key=>$configurableProductList)
|
158 |
+
{
|
159 |
+
foreach($configurableProductList as $itemValue)
|
160 |
+
{
|
161 |
+
$configurable_items[] = $itemValue;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
$productData['associated_products'] = $configurable_items;
|
165 |
+
}
|
166 |
+
|
167 |
+
if($productData['product_type'] == "grouped")
|
168 |
+
{
|
169 |
+
$groupedProducts = Mage::getModel('catalog/product_type_grouped')->getChildrenIds($productData['product_id']);
|
170 |
+
$grouped_items = array();
|
171 |
+
|
172 |
+
foreach($groupedProducts as $key=>$groupedProductList)
|
173 |
+
{
|
174 |
+
foreach($groupedProductList as $itemValue)
|
175 |
+
{
|
176 |
+
$grouped_items[] = $itemValue;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
$productData['associated_products'] = $grouped_items;
|
180 |
+
}
|
181 |
+
|
182 |
+
if($productData['product_type'] == "bundle")
|
183 |
+
{
|
184 |
+
$selectionCollection = $product->getTypeInstance(true)->getSelectionsCollection(
|
185 |
+
$product->getTypeInstance(true)->getOptionsIds($product), $product);
|
186 |
+
|
187 |
+
$bundled_items = array();
|
188 |
+
foreach($selectionCollection as $option)
|
189 |
+
{
|
190 |
+
$bundled_items[] = $option->getId();
|
191 |
+
}
|
192 |
+
$productData['associated_products'] = $bundled_items;
|
193 |
+
}
|
194 |
+
|
195 |
+
$relatedProducts = $product->getRelatedProductIds();
|
196 |
+
if(count($relatedProducts) > 0)
|
197 |
+
{
|
198 |
+
$productData['related_products'] = $relatedProducts;
|
199 |
+
}
|
200 |
+
|
201 |
+
$upSellProducts = $product->getUpSellProductIds();
|
202 |
+
if(count($upSellProducts) > 0)
|
203 |
+
{
|
204 |
+
$productData['up_sell_products'] = $upSellProducts;
|
205 |
+
}
|
206 |
+
|
207 |
+
$crossSellProducts = $product->getCrossSellProductIds();
|
208 |
+
if(count($crossSellProducts) > 0)
|
209 |
+
{
|
210 |
+
$productData['cross_sell_products'] = $crossSellProducts;
|
211 |
+
}
|
212 |
+
|
213 |
+
// get stock info
|
214 |
+
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
|
215 |
+
$productData['qty'] = (int)$stock->getQty();
|
216 |
+
|
217 |
+
$categories = $product->getCategoryCollection()
|
218 |
+
->addAttributeToSelect('id')
|
219 |
+
->addAttributeToSelect('name');
|
220 |
+
|
221 |
+
foreach($categories as $category)
|
222 |
+
{
|
223 |
+
$categoryInfo = array();
|
224 |
+
$categoryInfo['id'] = $category->getId();
|
225 |
+
$categoryInfo['name'] = $category->getName();
|
226 |
+
$productData['categories'][] = $categoryInfo;
|
227 |
+
}
|
228 |
+
|
229 |
+
if($product->getResource()->getAttribute('media_gallery'))
|
230 |
+
{
|
231 |
+
$otherImages = $product->getMediaGalleryImages();
|
232 |
+
|
233 |
+
if($otherImages == '' || count($otherImages) == 0)
|
234 |
+
{
|
235 |
+
$productImage_Data = Mage::getModel('catalog/product')->load($product->getId());
|
236 |
+
$otherImages = $productImage_Data->getMediaGalleryImages();
|
237 |
+
}
|
238 |
+
|
239 |
+
if(count($otherImages) > 1)
|
240 |
+
{
|
241 |
+
foreach($otherImages as $img)
|
242 |
+
{
|
243 |
+
if($img->getFile() != $productDefaultImage)
|
244 |
+
{
|
245 |
+
$productData['other_image_list'][] = $img->getUrl();
|
246 |
+
}
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
}
|
251 |
+
|
252 |
+
|
253 |
+
}
|
254 |
+
catch(Exception $e)
|
255 |
+
{
|
256 |
+
Mage::log($e, null, 'Increasingly_Analytics.log');
|
257 |
+
}
|
258 |
+
|
259 |
+
return $productData;
|
260 |
+
}
|
261 |
+
|
262 |
+
}
|
263 |
+
|
264 |
+
|
app/code/community/Increasingly/Analytics/controllers/ProductsApiController.php
CHANGED
@@ -110,7 +110,11 @@ class Increasingly_Analytics_ProductsApiController extends Mage_Core_Controller_
|
|
110 |
if($attribute->getAttributeCode() == 'size')
|
111 |
{
|
112 |
array_push($tempAttributes,'size');
|
113 |
-
}
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
$attributes = $tempAttributes;
|
116 |
$productsCollection = Mage::getModel('catalog/product')->getCollection();
|
110 |
if($attribute->getAttributeCode() == 'size')
|
111 |
{
|
112 |
array_push($tempAttributes,'size');
|
113 |
+
}
|
114 |
+
if($attribute->getAttributeCode() == 'visibility')
|
115 |
+
{
|
116 |
+
array_push($tempAttributes,'visibility');
|
117 |
+
}
|
118 |
}
|
119 |
$attributes = $tempAttributes;
|
120 |
$productsCollection = Mage::getModel('catalog/product')->getCollection();
|
app/code/community/Increasingly/Analytics/controllers/ProductsApiController.php~
ADDED
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.9</version>
|
36 |
</Increasingly_Analytics>
|
37 |
</modules>
|
38 |
<global>
|
app/code/community/Increasingly/Analytics/etc/config.xml~
ADDED
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
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 |
+
/**
|
29 |
+
* @package Increasingly_Analytics
|
30 |
+
*/
|
31 |
+
-->
|
32 |
+
<config>
|
33 |
+
<modules>
|
34 |
+
<Increasingly_Analytics>
|
35 |
+
<version>1.0.8</version>
|
36 |
+
</Increasingly_Analytics>
|
37 |
+
</modules>
|
38 |
+
<global>
|
39 |
+
<events>
|
40 |
+
<controller_action_layout_generate_blocks_after>
|
41 |
+
<observers>
|
42 |
+
<page_view>
|
43 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
44 |
+
<method>trackPageView</method>
|
45 |
+
<type>singleton</type>
|
46 |
+
</page_view>
|
47 |
+
</observers>
|
48 |
+
</controller_action_layout_generate_blocks_after>
|
49 |
+
<checkout_cart_product_add_after>
|
50 |
+
<observers>
|
51 |
+
<add_to_cart>
|
52 |
+
<type>singleton</type>
|
53 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
54 |
+
<method>addToCart</method>
|
55 |
+
</add_to_cart>
|
56 |
+
</observers>
|
57 |
+
</checkout_cart_product_add_after>
|
58 |
+
<sales_quote_remove_item>
|
59 |
+
<observers>
|
60 |
+
<remove_from_cart>
|
61 |
+
<type>singleton</type>
|
62 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
63 |
+
<method>removeFromCart</method>
|
64 |
+
</remove_from_cart>
|
65 |
+
</observers>
|
66 |
+
</sales_quote_remove_item>
|
67 |
+
<sales_order_place_after>
|
68 |
+
<observers>
|
69 |
+
<place_order>
|
70 |
+
<type>singleton</type>
|
71 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
72 |
+
<method>trackNewOrder</method>
|
73 |
+
</place_order>
|
74 |
+
</observers>
|
75 |
+
</sales_order_place_after>
|
76 |
+
<sales_quote_collect_totals_after>
|
77 |
+
<observers>
|
78 |
+
<apply_cart_discount>
|
79 |
+
<type>singleton</type>
|
80 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
81 |
+
<method>applyCartDiscount</method>
|
82 |
+
</apply_cart_discount>
|
83 |
+
</observers>
|
84 |
+
</sales_quote_collect_totals_after>
|
85 |
+
<sales_quote_save_after>
|
86 |
+
<observers>
|
87 |
+
<empty_cart>
|
88 |
+
<type>singleton</type>
|
89 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
90 |
+
<method>empty_cart</method>
|
91 |
+
</empty_cart>
|
92 |
+
</observers>
|
93 |
+
</sales_quote_save_after>
|
94 |
+
<catalog_product_save_commit_after>
|
95 |
+
<observers>
|
96 |
+
<product_update>
|
97 |
+
<type>singleton</type>
|
98 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
99 |
+
<method>productAddOrUpdate</method>
|
100 |
+
</product_update>
|
101 |
+
</observers>
|
102 |
+
</catalog_product_save_commit_after>
|
103 |
+
<catalog_product_delete_commit_after>
|
104 |
+
<observers>
|
105 |
+
<product_delete>
|
106 |
+
<type>singleton</type>
|
107 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
108 |
+
<method>productDelete</method>
|
109 |
+
</product_delete>
|
110 |
+
</observers>
|
111 |
+
</catalog_product_delete_commit_after>
|
112 |
+
<admin_system_config_changed_section_carriers>
|
113 |
+
<observers>
|
114 |
+
<import_shipping_details>
|
115 |
+
<type>singleton</type>
|
116 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
117 |
+
<method>importShippingDetails</method>
|
118 |
+
</import_shipping_details>
|
119 |
+
</observers>
|
120 |
+
</admin_system_config_changed_section_carriers>
|
121 |
+
</events>
|
122 |
+
<models>
|
123 |
+
<increasingly_analytics>
|
124 |
+
<class>Increasingly_Analytics_Model</class>
|
125 |
+
<resourceModel>increasingly_analytics_mysql4</resourceModel>
|
126 |
+
</increasingly_analytics>
|
127 |
+
<increasingly_analytics_mysql4>
|
128 |
+
<class>Increasingly_Analytics_Model_Mysql4</class>
|
129 |
+
<entities>
|
130 |
+
<bundle>
|
131 |
+
<table>increasingly_analytics_bundle</table>
|
132 |
+
</bundle>
|
133 |
+
</entities>
|
134 |
+
</increasingly_analytics_mysql4>
|
135 |
+
</models>
|
136 |
+
<resources>
|
137 |
+
<increasingly_analytics_setup>
|
138 |
+
<setup>
|
139 |
+
<module>Increasingly_Analytics</module>
|
140 |
+
<class>Increasingly_Analytics_Model_Mysql4_Setup</class>
|
141 |
+
</setup>
|
142 |
+
<connection>
|
143 |
+
<use>core_setup</use>
|
144 |
+
</connection>
|
145 |
+
</increasingly_analytics_setup>
|
146 |
+
<increasingly_analytics_write>
|
147 |
+
<connection>
|
148 |
+
<use>core_write</use>
|
149 |
+
</connection>
|
150 |
+
</increasingly_analytics_write>
|
151 |
+
<increasingly_analytics_read>
|
152 |
+
<connection>
|
153 |
+
<use>core_read</use>
|
154 |
+
</connection>
|
155 |
+
</increasingly_analytics_read>
|
156 |
+
</resources>
|
157 |
+
<blocks>
|
158 |
+
<increasingly_analytics>
|
159 |
+
<class>Increasingly_Analytics_Block</class>
|
160 |
+
</increasingly_analytics>
|
161 |
+
</blocks>
|
162 |
+
<helpers>
|
163 |
+
<increasingly_analytics>
|
164 |
+
<class>Increasingly_Analytics_Helper</class>
|
165 |
+
</increasingly_analytics>
|
166 |
+
</helpers>
|
167 |
+
</global>
|
168 |
+
<frontend>
|
169 |
+
<layout>
|
170 |
+
<updates>
|
171 |
+
<increasingly_analytics>
|
172 |
+
<file>increasingly_analytics.xml</file>
|
173 |
+
</increasingly_analytics>
|
174 |
+
</updates>
|
175 |
+
</layout>
|
176 |
+
<routers>
|
177 |
+
<increasingly_analytics>
|
178 |
+
<use>standard</use>
|
179 |
+
<args>
|
180 |
+
<module>Increasingly_Analytics</module>
|
181 |
+
<frontName>increasingly</frontName>
|
182 |
+
</args>
|
183 |
+
</increasingly_analytics>
|
184 |
+
</routers>
|
185 |
+
<events>
|
186 |
+
<customer_login>
|
187 |
+
<observers>
|
188 |
+
<increasingly_login>
|
189 |
+
<type>singleton</type>
|
190 |
+
<class>Increasingly_Analytics_Model_Observer</class>
|
191 |
+
<method>customerLogin</method>
|
192 |
+
</increasingly_login>
|
193 |
+
</observers>
|
194 |
+
</customer_login>
|
195 |
+
</events>
|
196 |
+
</frontend>
|
197 |
+
<admin>
|
198 |
+
<routers>
|
199 |
+
<adminhtml>
|
200 |
+
<args>
|
201 |
+
<modules>
|
202 |
+
<Increasingly_Analytics before="Mage_adminhtml">Increasingly_Analytics_Adminhtml</Increasingly_Analytics>
|
203 |
+
</modules>
|
204 |
+
</args>
|
205 |
+
</adminhtml>
|
206 |
+
</routers>
|
207 |
+
</admin>
|
208 |
+
<adminhtml>
|
209 |
+
<acl>
|
210 |
+
<resources>
|
211 |
+
<admin>
|
212 |
+
<children>
|
213 |
+
<system>
|
214 |
+
<children>
|
215 |
+
<config>
|
216 |
+
<children>
|
217 |
+
<increasingly_analytics>
|
218 |
+
<title>Increasingly Configuration</title>
|
219 |
+
</increasingly_analytics>
|
220 |
+
</children>
|
221 |
+
</config>
|
222 |
+
</children>
|
223 |
+
</system>
|
224 |
+
</children>
|
225 |
+
</admin>
|
226 |
+
</resources>
|
227 |
+
</acl>
|
228 |
+
<layout>
|
229 |
+
<updates>
|
230 |
+
<increasingly_analytics>
|
231 |
+
<file>increasingly_analytics.xml</file>
|
232 |
+
</increasingly_analytics>
|
233 |
+
</updates>
|
234 |
+
</layout>
|
235 |
+
<menu>
|
236 |
+
<increasingly>
|
237 |
+
<title>Increasingly</title>
|
238 |
+
<sort_order>70</sort_order>
|
239 |
+
<action>adminhtml/DataIntegration/index</action>
|
240 |
+
</increasingly>
|
241 |
+
</menu>
|
242 |
+
</adminhtml>
|
243 |
+
<default>
|
244 |
+
<increasingly_analytics>
|
245 |
+
<settings>
|
246 |
+
<enable>0</enable>
|
247 |
+
</settings>
|
248 |
+
</increasingly_analytics>
|
249 |
+
</default>
|
250 |
+
</config>
|
app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.9.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.9.php~
ADDED
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,12 +44,12 @@ 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>
|
48 |
-
|
49 |
<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>
|
50 |
<date>2016-08-10</date>
|
51 |
-
<time>
|
52 |
-
<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="
|
53 |
<compatible/>
|
54 |
<dependencies><required><php><min>5.2.0</min><max>7.0.7</max></php></required></dependencies>
|
55 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>increasingly_key</name>
|
4 |
+
<version>1.0.9</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 code to check product attribute availability.
|
48 |
+
Fetching Visibility attribute for product.</notes>
|
49 |
<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>
|
50 |
<date>2016-08-10</date>
|
51 |
+
<time>16:47:15</time>
|
52 |
+
<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="b3c931c0c00e4393c1eee9054ebab665"/><file name="ProductFormatter.php~" hash="b3c931c0c00e4393c1eee9054ebab665"/></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="ProductsApiController.php" hash="273e67873d1f005310182863b3c4576b"/><file name="ProductsApiController.php~" hash="0c74c69260853b878bb48e97253437bc"/></dir><dir name="etc"><file name="config.xml" hash="7c3bc5117171c1de791c3c2412533cf6"/><file name="config.xml~" hash="1284e9c24288d7081db6166cc2059a25"/></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.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"/><file name="mysql4-install-1.0.9.php~" hash="d41d8cd98f00b204e9800998ecf8427e"/></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>
|
53 |
<compatible/>
|
54 |
<dependencies><required><php><min>5.2.0</min><max>7.0.7</max></php></required></dependencies>
|
55 |
</package>
|