Version Notes
Fixed issue to fetch product description and original image url of product (Instead of cached image).
Download this release
Release Info
Developer | Increasingly |
Extension | increasingly_key |
Version | 1.0.14 |
Comparing to | |
See all releases |
Code changes from version 1.0.13 to 1.0.14
- app/code/community/Increasingly/Analytics/Helper/ProductFormatter.php +46 -5
- app/code/community/Increasingly/Analytics/controllers/ProductsImportApiController.php +34 -1
- app/code/community/Increasingly/Analytics/etc/config.xml +1 -1
- app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.14.php +29 -0
- app/design/frontend/base/default/template/increasingly/track.phtml +2 -2
- package.xml +5 -5
app/code/community/Increasingly/Analytics/Helper/ProductFormatter.php
CHANGED
@@ -68,15 +68,31 @@ class Increasingly_Analytics_Helper_ProductFormatter extends Mage_Core_Helper_Ab
|
|
68 |
$productData['special_price'] = $priceFormatter->format($product->getSpecialPrice());
|
69 |
}
|
70 |
|
71 |
-
if($product->
|
72 |
{
|
73 |
-
$productData['description'] = $product->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
|
76 |
-
if($product->
|
77 |
{
|
78 |
-
|
79 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
if($product->getResource()->getAttribute('status'))
|
82 |
{
|
@@ -96,6 +112,8 @@ class Increasingly_Analytics_Helper_ProductFormatter extends Mage_Core_Helper_Ab
|
|
96 |
$productData['image_url'] = $product->getImageUrl();
|
97 |
}
|
98 |
}
|
|
|
|
|
99 |
|
100 |
if($product->getResource()->getAttribute('manufacturer'))
|
101 |
{
|
@@ -258,6 +276,29 @@ class Increasingly_Analytics_Helper_ProductFormatter extends Mage_Core_Helper_Ab
|
|
258 |
return $productData;
|
259 |
}
|
260 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
}
|
262 |
|
263 |
|
68 |
$productData['special_price'] = $priceFormatter->format($product->getSpecialPrice());
|
69 |
}
|
70 |
|
71 |
+
if ($product->hasData('description'))
|
72 |
{
|
73 |
+
$productData['description'] = $product->getData('description');
|
74 |
+
}
|
75 |
+
|
76 |
+
if($productData['description'] == null || empty($productData['description']))
|
77 |
+
{
|
78 |
+
if($product->getResource()->getAttribute('description'))
|
79 |
+
{
|
80 |
+
$productData['description'] = $product->getDescription();
|
81 |
+
}
|
82 |
}
|
83 |
|
84 |
+
if ($product->hasData('short_description'))
|
85 |
{
|
86 |
+
$productData['short_description'] = $product->getData('short_description');
|
87 |
+
}
|
88 |
+
|
89 |
+
if($productData['short_description'] == null || empty($productData['short_description']))
|
90 |
+
{
|
91 |
+
if($product->getResource()->getAttribute('short_description'))
|
92 |
+
{
|
93 |
+
$productData['short_description'] = $product->getShortDescription();
|
94 |
+
}
|
95 |
+
}
|
96 |
|
97 |
if($product->getResource()->getAttribute('status'))
|
98 |
{
|
112 |
$productData['image_url'] = $product->getImageUrl();
|
113 |
}
|
114 |
}
|
115 |
+
|
116 |
+
$productData['original_image_url'] = $this->buildImageUrl($product);
|
117 |
|
118 |
if($product->getResource()->getAttribute('manufacturer'))
|
119 |
{
|
276 |
return $productData;
|
277 |
}
|
278 |
|
279 |
+
protected function buildImageUrl($product)
|
280 |
+
{
|
281 |
+
$store = Mage::app()->getStore();
|
282 |
+
$url = null;
|
283 |
+
$helper = Mage::helper('increasingly_analytics');
|
284 |
+
$imageVersion = $helper->getProductImageVersion($store);
|
285 |
+
$img = $product->getData($imageVersion);
|
286 |
+
$img = $this->isValidImage($img) ? $img : $product->getData('image');
|
287 |
+
if ($this->isValidImage($img)) {
|
288 |
+
// We build the image url manually in order get the correct base url
|
289 |
+
$baseUrl = rtrim($store->getBaseUrl('media'), '/');
|
290 |
+
$file = str_replace(DS, '/', $img);
|
291 |
+
$file = ltrim($file, '/');
|
292 |
+
$url = $baseUrl.'/catalog/product/'.$file;
|
293 |
+
}
|
294 |
+
return $url;
|
295 |
+
}
|
296 |
+
|
297 |
+
protected function isValidImage($image)
|
298 |
+
{
|
299 |
+
return (!empty($image) && $image !== 'no_selection');
|
300 |
+
}
|
301 |
+
|
302 |
}
|
303 |
|
304 |
|
app/code/community/Increasingly/Analytics/controllers/ProductsImportApiController.php
CHANGED
@@ -104,7 +104,16 @@ class Increasingly_Analytics_ProductsImportApiController extends Mage_Core_Contr
|
|
104 |
}
|
105 |
}
|
106 |
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
if($productData['product_type_name'] == "configurable")
|
109 |
{
|
110 |
$configurableProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($productData['product_id']);
|
@@ -213,6 +222,7 @@ class Increasingly_Analytics_ProductsImportApiController extends Mage_Core_Contr
|
|
213 |
|
214 |
$inventoryDetails = $stock->getData();
|
215 |
$productData['inventory_details'] = $inventoryDetails;
|
|
|
216 |
|
217 |
$products[] = $productData;
|
218 |
|
@@ -302,4 +312,27 @@ class Increasingly_Analytics_ProductsImportApiController extends Mage_Core_Contr
|
|
302 |
|
303 |
}
|
304 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
}
|
104 |
}
|
105 |
}
|
106 |
|
107 |
+
if ($product->hasData('description') && $productData['description'] == null)
|
108 |
+
{
|
109 |
+
$productData['description'] = $product->getData('description');
|
110 |
+
}
|
111 |
+
|
112 |
+
if ($product->hasData('short_description') && $productData['short_description'] == null)
|
113 |
+
{
|
114 |
+
$productData['short_description'] = $product->getData('short_description');
|
115 |
+
}
|
116 |
+
|
117 |
if($productData['product_type_name'] == "configurable")
|
118 |
{
|
119 |
$configurableProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($productData['product_id']);
|
222 |
|
223 |
$inventoryDetails = $stock->getData();
|
224 |
$productData['inventory_details'] = $inventoryDetails;
|
225 |
+
$productData['original_image_url'] = $this->buildImageUrl($product);
|
226 |
|
227 |
$products[] = $productData;
|
228 |
|
312 |
|
313 |
}
|
314 |
|
315 |
+
protected function buildImageUrl($product)
|
316 |
+
{
|
317 |
+
$store = Mage::app()->getStore();
|
318 |
+
$url = null;
|
319 |
+
$helper = Mage::helper('increasingly_analytics');
|
320 |
+
$imageVersion = $helper->getProductImageVersion($store);
|
321 |
+
$img = $product->getData($imageVersion);
|
322 |
+
$img = $this->isValidImage($img) ? $img : $product->getData('image');
|
323 |
+
if ($this->isValidImage($img)) {
|
324 |
+
// We build the image url manually in order get the correct base url
|
325 |
+
$baseUrl = rtrim($store->getBaseUrl('media'), '/');
|
326 |
+
$file = str_replace(DS, '/', $img);
|
327 |
+
$file = ltrim($file, '/');
|
328 |
+
$url = $baseUrl.'/catalog/product/'.$file;
|
329 |
+
}
|
330 |
+
return $url;
|
331 |
+
}
|
332 |
+
|
333 |
+
protected function isValidImage($image)
|
334 |
+
{
|
335 |
+
return (!empty($image) && $image !== 'no_selection');
|
336 |
+
}
|
337 |
+
|
338 |
}
|
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.14</version>
|
36 |
</Increasingly_Analytics>
|
37 |
</modules>
|
38 |
<global>
|
app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.14.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/design/frontend/base/default/template/increasingly/track.phtml
CHANGED
@@ -41,11 +41,11 @@
|
|
41 |
|
42 |
window.increasingly.load=function(){var t=document;var n=t.getElementsByTagName("script")[0];var r=t.createElement("script");
|
43 |
r.type="text/javascript";r.async=true;r.src="//www.increasingly.co/js/track.js";n.parentNode.insertBefore(r,n);};
|
44 |
-
|
45 |
|
46 |
window.increasingly.loadJs=function(){var t=document;var n=t.getElementsByTagName("script")[0];var r=t.createElement("script");
|
47 |
r.type="text/javascript";r.async=true;r.src="//www.increasingly.co/js/increasingly.js";n.parentNode.insertBefore(r,n);};
|
48 |
-
|
49 |
|
50 |
increasingly.load();
|
51 |
increasingly.loadJs();
|
41 |
|
42 |
window.increasingly.load=function(){var t=document;var n=t.getElementsByTagName("script")[0];var r=t.createElement("script");
|
43 |
r.type="text/javascript";r.async=true;r.src="//www.increasingly.co/js/track.js";n.parentNode.insertBefore(r,n);};
|
44 |
+
|
45 |
|
46 |
window.increasingly.loadJs=function(){var t=document;var n=t.getElementsByTagName("script")[0];var r=t.createElement("script");
|
47 |
r.type="text/javascript";r.async=true;r.src="//www.increasingly.co/js/increasingly.js";n.parentNode.insertBefore(r,n);};
|
48 |
+
|
49 |
|
50 |
increasingly.load();
|
51 |
increasingly.loadJs();
|
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>
|
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-
|
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="0dc07596570d1fbda071f3a91e9357b5"/><file name="DateFormatter.php" hash="d8f963bd1f9fe390e038a2065fd5c4c4"/><file name="PriceFormatter.php" hash="9bc46d3afb4612131a29b9a1c2b82fad"/><file name="ProductFormatter.php" hash="
|
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.14</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>Fixed issue to fetch product description and original image url of product (Instead of cached image).</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-10-03</date>
|
50 |
+
<time>09:09:14</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="0dc07596570d1fbda071f3a91e9357b5"/><file name="DateFormatter.php" hash="d8f963bd1f9fe390e038a2065fd5c4c4"/><file name="PriceFormatter.php" hash="9bc46d3afb4612131a29b9a1c2b82fad"/><file name="ProductFormatter.php" hash="2fc9d9e7de186379737b477b166e8bf5"/></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="035f739ed0727685f47e7d8405b4448c"/><file name="OrdersApiController.php" hash="30195b469077e96f012538899f7d4f27"/><file name="ProductsApiController.php" hash="5ac96ef4089b835968acdbca3539172a"/><file name="ProductsImportApiController.php" hash="488554c8dd28993bbf6d50b8c29b3841"/></dir><dir name="etc"><file name="config.xml" hash="805270f0231d7122d279caace2c4a616"/></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.12.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.13.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.14.php" hash="e857df177cfbb887cece6de0ff5498b6"/><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="f08bf5e8260eb804da8569dc7d6eac80"/></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>
|