Version Notes
Some refactoring and commenting per Magento Coding Standards and Best Practices.
Download this release
Release Info
Developer | HiConversion |
Extension | Hic_Integration |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- app/code/community/Hic/Integration/Block/Html/Head.php +32 -1
- app/code/community/Hic/Integration/Block/Template.php +25 -0
- app/code/community/Hic/Integration/Helper/Data.php +61 -35
- app/code/community/Hic/Integration/LICENSE.txt +21 -0
- app/code/community/Hic/Integration/Model/Container/Template.php +32 -1
- app/code/community/Hic/Integration/Model/Data.php +80 -15
- app/design/frontend/base/default/template/hic/body.phtml +19 -0
- app/design/frontend/base/default/template/hic/head.phtml +21 -2
- package.xml +10 -10
app/code/community/Hic/Integration/Block/Html/Head.php
CHANGED
@@ -1,10 +1,41 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Hic_Integration_Block_Html_Head extends Mage_Page_Block_Html_Head
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
protected function _afterToHtml($html)
|
6 |
{
|
7 |
-
//prepend Hic block output
|
8 |
$block = Mage::app()->getLayout()->createBlock('integration/template','hiconversion.head.tag');
|
9 |
$block->setTemplate('hic/head.phtml');
|
10 |
return $block->toHtml() . $html;
|
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 html head block
|
23 |
+
*
|
24 |
+
* @category Hic
|
25 |
+
* @package Integration
|
26 |
+
* @author HiConversion <support@hiconversion.com>
|
27 |
+
*/
|
28 |
class Hic_Integration_Block_Html_Head extends Mage_Page_Block_Html_Head
|
29 |
{
|
30 |
+
/**
|
31 |
+
* Prepends HiC header template to head.
|
32 |
+
*
|
33 |
+
* @params string
|
34 |
+
* @return string
|
35 |
+
*/
|
36 |
protected function _afterToHtml($html)
|
37 |
{
|
38 |
+
// prepend Hic block output
|
39 |
$block = Mage::app()->getLayout()->createBlock('integration/template','hiconversion.head.tag');
|
40 |
$block->setTemplate('hic/head.phtml');
|
41 |
return $block->toHtml() . $html;
|
app/code/community/Hic/Integration/Block/Template.php
CHANGED
@@ -1,5 +1,30 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Hic_Integration_Block_Template extends Mage_Core_Block_Template
|
4 |
{
|
5 |
|
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 template block
|
23 |
+
*
|
24 |
+
* @category Hic
|
25 |
+
* @package Integration
|
26 |
+
* @author HiConversion <support@hiconversion.com>
|
27 |
+
*/
|
28 |
class Hic_Integration_Block_Template extends Mage_Core_Block_Template
|
29 |
{
|
30 |
|
app/code/community/Hic/Integration/Helper/Data.php
CHANGED
@@ -1,76 +1,102 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Hic_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
{
|
5 |
const SETTINGS_ENABLED = 'integration/settings/enabled';
|
6 |
const SETTINGS_ENABLED_2 = 'integration/settings/enabled_2';
|
7 |
const SETTINGS_SITE_ID = 'integration/settings/site_id';
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
public function getSiteId()
|
10 |
{
|
11 |
return Mage::getStoreConfig(self::SETTINGS_SITE_ID);
|
12 |
}
|
13 |
|
|
|
|
|
|
|
|
|
|
|
14 |
public function isEnabled()
|
15 |
{
|
16 |
return Mage::getStoreConfig(self::SETTINGS_ENABLED);
|
17 |
}
|
18 |
|
|
|
|
|
|
|
|
|
|
|
19 |
public function isEnabled2()
|
20 |
{
|
21 |
return Mage::getStoreConfig(self::SETTINGS_ENABLED_2);
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
24 |
public function getHicData()
|
25 |
{
|
26 |
return Mage::getModel('integration/data');
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
public function getRoute()
|
30 |
{
|
31 |
$route = Mage::app()->getFrontController()->getAction()->getFullActionName();
|
32 |
return $route;
|
33 |
}
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
public function isContent()
|
41 |
-
{
|
42 |
-
return 'cms_page_view' == $this->getRoute();
|
43 |
-
}
|
44 |
-
|
45 |
-
public function isCategory()
|
46 |
-
{
|
47 |
-
return 'catalog_category_view' == $this->getRoute();
|
48 |
-
}
|
49 |
-
|
50 |
-
public function isSearch(){
|
51 |
-
return 'catalogsearch_result_index' == $this->getRoute();
|
52 |
-
}
|
53 |
-
|
54 |
public function isProduct()
|
55 |
{
|
56 |
return 'catalog_product_view' == $this->getRoute();
|
57 |
}
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
public function isCheckout()
|
65 |
-
{
|
66 |
-
return 'checkout_onepage_index' == $this->getRoute();
|
67 |
-
}
|
68 |
-
|
69 |
-
public function is404()
|
70 |
-
{
|
71 |
-
return 'cms_index_noRoute' == $this->getRoute();
|
72 |
-
}
|
73 |
-
|
74 |
public function isConfirmation()
|
75 |
{
|
76 |
$request = Mage::app()->getRequest();
|
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 data helper
|
23 |
+
*
|
24 |
+
* @category Hic
|
25 |
+
* @package Integration
|
26 |
+
* @author HiConversion <support@hiconversion.com>
|
27 |
+
*/
|
28 |
class Hic_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
29 |
{
|
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 |
|
34 |
+
/**
|
35 |
+
* Returns Site ID from Configuration
|
36 |
+
*
|
37 |
+
* @return string
|
38 |
+
*/
|
39 |
public function getSiteId()
|
40 |
{
|
41 |
return Mage::getStoreConfig(self::SETTINGS_SITE_ID);
|
42 |
}
|
43 |
|
44 |
+
/**
|
45 |
+
* Determines if module is enabled or not
|
46 |
+
*
|
47 |
+
* @return boolean
|
48 |
+
*/
|
49 |
public function isEnabled()
|
50 |
{
|
51 |
return Mage::getStoreConfig(self::SETTINGS_ENABLED);
|
52 |
}
|
53 |
|
54 |
+
/**
|
55 |
+
* Determines if CX Optimization is enabled or not
|
56 |
+
*
|
57 |
+
* @return boolean
|
58 |
+
*/
|
59 |
public function isEnabled2()
|
60 |
{
|
61 |
return Mage::getStoreConfig(self::SETTINGS_ENABLED_2);
|
62 |
}
|
63 |
|
64 |
+
/**
|
65 |
+
* Returns Data model
|
66 |
+
*
|
67 |
+
* @return object
|
68 |
+
*/
|
69 |
public function getHicData()
|
70 |
{
|
71 |
return Mage::getModel('integration/data');
|
72 |
}
|
73 |
|
74 |
+
/**
|
75 |
+
* Determines and returns page route
|
76 |
+
*
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
public function getRoute()
|
80 |
{
|
81 |
$route = Mage::app()->getFrontController()->getAction()->getFullActionName();
|
82 |
return $route;
|
83 |
}
|
84 |
|
85 |
+
/**
|
86 |
+
* Determines if its a product page or not
|
87 |
+
*
|
88 |
+
* @return boolean
|
89 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
public function isProduct()
|
91 |
{
|
92 |
return 'catalog_product_view' == $this->getRoute();
|
93 |
}
|
94 |
|
95 |
+
/**
|
96 |
+
* Determines if Confirmation page or not
|
97 |
+
*
|
98 |
+
* @return boolean
|
99 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
public function isConfirmation()
|
101 |
{
|
102 |
$request = Mage::app()->getRequest();
|
app/code/community/Hic/Integration/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2015 HiConversion, Inc.
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in
|
13 |
+
all copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21 |
+
THE SOFTWARE.
|
app/code/community/Hic/Integration/Model/Container/Template.php
CHANGED
@@ -1,8 +1,32 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Hic_Integration_Model_Container_Template extends Enterprise_PageCache_Model_Container_Advanced_Quote
|
4 |
{
|
5 |
-
|
6 |
/**
|
7 |
* Render block content
|
8 |
*
|
@@ -20,6 +44,13 @@ class Hic_Integration_Model_Container_Template extends Enterprise_PageCache_Mode
|
|
20 |
return $block->toHtml();
|
21 |
}
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
protected function _saveCache($data, $id, $tags = array(), $lifetime = null)
|
24 |
{
|
25 |
return false;
|
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 template model
|
23 |
+
*
|
24 |
+
* @category Hic
|
25 |
+
* @package Integration
|
26 |
+
* @author HiConversion <support@hiconversion.com>
|
27 |
+
*/
|
28 |
class Hic_Integration_Model_Container_Template extends Enterprise_PageCache_Model_Container_Advanced_Quote
|
29 |
{
|
|
|
30 |
/**
|
31 |
* Render block content
|
32 |
*
|
44 |
return $block->toHtml();
|
45 |
}
|
46 |
|
47 |
+
/**
|
48 |
+
* @param $data
|
49 |
+
* @param $id
|
50 |
+
* @param array $tags
|
51 |
+
* @param null $lifetime
|
52 |
+
* @return bool
|
53 |
+
*/
|
54 |
protected function _saveCache($data, $id, $tags = array(), $lifetime = null)
|
55 |
{
|
56 |
return false;
|
app/code/community/Hic/Integration/Model/Data.php
CHANGED
@@ -1,12 +1,40 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Hic_Integration_Model_Data extends Varien_Object
|
4 |
{
|
5 |
-
protected $_version =
|
6 |
-
protected $_platform =
|
7 |
|
8 |
const CATALOG_URL = 'catalog/product/';
|
9 |
|
|
|
|
|
|
|
10 |
protected function _construct()
|
11 |
{
|
12 |
$this
|
@@ -24,6 +52,11 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
24 |
}
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
|
|
27 |
public function hicData()
|
28 |
{
|
29 |
$data = $this->toArray(array('page', 'cart', 'user','tr','version','platform','pid','product'));
|
@@ -34,31 +67,43 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
34 |
}
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
protected function _getCartItems($items)
|
38 |
{
|
39 |
$data = array();
|
40 |
foreach ($items as $i) {
|
41 |
-
$
|
42 |
-
if ($
|
43 |
$info = array();
|
44 |
$info['tt'] = (float)$i->getRowTotalInclTax();
|
45 |
$info['ds'] = (float)$i->getDiscountAmount();
|
46 |
$info['qt'] = (float)$i->getQty();
|
47 |
-
$info['id'] = $
|
48 |
-
$info['url'] = $
|
49 |
-
$info['nm'] = $
|
50 |
-
$info['bpr'] = (float)$
|
51 |
-
$info['pr'] = (float)$
|
52 |
-
$info['desc'] = strip_tags($
|
53 |
-
$info['img'] = $
|
54 |
-
$info['sku'] = $
|
55 |
-
$info['cat'] = $
|
56 |
$data[] = $info;
|
57 |
}
|
58 |
}
|
59 |
return $data;
|
60 |
}
|
61 |
|
|
|
|
|
|
|
|
|
|
|
62 |
protected function _initPage()
|
63 |
{
|
64 |
$crumb = array();
|
@@ -72,6 +117,11 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
72 |
return $this;
|
73 |
}
|
74 |
|
|
|
|
|
|
|
|
|
|
|
75 |
protected function _initCart()
|
76 |
{
|
77 |
$cart = Mage::getModel('checkout/cart')->getQuote();
|
@@ -98,6 +148,11 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
98 |
}
|
99 |
}
|
100 |
|
|
|
|
|
|
|
|
|
|
|
101 |
protected function _initUser()
|
102 |
{
|
103 |
$session = Mage::helper('customer');
|
@@ -107,7 +162,7 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
107 |
$data['auth'] = $session->isLoggedIn();
|
108 |
$data['ht'] = false;
|
109 |
$data['nv'] = true;
|
110 |
-
$data['cg'] = Mage::getSingleton('customer/session')->getCustomerGroupId();
|
111 |
$data['sid'] = Mage::getSingleton("core/session")->getEncryptedSessionId();
|
112 |
if ($customer->getId()) {
|
113 |
// Determine if customer has transacted or not. Must be logged in.
|
@@ -135,6 +190,11 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
135 |
}
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
|
|
138 |
protected function _initOrder()
|
139 |
{
|
140 |
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
@@ -143,7 +203,7 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
143 |
}
|
144 |
$order = Mage::getModel('sales/order')->load($orderId);
|
145 |
$transaction = array();
|
146 |
-
if (
|
147 |
if ($order->getIncrementId()) {
|
148 |
$transaction['id'] = $order->getIncrementId();
|
149 |
}
|
@@ -176,6 +236,11 @@ class Hic_Integration_Model_Data extends Varien_Object
|
|
176 |
}
|
177 |
}
|
178 |
|
|
|
|
|
|
|
|
|
|
|
179 |
protected function _initProduct()
|
180 |
{
|
181 |
if ($product = Mage::registry('current_product')) {
|
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 data model
|
23 |
+
*
|
24 |
+
* @category Hic
|
25 |
+
* @package Integration
|
26 |
+
* @author HiConversion <support@hiconversion.com>
|
27 |
+
*/
|
28 |
class Hic_Integration_Model_Data extends Varien_Object
|
29 |
{
|
30 |
+
protected $_version = '1.0';
|
31 |
+
protected $_platform = 'magento';
|
32 |
|
33 |
const CATALOG_URL = 'catalog/product/';
|
34 |
|
35 |
+
/**
|
36 |
+
* Runs module
|
37 |
+
*/
|
38 |
protected function _construct()
|
39 |
{
|
40 |
$this
|
52 |
}
|
53 |
}
|
54 |
|
55 |
+
/**
|
56 |
+
* Return JSON string representing data object
|
57 |
+
*
|
58 |
+
* @return string
|
59 |
+
*/
|
60 |
public function hicData()
|
61 |
{
|
62 |
$data = $this->toArray(array('page', 'cart', 'user','tr','version','platform','pid','product'));
|
67 |
}
|
68 |
}
|
69 |
|
70 |
+
/**
|
71 |
+
* Returns product information for each product
|
72 |
+
* passed into function
|
73 |
+
*
|
74 |
+
* @param $items
|
75 |
+
* @return array
|
76 |
+
*/
|
77 |
protected function _getCartItems($items)
|
78 |
{
|
79 |
$data = array();
|
80 |
foreach ($items as $i) {
|
81 |
+
$product = Mage::getModel('catalog/product')->load($i->getProductId());
|
82 |
+
if ($product) {
|
83 |
$info = array();
|
84 |
$info['tt'] = (float)$i->getRowTotalInclTax();
|
85 |
$info['ds'] = (float)$i->getDiscountAmount();
|
86 |
$info['qt'] = (float)$i->getQty();
|
87 |
+
$info['id'] = $product->getId();
|
88 |
+
$info['url'] = $product->getProductUrl();
|
89 |
+
$info['nm'] = $product->getName();
|
90 |
+
$info['bpr'] = (float)$product->getPrice();
|
91 |
+
$info['pr'] = (float)$product->getFinalPrice();
|
92 |
+
$info['desc'] = strip_tags($product->getShortDescription());
|
93 |
+
$info['img'] = $product->getImageUrl();
|
94 |
+
$info['sku'] = $product->getSku();
|
95 |
+
$info['cat'] = $product->getCategoryIds();
|
96 |
$data[] = $info;
|
97 |
}
|
98 |
}
|
99 |
return $data;
|
100 |
}
|
101 |
|
102 |
+
/**
|
103 |
+
* Returns page route and breadcrumb info
|
104 |
+
*
|
105 |
+
* @return array $this
|
106 |
+
*/
|
107 |
protected function _initPage()
|
108 |
{
|
109 |
$crumb = array();
|
117 |
return $this;
|
118 |
}
|
119 |
|
120 |
+
/**
|
121 |
+
* Returns cart information
|
122 |
+
*
|
123 |
+
* @return array $this
|
124 |
+
*/
|
125 |
protected function _initCart()
|
126 |
{
|
127 |
$cart = Mage::getModel('checkout/cart')->getQuote();
|
148 |
}
|
149 |
}
|
150 |
|
151 |
+
/**
|
152 |
+
* Returns user information
|
153 |
+
*
|
154 |
+
* @return array $this
|
155 |
+
*/
|
156 |
protected function _initUser()
|
157 |
{
|
158 |
$session = Mage::helper('customer');
|
162 |
$data['auth'] = $session->isLoggedIn();
|
163 |
$data['ht'] = false;
|
164 |
$data['nv'] = true;
|
165 |
+
$data['cg'] = Mage::getSingleton('customer/session')->getCustomerGroupId();
|
166 |
$data['sid'] = Mage::getSingleton("core/session")->getEncryptedSessionId();
|
167 |
if ($customer->getId()) {
|
168 |
// Determine if customer has transacted or not. Must be logged in.
|
190 |
}
|
191 |
}
|
192 |
|
193 |
+
/**
|
194 |
+
* Returns transaction information
|
195 |
+
*
|
196 |
+
* @return array $this
|
197 |
+
*/
|
198 |
protected function _initOrder()
|
199 |
{
|
200 |
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
203 |
}
|
204 |
$order = Mage::getModel('sales/order')->load($orderId);
|
205 |
$transaction = array();
|
206 |
+
if ($order) {
|
207 |
if ($order->getIncrementId()) {
|
208 |
$transaction['id'] = $order->getIncrementId();
|
209 |
}
|
236 |
}
|
237 |
}
|
238 |
|
239 |
+
/**
|
240 |
+
* Returns product information
|
241 |
+
*
|
242 |
+
* @return array $this
|
243 |
+
*/
|
244 |
protected function _initProduct()
|
245 |
{
|
246 |
if ($product = Mage::registry('current_product')) {
|
app/design/frontend/base/default/template/hic/body.phtml
CHANGED
@@ -1,4 +1,23 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
$helper = $this->helper('integration');
|
3 |
?>
|
4 |
<?php if ($helper->isEnabled() && $helper->isEnabled2()) : ?>
|
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 |
$helper = $this->helper('integration');
|
22 |
?>
|
23 |
<?php if ($helper->isEnabled() && $helper->isEnabled2()) : ?>
|
app/design/frontend/base/default/template/hic/head.phtml
CHANGED
@@ -1,4 +1,23 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
$helper = $this->helper('integration');
|
3 |
$hic_data = $helper->getHicData();
|
4 |
?>
|
@@ -22,7 +41,7 @@ $hic_data = $helper->getHicData();
|
|
22 |
|
23 |
<script type="text/javascript">
|
24 |
var __hic = __hic || {};
|
25 |
-
__hic.version = "1.0.
|
26 |
__hic.data = <?php echo $hic_data->hicData() ?>;
|
27 |
</script>
|
28 |
|
@@ -30,7 +49,7 @@ $hic_data = $helper->getHicData();
|
|
30 |
<script id="hiconversion_head_script" type="text/javascript">
|
31 |
var hiconversion_load = new Date();
|
32 |
function hiconversion_head_load() {
|
33 |
-
var external ="";
|
34 |
var script = document.createElement("script");
|
35 |
script.id = "hiconversion_head_include";
|
36 |
script.async = "async";
|
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 |
$helper = $this->helper('integration');
|
22 |
$hic_data = $helper->getHicData();
|
23 |
?>
|
41 |
|
42 |
<script type="text/javascript">
|
43 |
var __hic = __hic || {};
|
44 |
+
__hic.version = "1.0.1";
|
45 |
__hic.data = <?php echo $hic_data->hicData() ?>;
|
46 |
</script>
|
47 |
|
49 |
<script id="hiconversion_head_script" type="text/javascript">
|
50 |
var hiconversion_load = new Date();
|
51 |
function hiconversion_head_load() {
|
52 |
+
var external = "";
|
53 |
var script = document.createElement("script");
|
54 |
script.id = "hiconversion_head_include";
|
55 |
script.async = "async";
|
package.xml
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Hic_Integration</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>MIT</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>Once live, the extension will provide
|
11 |

|
12 |
-
Data Capture: We productized our knowledge about the types of data collected by the most advanced web analytics solutions deployed on
|
13 |

|
14 |
-
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
|
15 |
-
<notes>
|
16 |
<authors><author><name>HiConversion</name><user>hiconversion</user><email>dhenrickson@hiconversion.com</email></author></authors>
|
17 |
-
<date>2015-04-
|
18 |
-
<time>15:
|
19 |
-
<contents><target name="magecommunity"><dir name="Hic"><dir name="Integration"><dir name="Block"><dir name="Html"><file name="Head.php" hash="
|
20 |
<compatible/>
|
21 |
-
<dependencies><required><php><min>5.
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Hic_Integration</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>MIT</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>HiConversion - The all-in-one tool for web analytics, testing, targeting, personalization, and CX Optimization.</summary>
|
10 |
+
<description>Once live, the extension will provide accurate and comprehensive data capture, as well as client-side page modification capabilities needed for the running of live adaptive customer experience optimization campaigns:
|
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>Some refactoring and commenting per Magento Coding Standards and Best Practices.</notes>
|
16 |
<authors><author><name>HiConversion</name><user>hiconversion</user><email>dhenrickson@hiconversion.com</email></author></authors>
|
17 |
+
<date>2015-04-24</date>
|
18 |
+
<time>15:48:21</time>
|
19 |
+
<contents><target name="magecommunity"><dir name="Hic"><dir name="Integration"><dir name="Block"><dir name="Html"><file name="Head.php" hash="cffd9d7f79c652047d0d713bfc52a7ae"/></dir><file name="Template.php" hash="711e3c1b282d347a0bd5e3b5aea94538"/></dir><dir name="Helper"><file name="Data.php" hash="56f1cc841b8b2f9109bc33021daf64ef"/></dir><file name="LICENSE.txt" hash="3b58e20f0b691c258d39cc034c5376eb"/><dir name="Model"><dir name="Container"><file name="Template.php" hash="c84267f7b5ea92fbeda5859376b1fa88"/></dir><file name="Data.php" hash="c097173805f43c16c7b9c9220047157d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f122c26dfe576f4c09f83abe76424931"/><file name="cache.xml" hash="b67ce021de2a64b796e3ba88e84df601"/><file name="config.xml" hash="b192a565cec62d2eadcac18657515962"/><file name="system.xml" hash="62129b4db99b2ffcc698c68f89712ad1"/></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="01b3d087e71e592a5dadb8ac0ad7c822"/></dir></dir><dir name="template"><dir name="hic"><file name="body.phtml" hash="a337202d1f589d299392a3dc6a3da4e3"/><file name="head.phtml" hash="a4d2f163f968f464a7fc8820f03338b8"/></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.6</min><max>5.6.7</max></php></required></dependencies>
|
22 |
</package>
|