Version Notes
Optimized placeholder caching for Magento Enterprise Edition.
Download this release
Release Info
Developer | HiConversion |
Extension | Hic_Integration |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- app/code/community/Hic/Integration/Block/Tag.php +30 -29
- app/code/community/Hic/Integration/Helper/Data.php +19 -4
- app/code/community/Hic/Integration/Model/Container/Cache.php +71 -66
- app/code/community/Hic/Integration/Model/Data.php +15 -12
- app/code/community/Hic/Integration/Model/Observer.php +121 -66
- app/code/community/Hic/Integration/etc/config.xml +8 -0
- app/code/community/Hic/Integration/etc/system.xml +56 -58
- app/design/frontend/base/default/template/hic/head.phtml +1 -1
- package.xml +6 -6
app/code/community/Hic/Integration/Block/Tag.php
CHANGED
@@ -1,30 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* HiConversion
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the MIT License
|
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/MIT]
|
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 |
-
* @category Hic
|
16 |
-
* @package Hic_Integration
|
17 |
-
* @Copyright © 2015 HiConversion, Inc. All rights reserved.
|
18 |
-
* @license [http://opensource.org/licenses/MIT] MIT License
|
19 |
-
*/
|
20 |
-
|
21 |
-
|
22 |
-
*
|
23 |
-
*
|
24 |
-
* @
|
25 |
-
* @
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
30 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* HiConversion
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the MIT License
|
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/MIT]
|
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 |
+
* @category Hic
|
16 |
+
* @package Hic_Integration
|
17 |
+
* @Copyright © 2015 HiConversion, Inc. All rights reserved.
|
18 |
+
* @license [http://opensource.org/licenses/MIT] MIT License
|
19 |
+
*/
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Integration Head Block
|
23 |
+
*
|
24 |
+
* @category Hic
|
25 |
+
* @package Integration
|
26 |
+
* @author HiConversion <support@hiconversion.com>
|
27 |
+
*/
|
28 |
+
class Hic_Integration_Block_Tag extends Mage_Core_Block_Template
|
29 |
+
{
|
30 |
+
|
31 |
}
|
app/code/community/Hic/Integration/Helper/Data.php
CHANGED
@@ -30,7 +30,7 @@ class Hic_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
30 |
const SETTINGS_ENABLED = 'integration/settings/enabled';
|
31 |
const SETTINGS_ENABLED_2 = 'integration/settings/enabled_2';
|
32 |
const SETTINGS_SITE_ID = 'integration/settings/site_id';
|
33 |
-
const EXTENSION_VERSION = '1.1.
|
34 |
|
35 |
/**
|
36 |
* Returns Site ID from Configuration
|
@@ -70,7 +70,18 @@ class Hic_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
70 |
public function hicData()
|
71 |
{
|
72 |
$model = Mage::getModel('integration/data');
|
73 |
-
$data = $model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
$data = array_filter($data);
|
75 |
$obj = new Varien_Object($data);
|
76 |
if ($obj && $data) {
|
@@ -85,7 +96,10 @@ class Hic_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
85 |
*/
|
86 |
public function getRoute()
|
87 |
{
|
88 |
-
$route = Mage::app()
|
|
|
|
|
|
|
89 |
return $route;
|
90 |
}
|
91 |
|
@@ -117,6 +131,7 @@ class Hic_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
117 |
public function isConfirmation()
|
118 |
{
|
119 |
$request = Mage::app()->getRequest();
|
120 |
-
return false !== strpos($request->getRouteName(), 'checkout')
|
|
|
121 |
}
|
122 |
}
|
30 |
const SETTINGS_ENABLED = 'integration/settings/enabled';
|
31 |
const SETTINGS_ENABLED_2 = 'integration/settings/enabled_2';
|
32 |
const SETTINGS_SITE_ID = 'integration/settings/site_id';
|
33 |
+
const EXTENSION_VERSION = '1.1.1';
|
34 |
|
35 |
/**
|
36 |
* Returns Site ID from Configuration
|
70 |
public function hicData()
|
71 |
{
|
72 |
$model = Mage::getModel('integration/data');
|
73 |
+
$data = $model
|
74 |
+
->toArray(
|
75 |
+
array(
|
76 |
+
'page',
|
77 |
+
'cart',
|
78 |
+
'user',
|
79 |
+
'tr',
|
80 |
+
'version',
|
81 |
+
'platform',
|
82 |
+
'pid',
|
83 |
+
'product')
|
84 |
+
);
|
85 |
$data = array_filter($data);
|
86 |
$obj = new Varien_Object($data);
|
87 |
if ($obj && $data) {
|
96 |
*/
|
97 |
public function getRoute()
|
98 |
{
|
99 |
+
$route = Mage::app()
|
100 |
+
->getFrontController()
|
101 |
+
->getAction()
|
102 |
+
->getFullActionName();
|
103 |
return $route;
|
104 |
}
|
105 |
|
131 |
public function isConfirmation()
|
132 |
{
|
133 |
$request = Mage::app()->getRequest();
|
134 |
+
return false !== strpos($request->getRouteName(), 'checkout')
|
135 |
+
&& 'success' == $request->getActionName();
|
136 |
}
|
137 |
}
|
app/code/community/Hic/Integration/Model/Container/Cache.php
CHANGED
@@ -1,67 +1,72 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* HiConversion
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the MIT License
|
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/MIT]
|
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 |
-
* @category Hic
|
16 |
-
* @package Hic_Integration
|
17 |
-
* @Copyright © 2015 HiConversion, Inc. All rights reserved.
|
18 |
-
* @license [http://opensource.org/licenses/MIT] MIT License
|
19 |
-
*/
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Integration container to hole-punch
|
23 |
-
*
|
24 |
-
* @category Hic
|
25 |
-
* @package Integration
|
26 |
-
* @author HiConversion <support@hiconversion.com>
|
27 |
-
*/
|
28 |
-
class Hic_Integration_Model_Container_Cache
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
*
|
61 |
-
*
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* HiConversion
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the MIT License
|
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/MIT]
|
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 |
+
* @category Hic
|
16 |
+
* @package Hic_Integration
|
17 |
+
* @Copyright © 2015 HiConversion, Inc. All rights reserved.
|
18 |
+
* @license [http://opensource.org/licenses/MIT] MIT License
|
19 |
+
*/
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Integration container to hole-punch
|
23 |
+
*
|
24 |
+
* @category Hic
|
25 |
+
* @package Integration
|
26 |
+
* @author HiConversion <support@hiconversion.com>
|
27 |
+
*/
|
28 |
+
class Hic_Integration_Model_Container_Cache
|
29 |
+
extends Enterprise_PageCache_Model_Container_Abstract
|
30 |
+
{
|
31 |
+
const CACHE_TAG_PREFIX = 'HICONVERSION_INTEGRATION_';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Get identifier from cookies
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public static function getCacheId()
|
39 |
+
{
|
40 |
+
$cookieCart = Enterprise_PageCache_Model_Cookie::COOKIE_CART;
|
41 |
+
$cookieCustomer = Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER;
|
42 |
+
return md5(Hic_Integration_Model_Container_Cache::CACHE_TAG_PREFIX
|
43 |
+
. (array_key_exists($cookieCart, $_COOKIE)
|
44 |
+
? $_COOKIE[$cookieCart] : '')
|
45 |
+
. (array_key_exists($cookieCustomer, $_COOKIE)
|
46 |
+
? $_COOKIE[$cookieCustomer] : ''));
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Returns Cache ID
|
51 |
+
*
|
52 |
+
* @return string
|
53 |
+
*/
|
54 |
+
protected function _getCacheId()
|
55 |
+
{
|
56 |
+
return Hic_Integration_Model_Container_Cache::getCacheId();
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Render block content
|
61 |
+
*
|
62 |
+
* @return mixed
|
63 |
+
*/
|
64 |
+
protected function _renderBlock()
|
65 |
+
{
|
66 |
+
$blockClass = $this->_placeholder->getAttribute('block');
|
67 |
+
$template = $this->_placeholder->getAttribute('template');
|
68 |
+
$block = new $blockClass;
|
69 |
+
$block->setTemplate($template);
|
70 |
+
return $block->toHtml();
|
71 |
+
}
|
72 |
}
|
app/code/community/Hic/Integration/Model/Data.php
CHANGED
@@ -27,13 +27,13 @@
|
|
27 |
*/
|
28 |
class Hic_Integration_Model_Data extends Varien_Object
|
29 |
{
|
30 |
-
protected $_version = '1.
|
31 |
protected $_platform = 'magento';
|
32 |
|
33 |
const CATALOG_URL = 'catalog/product/';
|
34 |
|
35 |
/**
|
36 |
-
*
|
37 |
*/
|
38 |
protected function _construct()
|
39 |
{
|
@@ -71,11 +71,10 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
71 |
|
72 |
// request item information from product collection catalog
|
73 |
$collection = Mage::getResourceModel('catalog/product_collection')
|
74 |
-
->addFieldToFilter('entity_id', array('in' => $productIds )
|
75 |
->addAttributeToSelect(array('name','description'));
|
76 |
$count = 0;
|
77 |
|
78 |
-
// TODO: Swap Description for ShortDescription
|
79 |
foreach ($collection as $product) {
|
80 |
$info = array();
|
81 |
$info['ds'] = (float)$items[$count]->getDiscountAmount();
|
@@ -83,7 +82,7 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
83 |
$info['qt'] = (float)$items[$count]->getQty();
|
84 |
$info['pr'] = (float)$items[$count]->getRowTotalInclTax();
|
85 |
$info['bpr'] = (float)$items[$count]->getPrice();
|
86 |
-
if (
|
87 |
$info['qt'] = (float)$items[$count]->getQtyOrdered();
|
88 |
}
|
89 |
$info['desc'] = strip_tags($product->getDescription());
|
@@ -145,7 +144,8 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
145 |
if (Mage::app()->getStore()->getCurrentCurrencyCode()) {
|
146 |
$data['cu'] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
147 |
}
|
148 |
-
$data['li'] = $this
|
|
|
149 |
$this->setCart($data);
|
150 |
return $this;
|
151 |
}
|
@@ -165,9 +165,9 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
165 |
$data['auth'] = $session->isLoggedIn();
|
166 |
$data['ht'] = false;
|
167 |
$data['nv'] = true;
|
168 |
-
$data['cg'] = Mage::getSingleton('customer/session')
|
|
|
169 |
if ($customer->getId()) {
|
170 |
-
// Determine if customer has transacted or not. Must be logged in.
|
171 |
$orders = Mage::getModel('sales/order')->getCollection();
|
172 |
$orders->addAttributeToFilter('customer_id', $customer->getId());
|
173 |
if ($orders) {
|
@@ -185,7 +185,7 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
185 |
$data['id'] = $customer->getId();
|
186 |
$data['nv'] = false;
|
187 |
$data['nm'] = trim($customer->getFirstname() . ' ' . $customer->getLastname());
|
188 |
-
$data['since'] = $customer->getCreatedAt();
|
189 |
}
|
190 |
$this->setUser($data);
|
191 |
return $this;
|
@@ -230,9 +230,11 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
230 |
if ($order->getDiscountAmount() > 0) {
|
231 |
$transaction['ds'] = -1 * $order->getDiscountAmount();
|
232 |
}
|
233 |
-
$transaction['li'] = $this
|
|
|
234 |
$transaction['sh'] = (float)$order->getShippingAmount();
|
235 |
-
$transaction['shm'] = $order->getShippingMethod()
|
|
|
236 |
$this->setTr($transaction);
|
237 |
return $this;
|
238 |
}
|
@@ -251,7 +253,8 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
251 |
$data['nm'] = $product->getName();
|
252 |
$data['url'] = $product->getProductUrl();
|
253 |
$data['sku'] = $product->getSku();
|
254 |
-
$data['img'] = Mage::getBaseUrl('media')
|
|
|
255 |
$this->setProduct($data);
|
256 |
return $this;
|
257 |
}
|
27 |
*/
|
28 |
class Hic_Integration_Model_Data extends Varien_Object
|
29 |
{
|
30 |
+
protected $_version = '1.1';
|
31 |
protected $_platform = 'magento';
|
32 |
|
33 |
const CATALOG_URL = 'catalog/product/';
|
34 |
|
35 |
/**
|
36 |
+
* Class constructor
|
37 |
*/
|
38 |
protected function _construct()
|
39 |
{
|
71 |
|
72 |
// request item information from product collection catalog
|
73 |
$collection = Mage::getResourceModel('catalog/product_collection')
|
74 |
+
->addFieldToFilter('entity_id', array('in' => $productIds ))
|
75 |
->addAttributeToSelect(array('name','description'));
|
76 |
$count = 0;
|
77 |
|
|
|
78 |
foreach ($collection as $product) {
|
79 |
$info = array();
|
80 |
$info['ds'] = (float)$items[$count]->getDiscountAmount();
|
82 |
$info['qt'] = (float)$items[$count]->getQty();
|
83 |
$info['pr'] = (float)$items[$count]->getRowTotalInclTax();
|
84 |
$info['bpr'] = (float)$items[$count]->getPrice();
|
85 |
+
if ($this->helper()->isConfirmation()) {
|
86 |
$info['qt'] = (float)$items[$count]->getQtyOrdered();
|
87 |
}
|
88 |
$info['desc'] = strip_tags($product->getDescription());
|
144 |
if (Mage::app()->getStore()->getCurrentCurrencyCode()) {
|
145 |
$data['cu'] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
146 |
}
|
147 |
+
$data['li'] = $this
|
148 |
+
->_getCartItems($cartQuote->getAllVisibleItems());
|
149 |
$this->setCart($data);
|
150 |
return $this;
|
151 |
}
|
165 |
$data['auth'] = $session->isLoggedIn();
|
166 |
$data['ht'] = false;
|
167 |
$data['nv'] = true;
|
168 |
+
$data['cg'] = Mage::getSingleton('customer/session')
|
169 |
+
->getCustomerGroupId();
|
170 |
if ($customer->getId()) {
|
|
|
171 |
$orders = Mage::getModel('sales/order')->getCollection();
|
172 |
$orders->addAttributeToFilter('customer_id', $customer->getId());
|
173 |
if ($orders) {
|
185 |
$data['id'] = $customer->getId();
|
186 |
$data['nv'] = false;
|
187 |
$data['nm'] = trim($customer->getFirstname() . ' ' . $customer->getLastname());
|
188 |
+
$data['since'] = $customer->getCreatedAt();
|
189 |
}
|
190 |
$this->setUser($data);
|
191 |
return $this;
|
230 |
if ($order->getDiscountAmount() > 0) {
|
231 |
$transaction['ds'] = -1 * $order->getDiscountAmount();
|
232 |
}
|
233 |
+
$transaction['li'] = $this
|
234 |
+
->_getCartItems($order->getAllVisibleItems());
|
235 |
$transaction['sh'] = (float)$order->getShippingAmount();
|
236 |
+
$transaction['shm'] = $order->getShippingMethod()
|
237 |
+
? $order->getShippingMethod() : '';
|
238 |
$this->setTr($transaction);
|
239 |
return $this;
|
240 |
}
|
253 |
$data['nm'] = $product->getName();
|
254 |
$data['url'] = $product->getProductUrl();
|
255 |
$data['sku'] = $product->getSku();
|
256 |
+
$data['img'] = Mage::getBaseUrl('media')
|
257 |
+
. self::CATALOG_URL . $product->getImage();
|
258 |
$this->setProduct($data);
|
259 |
return $this;
|
260 |
}
|
app/code/community/Hic/Integration/Model/Observer.php
CHANGED
@@ -1,66 +1,121 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* HiConversion
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the MIT License
|
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/MIT]
|
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 |
-
* @category Hic
|
16 |
-
* @package Hic_Integration
|
17 |
-
* @Copyright © 2015 HiConversion, Inc. All rights reserved.
|
18 |
-
* @license [http://opensource.org/licenses/MIT] MIT License
|
19 |
-
*/
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Integration observer model
|
23 |
-
*
|
24 |
-
* @category Hic
|
25 |
-
* @package Integration
|
26 |
-
* @author HiConversion <support@hiconversion.com>
|
27 |
-
*/
|
28 |
-
class Hic_Integration_Model_Observer
|
29 |
-
{
|
30 |
-
protected static $
|
31 |
-
protected static $
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
*
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* HiConversion
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the MIT License
|
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/MIT]
|
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 |
+
* @category Hic
|
16 |
+
* @package Hic_Integration
|
17 |
+
* @Copyright © 2015 HiConversion, Inc. All rights reserved.
|
18 |
+
* @license [http://opensource.org/licenses/MIT] MIT License
|
19 |
+
*/
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Integration observer model
|
23 |
+
*
|
24 |
+
* @category Hic
|
25 |
+
* @package Integration
|
26 |
+
* @author HiConversion <support@hiconversion.com>
|
27 |
+
*/
|
28 |
+
class Hic_Integration_Model_Observer
|
29 |
+
{
|
30 |
+
protected static $_isHead = false;
|
31 |
+
protected static $_isRendered = false;
|
32 |
+
protected static $_clearCache = false;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Is Enabled Full Page Cache
|
36 |
+
*
|
37 |
+
* @var bool
|
38 |
+
*/
|
39 |
+
protected $_isEnabled;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Class constructor
|
43 |
+
*/
|
44 |
+
public function __construct()
|
45 |
+
{
|
46 |
+
$this->_isEnabled = Mage::app()->useCache('full_page');
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Check if full page cache is enabled
|
51 |
+
*
|
52 |
+
* @return bool
|
53 |
+
*/
|
54 |
+
public function isCacheEnabled()
|
55 |
+
{
|
56 |
+
return $this->_isEnabled;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Check 'controller_action_layout_render_before' event response
|
61 |
+
* type to determine if it is a HTML page response
|
62 |
+
*
|
63 |
+
* @return $this
|
64 |
+
*/
|
65 |
+
public function checkResponseType()
|
66 |
+
{
|
67 |
+
if (Mage::app()->getLayout()->getBlock('head')) {
|
68 |
+
self::$_isHead = true;
|
69 |
+
}
|
70 |
+
return $this;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Intercept 'controller_action_postdispatch' event response
|
75 |
+
* to inject block at top of head
|
76 |
+
*
|
77 |
+
* @param Varien_Event_Observer $observer
|
78 |
+
* @return $this
|
79 |
+
*/
|
80 |
+
public function interceptResponse(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if (self::$_isHead && !self::$_isRendered) {
|
83 |
+
$layout = Mage::getSingleton('core/layout');
|
84 |
+
$tag = $layout
|
85 |
+
->createBlock('integration/tag', 'hic.integration.tag')
|
86 |
+
->setTemplate('hic/head.phtml')
|
87 |
+
->toHtml();
|
88 |
+
$response = $observer->getEvent()
|
89 |
+
->getControllerAction()
|
90 |
+
->getResponse();
|
91 |
+
$openHeadTag = '<head>';
|
92 |
+
$pos = strpos($response, $openHeadTag);
|
93 |
+
if ($pos !== false && $layout && $tag && $response) {
|
94 |
+
$newStr = substr_replace($response, $tag, $pos + strlen($openHeadTag), 0);
|
95 |
+
$response->setBody($newStr);
|
96 |
+
self::$_isRendered = true;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
return $this;
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Clear placeholder cache for
|
105 |
+
*
|
106 |
+
* @return $this
|
107 |
+
*/
|
108 |
+
public function flushCache()
|
109 |
+
{
|
110 |
+
if (!$this->isCacheEnabled()) {
|
111 |
+
return $this;
|
112 |
+
}
|
113 |
+
if (self::$_clearCache == false) {
|
114 |
+
$cacheId = Hic_Integration_Model_Container_Cache::getCacheId();
|
115 |
+
Enterprise_PageCache_Model_Cache::getCacheInstance()
|
116 |
+
->remove($cacheId);
|
117 |
+
self::$_clearCache = true;
|
118 |
+
}
|
119 |
+
return $this;
|
120 |
+
}
|
121 |
+
}
|
app/code/community/Hic/Integration/etc/config.xml
CHANGED
@@ -40,6 +40,14 @@
|
|
40 |
</integration_check_response>
|
41 |
</observers>
|
42 |
</controller_action_layout_render_before>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
</events>
|
44 |
<layout>
|
45 |
<updates>
|
40 |
</integration_check_response>
|
41 |
</observers>
|
42 |
</controller_action_layout_render_before>
|
43 |
+
<checkout_cart_save_after>
|
44 |
+
<observers>
|
45 |
+
<integration_flush_cache>
|
46 |
+
<class>integration/observer</class>
|
47 |
+
<method>flushCache</method>
|
48 |
+
</integration_flush_cache>
|
49 |
+
</observers>
|
50 |
+
</checkout_cart_save_after>
|
51 |
</events>
|
52 |
<layout>
|
53 |
<updates>
|
app/code/community/Hic/Integration/etc/system.xml
CHANGED
@@ -1,59 +1,57 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<tabs>
|
4 |
-
<integration translate="label">
|
5 |
-
<label>HiConversion</label>
|
6 |
-
<sort_order>1000</sort_order>
|
7 |
-
</integration>
|
8 |
-
</tabs>
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
<
|
13 |
-
<
|
14 |
-
<
|
15 |
-
<
|
16 |
-
<
|
17 |
-
<
|
18 |
-
<
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
<
|
23 |
-
<
|
24 |
-
<
|
25 |
-
<
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
<
|
30 |
-
<
|
31 |
-
<
|
32 |
-
<
|
33 |
-
<
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
<
|
39 |
-
<
|
40 |
-
<
|
41 |
-
<
|
42 |
-
<
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
<
|
48 |
-
<
|
49 |
-
<
|
50 |
-
<
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
</integration>
|
58 |
-
</sections>
|
59 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<integration translate="label">
|
5 |
+
<label>HiConversion</label>
|
6 |
+
<sort_order>1000</sort_order>
|
7 |
+
</integration>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<integration translate="label">
|
11 |
+
<label>Settings</label>
|
12 |
+
<tab>integration</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>10</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<settings translate="label">
|
20 |
+
<label>Configuration</label>
|
21 |
+
<sort_order>1</sort_order>
|
22 |
+
<show_in_default>1</show_in_default>
|
23 |
+
<show_in_website>1</show_in_website>
|
24 |
+
<show_in_store>1</show_in_store>
|
25 |
+
<fields>
|
26 |
+
<enabled translate="label">
|
27 |
+
<label>Enable Extension</label>
|
28 |
+
<frontend_type>select</frontend_type>
|
29 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
30 |
+
<sort_order>1</sort_order>
|
31 |
+
<show_in_default>1</show_in_default>
|
32 |
+
<show_in_website>1</show_in_website>
|
33 |
+
<show_in_store>1</show_in_store>
|
34 |
+
</enabled>
|
35 |
+
<enabled_2 translate="label">
|
36 |
+
<label>Enable CX Optimization</label>
|
37 |
+
<frontend_type>select</frontend_type>
|
38 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
39 |
+
<sort_order>3</sort_order>
|
40 |
+
<show_in_default>1</show_in_default>
|
41 |
+
<show_in_website>1</show_in_website>
|
42 |
+
<show_in_store>1</show_in_store>
|
43 |
+
</enabled_2>
|
44 |
+
<site_id translate="label">
|
45 |
+
<label>Site ID</label>
|
46 |
+
<frontend_type>text</frontend_type>
|
47 |
+
<sort_order>2</sort_order>
|
48 |
+
<show_in_default>1</show_in_default>
|
49 |
+
<show_in_website>1</show_in_website>
|
50 |
+
<show_in_store>1</show_in_store>
|
51 |
+
</site_id>
|
52 |
+
</fields>
|
53 |
+
</settings>
|
54 |
+
</groups>
|
55 |
+
</integration>
|
56 |
+
</sections>
|
|
|
|
|
57 |
</config>
|
app/design/frontend/base/default/template/hic/head.phtml
CHANGED
@@ -28,7 +28,7 @@ $hic_data = $helper->hicData();
|
|
28 |
var __hic = __hic || {};
|
29 |
(function(){
|
30 |
try {
|
31 |
-
__hic.version = "1.1.
|
32 |
__hic.data = <?php echo $hic_data; ?>;
|
33 |
var script = document.createElement("script");
|
34 |
script.id = "hiconversion_30";
|
28 |
var __hic = __hic || {};
|
29 |
(function(){
|
30 |
try {
|
31 |
+
__hic.version = "1.1.1";
|
32 |
__hic.data = <?php echo $hic_data; ?>;
|
33 |
var script = document.createElement("script");
|
34 |
script.id = "hiconversion_30";
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Hic_Integration</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>MIT</license>
|
7 |
<channel>community</channel>
|
@@ -12,11 +12,11 @@
|
|
12 |
Data Capture: We productized our knowledge about the types of data collected by the most advanced web analytics solutions deployed on Magento stores. We then created an extension that provides solid data collection right out-of-the-box. There is no need for any additional custom tagging of your site. All other custom events and metric tracking is provisioned through our application interface. 
|
13 |

|
14 |
Customer Experience Optimization: The second role for the extension is to enable client-side testing, targeting, personalization, and customer experience optimization. To minimize technical complexity and IT dependency, we provide a visual designer tool that enables you to visually provision your optimization campaigns. The visual designs are then translated into lines of code that are transparently executed by the visitor’s browser during the web page rendering process.</description>
|
15 |
-
<notes>
|
16 |
<authors><author><name>HiConversion</name><user>hiconversion</user><email>dhenrickson@hiconversion.com</email></author></authors>
|
17 |
-
<date>2015-
|
18 |
-
<time>
|
19 |
-
<contents><target name="magecommunity"><dir name="Hic"><dir name="Integration"><dir name="Block"><file name="Tag.php" hash="
|
20 |
<compatible/>
|
21 |
-
<dependencies><required><php><min>5.2.
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Hic_Integration</name>
|
4 |
+
<version>1.1.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>MIT</license>
|
7 |
<channel>community</channel>
|
12 |
Data Capture: We productized our knowledge about the types of data collected by the most advanced web analytics solutions deployed on Magento stores. We then created an extension that provides solid data collection right out-of-the-box. There is no need for any additional custom tagging of your site. All other custom events and metric tracking is provisioned through our application interface. 
|
13 |

|
14 |
Customer Experience Optimization: The second role for the extension is to enable client-side testing, targeting, personalization, and customer experience optimization. To minimize technical complexity and IT dependency, we provide a visual designer tool that enables you to visually provision your optimization campaigns. The visual designs are then translated into lines of code that are transparently executed by the visitor’s browser during the web page rendering process.</description>
|
15 |
+
<notes>Optimized placeholder caching for Magento Enterprise Edition.</notes>
|
16 |
<authors><author><name>HiConversion</name><user>hiconversion</user><email>dhenrickson@hiconversion.com</email></author></authors>
|
17 |
+
<date>2015-06-10</date>
|
18 |
+
<time>16:42:03</time>
|
19 |
+
<contents><target name="magecommunity"><dir name="Hic"><dir name="Integration"><dir name="Block"><file name="Tag.php" hash="06dfa2628cb2e190ae177bf86cd82266"/></dir><dir name="Helper"><file name="Data.php" hash="b456c3af44056e86f286f8fd908316b6"/></dir><file name="LICENSE.txt" hash="3b58e20f0b691c258d39cc034c5376eb"/><dir name="Model"><dir name="Container"><file name="Cache.php" hash="c2cf21f330ba35dfcd1c999f3b926eee"/></dir><file name="Data.php" hash="4ebad76a060feccef9ac0db213049145"/><file name="Observer.php" hash="e6fab0d93e38e4af479b692d5e1a1007"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f122c26dfe576f4c09f83abe76424931"/><file name="cache.xml" hash="e19b0ad039f1d832e0710f887281adc4"/><file name="config.xml" hash="3e3eaa86d9c02b014d5a31b5dfa0e8c3"/><file name="system.xml" hash="099f557cbbd148bee56909732dd9a0cf"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="hic"><file name="hiconversion.xml" hash="05531c3232369fdfa0d285d5f0982420"/></dir></dir><dir name="template"><dir name="hic"><file name="body.phtml" hash="a337202d1f589d299392a3dc6a3da4e3"/><file name="head.phtml" hash="e5a40bc81dc901864c3a5454f0a15c06"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Hic_Integration.xml" hash="94fd9568fa202ad3d4773331e46d88c2"/></dir></target></contents>
|
20 |
<compatible/>
|
21 |
+
<dependencies><required><php><min>5.2.0</min><max>5.6.7</max></php></required></dependencies>
|
22 |
</package>
|