Retargeting_Tracker - Version 1.2.0

Version Notes

Retargeting V3

Download this release

Release Info

Developer Retargeting Team
Extension Retargeting_Tracker
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.3 to 1.2.0

app/code/community/Retargeting/.DS_Store ADDED
Binary file
app/code/community/Retargeting/Tracker/.DS_Store ADDED
Binary file
app/code/community/Retargeting/Tracker/Model/Observer.php CHANGED
@@ -7,6 +7,8 @@
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
 
 
 
10
  class Retargeting_Tracker_Model_Observer
11
  {
12
  public function TrackSetEmail($observer)
@@ -139,6 +141,9 @@ class Retargeting_Tracker_Model_Observer
139
 
140
  public function TrackSaveOrder($observer)
141
  {
 
 
 
142
  $magentoVersion = Mage::getVersion();
143
  if($magentoVersion > "1.4.2.0") {
144
 
@@ -197,6 +202,14 @@ class Retargeting_Tracker_Model_Observer
197
  "total" => $order->getGrandTotal(),
198
  "products" => "[".implode(",", $products)."]",
199
  );
 
 
 
 
 
 
 
 
200
  Mage::getSingleton('core/session')->setTriggerSaveOrder($info);
201
  } else {
202
 
@@ -239,6 +252,13 @@ class Retargeting_Tracker_Model_Observer
239
  "total" => $order->getGrandTotal(),
240
  "products" => "[".implode(",", $products)."]",
241
  );
 
 
 
 
 
 
 
242
 
243
  Mage::getSingleton('core/session')->setTriggerSaveOrder($info);
244
  }
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
 
10
+ require_once(Mage::getBaseDir('lib') . '/Retargeting/Retargeting_REST_API_Client.php');
11
+
12
  class Retargeting_Tracker_Model_Observer
13
  {
14
  public function TrackSetEmail($observer)
141
 
142
  public function TrackSaveOrder($observer)
143
  {
144
+ $apiKey = Mage::getStoreConfig('retargetingtracker_options/domain/domain_api_key');
145
+ $token = Mage::getStoreConfig('retargetingtracker_options/token/token');
146
+
147
  $magentoVersion = Mage::getVersion();
148
  if($magentoVersion > "1.4.2.0") {
149
 
202
  "total" => $order->getGrandTotal(),
203
  "products" => "[".implode(",", $products)."]",
204
  );
205
+
206
+ if($apiKey && $apiKey != "" && $token && $token != "") {
207
+ $retargetingClient = new Retargeting_REST_API_Client($apiKey,$token);
208
+ $retargetingClient->setResponseFormat("json");
209
+ $retargetingClient->setDecoding(false);
210
+ $response = $retargetingClient->order->save($info, $products);
211
+ }
212
+
213
  Mage::getSingleton('core/session')->setTriggerSaveOrder($info);
214
  } else {
215
 
252
  "total" => $order->getGrandTotal(),
253
  "products" => "[".implode(",", $products)."]",
254
  );
255
+
256
+ if($apiKey && $apiKey != "" && $token && $token != "") {
257
+ $retargetingClient = new Retargeting_REST_API_Client($apiKey,$token);
258
+ $retargetingClient->setResponseFormat("json");
259
+ $retargetingClient->setDecoding(false);
260
+ $response = $retargetingClient->order->save($info, $products);
261
+ }
262
 
263
  Mage::getSingleton('core/session')->setTriggerSaveOrder($info);
264
  }
app/code/community/Retargeting/Tracker/controllers/DiscountsController.php CHANGED
@@ -19,7 +19,7 @@ class Retargeting_Tracker_DiscountsController extends Mage_Core_Controller_Front
19
 
20
  if ( isset($params['key']) && isset($params['value']) && isset($params['type']) && isset($params['count']) ) {
21
 
22
- $userApiKey = Mage::getStoreConfig('retargetingtracker_options/discounts/discount_api_key');
23
 
24
  if ( $userApiKey != '' && $params['key'] == $userApiKey && $params['value'] != "" && $params['type'] != "" && $params['count'] != "" ) {
25
  $name = 'RA-' . htmlspecialchars($params['type']) . '-' . htmlspecialchars($params['value']);
19
 
20
  if ( isset($params['key']) && isset($params['value']) && isset($params['type']) && isset($params['count']) ) {
21
 
22
+ $userApiKey = Mage::getStoreConfig('retargetingtracker_options/token/token');
23
 
24
  if ( $userApiKey != '' && $params['key'] == $userApiKey && $params['value'] != "" && $params['type'] != "" && $params['count'] != "" ) {
25
  $name = 'RA-' . htmlspecialchars($params['type']) . '-' . htmlspecialchars($params['value']);
app/code/community/Retargeting/Tracker/controllers/ProductsController.php CHANGED
@@ -16,7 +16,7 @@ class Retargeting_Tracker_ProductsController extends Mage_Core_Controller_Front_
16
 
17
  $params = $this->getRequest()->getParams();
18
 
19
- if ( isset($params['key']) && $params['key'] != '' && $params['key'] == Mage::getStoreConfig('retargetingtracker_options/discounts/discount_api_key') ) {
20
 
21
  $collection = Mage::getResourceModel('catalog/product_collection');
22
  foreach($collection as $product) {
16
 
17
  $params = $this->getRequest()->getParams();
18
 
19
+ if ( isset($params['key']) && $params['key'] != '' && $params['key'] == Mage::getStoreConfig('retargetingtracker_options/token/token') ) {
20
 
21
  $collection = Mage::getResourceModel('catalog/product_collection');
22
  foreach($collection as $product) {
app/code/community/Retargeting/Tracker/etc/.DS_Store ADDED
Binary file
app/code/community/Retargeting/Tracker/etc/config.xml CHANGED
@@ -11,7 +11,7 @@
11
  <config>
12
  <modules>
13
  <Retargeting_Tracker>
14
- <version>1.1.3</version>
15
  </Retargeting_Tracker>
16
  </modules>
17
  <global>
@@ -33,15 +33,6 @@
33
  <class>Retargeting_Tracker_Helper</class>
34
  </retargeting_tracker>
35
  </helpers>
36
- <!--
37
- <resources>
38
- <retargeting_tracker_setup>
39
- <setup>
40
- <module>Retargeting_Tracker</module>
41
- </setup>
42
- </retargeting_tracker_setup>
43
- </resources>
44
- -->
45
  <events>
46
  <customer_login>
47
  <observers>
@@ -98,33 +89,6 @@
98
  </updates>
99
  </layout>
100
  </frontend>
101
- <!--
102
- <admin>
103
- <routers>
104
- <adminhtml>
105
- <args>
106
- <modules>
107
- <Retargeting_Tracker before="Mage_Adminhtml">Retargeting_Tracker_Adminhtml</Retargeting_Tracker>
108
- </modules>
109
- </args>
110
- </adminhtml>
111
- </routers>
112
- </admin>
113
- -->
114
- <!--
115
- <crontab>
116
- <jobs>
117
- <retargeting_tracker_cron>
118
- <schedule>
119
- <cron_expr>0,45 * * * *</cron_expr>
120
- </schedule>
121
- <run>
122
- <model>retargeting_tracker/observer::methodName</model>
123
- </run>
124
- </retargeting_tracker_cron>
125
- </jobs>
126
- </crontab>
127
- -->
128
  <adminhtml>
129
  <acl>
130
  <resources>
11
  <config>
12
  <modules>
13
  <Retargeting_Tracker>
14
+ <version>1.2.0</version>
15
  </Retargeting_Tracker>
16
  </modules>
17
  <global>
33
  <class>Retargeting_Tracker_Helper</class>
34
  </retargeting_tracker>
35
  </helpers>
 
 
 
 
 
 
 
 
 
36
  <events>
37
  <customer_login>
38
  <observers>
89
  </updates>
90
  </layout>
91
  </frontend>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  <adminhtml>
93
  <acl>
94
  <resources>
app/code/community/Retargeting/Tracker/etc/system.xml CHANGED
@@ -44,25 +44,25 @@
44
  </domain_api_key>
45
  </fields>
46
  </domain>
47
- <discounts translate="label">
48
- <label>Discounts</label>
49
  <frontend_type>text</frontend_type>
50
  <sort_order>1</sort_order>
51
  <show_in_default>1</show_in_default>
52
  <show_in_website>1</show_in_website>
53
  <show_in_store>1</show_in_store>
54
  <fields>
55
- <discount_api_key>
56
- <label>Discounts API Key</label>
57
  <frontend_type>text</frontend_type>
58
  <sort_order>1</sort_order>
59
  <show_in_default>1</show_in_default>
60
  <show_in_website>1</show_in_website>
61
  <show_in_store>1</show_in_store>
62
- <comment><![CDATA[<a href="https://retargeting.biz/admin?action=api_redirect&token=028e36488ab8dd68eaac58e07ef8f9bf">Click here</a> to get your Discounts API Key]]></comment>
63
- </discount_api_key>
64
  </fields>
65
- </discounts>
66
  <information translate="label">
67
  <label>Specific URLs</label>
68
  <frontend_type>text</frontend_type>
@@ -70,7 +70,7 @@
70
  <show_in_default>1</show_in_default>
71
  <show_in_website>1</show_in_website>
72
  <show_in_store>1</show_in_store>
73
- <comment><![CDATA[<strong>Discounts API URL:</strong> /retargetingtracker/discounts/addDiscountCode<br><strong>Products Feed URL:</strong> /retargetingtracker/products]]></comment>
74
  </information>
75
  <more translate="label">
76
  <label>More</label>
@@ -100,14 +100,32 @@
100
  <!--<comment><![CDATA[likeFacebook function]]></comment>-->
101
  </facebook>
102
  <css translate="label">
103
- <label>Custom CSS</label>
104
  <frontend_type>text</frontend_type>
105
  <sort_order>30</sort_order>
106
  <show_in_default>1</show_in_default>
107
  <show_in_website>1</show_in_website>
108
  <show_in_store>1</show_in_store>
109
- <comment><![CDATA[Insert your main product image CSS class]]></comment>
110
  </css>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  </fields>
112
  </more>
113
 
44
  </domain_api_key>
45
  </fields>
46
  </domain>
47
+ <token translate="label">
48
+ <label>Token</label>
49
  <frontend_type>text</frontend_type>
50
  <sort_order>1</sort_order>
51
  <show_in_default>1</show_in_default>
52
  <show_in_website>1</show_in_website>
53
  <show_in_store>1</show_in_store>
54
  <fields>
55
+ <token>
56
+ <label>Token</label>
57
  <frontend_type>text</frontend_type>
58
  <sort_order>1</sort_order>
59
  <show_in_default>1</show_in_default>
60
  <show_in_website>1</show_in_website>
61
  <show_in_store>1</show_in_store>
62
+ <comment><![CDATA[<a href="https://retargeting.biz/admin?action=api_redirect&token=028e36488ab8dd68eaac58e07ef8f9bf">Click here</a> to get your token]]></comment>
63
+ </token>
64
  </fields>
65
+ </token>
66
  <information translate="label">
67
  <label>Specific URLs</label>
68
  <frontend_type>text</frontend_type>
70
  <show_in_default>1</show_in_default>
71
  <show_in_website>1</show_in_website>
72
  <show_in_store>1</show_in_store>
73
+ <comment><![CDATA[<strong>token API URL:</strong> /retargetingtracker/discounts/addDiscountCode<br><strong>Products Feed URL:</strong> /retargetingtracker/products]]></comment>
74
  </information>
75
  <more translate="label">
76
  <label>More</label>
100
  <!--<comment><![CDATA[likeFacebook function]]></comment>-->
101
  </facebook>
102
  <css translate="label">
103
+ <label>Main image CSS Class</label>
104
  <frontend_type>text</frontend_type>
105
  <sort_order>30</sort_order>
106
  <show_in_default>1</show_in_default>
107
  <show_in_website>1</show_in_website>
108
  <show_in_store>1</show_in_store>
109
+ <comment><![CDATA[Insert your main product image CSS Class]]></comment>
110
  </css>
111
+ <cartid translate="label">
112
+ <label>Add To Cart Button ID or Class</label>
113
+ <frontend_type>text</frontend_type>
114
+ <sort_order>40</sort_order>
115
+ <show_in_default>1</show_in_default>
116
+ <show_in_website>1</show_in_website>
117
+ <show_in_store>1</show_in_store>
118
+ <comment><![CDATA[Add To Cart Button ID or Class]]></comment>
119
+ </cartid>
120
+ <pricelabelid translate="label">
121
+ <label>Add Price Label ID or Class</label>
122
+ <frontend_type>text</frontend_type>
123
+ <sort_order>50</sort_order>
124
+ <show_in_default>1</show_in_default>
125
+ <show_in_website>1</show_in_website>
126
+ <show_in_store>1</show_in_store>
127
+ <comment><![CDATA[Add Price Label ID or Class]]></comment>
128
+ </pricelabelid>
129
  </fields>
130
  </more>
131
 
app/design/frontend/base/default/layout/retargeting_tracker.xml DELETED
@@ -1,14 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
- <default>
4
-
5
- <reference name="head">
6
- <block type="retargeting_tracker/embed" name="retargeting.embed" template="retargeting_tracker/embed.phtml"/>
7
- </reference>
8
-
9
- <reference name="head">
10
- <block type="retargeting_tracker/triggers" name="retargeting.triggers" template="retargeting_tracker/triggers.phtml"/>
11
- </reference>
12
-
13
- </default>
14
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/retargeting_tracker/embed.phtml DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- /**
3
- * @category Retargeting
4
- * @package Retargeting_Tracker
5
- * @author Retargeting <info@retargeting.biz>
6
- * @copyright Copyright (c) Retargeting
7
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
- */
9
- ?>
10
- <script type="text/javascript">
11
- <?php $ra_key = Mage::getStoreConfig('retargetingtracker_options/domain/domain_api_key'); ?>
12
- <?php if ($ra_key && $ra_key != '') : ?>
13
- (function(){
14
- var ra_key = "<?php echo $ra_key; ?>";
15
- var ra = document.createElement("script"); ra.type ="text/javascript"; ra.async = true; ra.src = ("https:" ==
16
- document.location.protocol ? "https://" : "http://") + "retargeting-data.eu/rajs/" + ra_key + ".js";
17
- var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ra,s);})();
18
- <?php else : ?>
19
- (function(){
20
- var ra = document.createElement("script"); ra.type ="text/javascript"; ra.async = true; ra.src = ("https:" ==
21
- document.location.protocol ? "https://" : "http://") + "retargeting-data.eu/" +
22
- document.location.hostname.replace("www.","") + "/ra.js"; var s =
23
- document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ra,s);})();
24
- <?php endif; ?>
25
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/retargeting_tracker/triggers.phtml DELETED
@@ -1,990 +0,0 @@
1
- <?php
2
- /**
3
- * @category Retargeting
4
- * @package Retargeting_Tracker
5
- * @author Retargeting <info@retargeting.biz>
6
- * @copyright Copyright (c) Retargeting
7
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
- */
9
- ?>
10
- <?php
11
- /**
12
- * Retargeting Triggers code
13
- **/
14
- ?>
15
- <?php $magentoVersion = Mage::getVersion(); ?>
16
-
17
- <?php if ( Mage::app()->getFrontController()->getRequest()->getControllerName() == "product" && !is_null(Mage::registry('product')) ) : ?>
18
- <script>
19
- // Retargeting JS helpers
20
- function _ra_helper_addLoadEvent(func) {
21
- var oldonload = window.onload;
22
- if (typeof window.onload != 'function') {
23
- window.onload = func;
24
- } else {
25
- window.onload = function() {
26
- if (oldonload) {
27
- oldonload();
28
- }
29
- func();
30
- }
31
- }
32
- }
33
- </script>
34
- <?php endif ?>
35
-
36
- <script>
37
- <?php
38
- /*
39
- ----------------------- Trigger setEmail -----------------------
40
- */
41
- ?>
42
- <?php if ( $info = Mage::getSingleton('core/session')->getTriggerSetEmail() ) : ?>
43
- // Trigger setEmail
44
- var _ra = _ra || {};
45
- _ra.setEmailInfo = {
46
- "email": "<?php echo htmlspecialchars($info['email']); ?>",
47
- "name": "<?php echo htmlspecialchars($info['name']); ?>",
48
- "phone": "<?php echo htmlspecialchars($info['phone']); ?>",
49
- "city": "<?php echo htmlspecialchars($info['city']); ?>",
50
- "sex": "<?php echo htmlspecialchars($info['sex']); ?>"
51
- };
52
- if (_ra.ready !== undefined) {
53
- if(typeof _ra.setEmail !== "undefined") _ra.setEmail(_ra.setEmailInfo);
54
- }
55
- <?php Mage::getSingleton('core/session')->unsTriggerSetEmail(); ?>
56
- <?php endif ?>
57
- <?php
58
- /*
59
- ----------------------- Trigger sendCategory -----------------------
60
- */
61
- ?>
62
- <?php if ( Mage::app()->getFrontController()->getRequest()->getControllerName() == "category" ) : ?>
63
-
64
- // Trigger sendCategory
65
-
66
- <?php $_category = Mage::registry('current_category'); ?>
67
- <?php
68
- $_categoryParent = "false";
69
- $_categoryBreadcrumb = "[]";
70
- if ( $_category->getLevel() > 2 ) {
71
- $_categoryParent = '"'.$_category->getParentId().'"';
72
- $_categoryBreadcrumb = array();
73
- $breadcrumbCategory = $_category;
74
- while ( $breadcrumbCategory->getLevel() > 2 ) {
75
- $breadcrumbCategory = Mage::getModel('catalog/category')->load($breadcrumbCategory->getParentId());
76
-
77
- $_categoryBreadcrumb[] = '{
78
- "id": "'.$breadcrumbCategory->getId().'",
79
- "name": "'.htmlspecialchars($breadcrumbCategory->getName()).'",
80
- "parent": '.( $breadcrumbCategory->getLevel() > 2 ? '"'.$breadcrumbCategory->getParentId().'"' : 'false' ).'
81
- }';
82
- }
83
- $_categoryBreadcrumb = '['.implode(', ', $_categoryBreadcrumb).']';
84
- }
85
- ?>
86
-
87
- var _ra = _ra || {};
88
- _ra.sendCategoryInfo = {
89
- "id": "<?php echo $_category->getId(); ?>",
90
- "name": "<?php echo htmlspecialchars($_category->getName()); ?>",
91
- "parent": <?php echo $_categoryParent; ?>,
92
- "category_breadcrumb": <?php echo $_categoryBreadcrumb; ?>
93
- };
94
-
95
- if (_ra.ready !== undefined) {
96
- if(typeof _ra.sendCategory !== "undefined") _ra.sendCategory(_ra.sendCategoryInfo);
97
- }
98
-
99
- <?php endif ?>
100
- <?php
101
- /*
102
- ----------------------- Trigger sendBrand -----------------------
103
- magento doesn't have core support for brands..
104
- */
105
- ?>
106
- <?php
107
- /*
108
- ----------------------- Trigger sendProduct -----------------------
109
- */
110
- ?>
111
- <?php if ( Mage::app()->getFrontController()->getRequest()->getControllerName() == "product" && !is_null(Mage::registry('product')) ) : ?>
112
-
113
- // Trigger sendProduct
114
-
115
- <?php $_product = Mage::registry('current_product'); ?>
116
-
117
- <?php if($_product) : ?>
118
- <?php
119
- $_productUrl = Mage::helper('core/url')->getCurrentUrl();
120
-
121
- $_category = false;
122
- if ( Mage::registry('current_category') ) {
123
- $_category = Mage::registry('current_category');
124
- } else {
125
- $_productCategoryIds = $_product->getCategoryIds();
126
- if ( count($_productCategoryIds) ) {
127
- $firstCategoryId = $_productCategoryIds[0];
128
- $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
129
- }
130
- }
131
-
132
- $_categoryParent = "false";
133
- $_categoryBreadcrumb = "[]";
134
-
135
- if($_category) {
136
- if ( $_category->getLevel() > 2 ) {
137
- $_categoryParent = '"'.$_category->getParentId().'"';
138
- $_categoryBreadcrumb = array();
139
- $breadcrumbCategory = $_category;
140
- while ( $breadcrumbCategory->getLevel() > 2 ) {
141
- $breadcrumbCategory = Mage::getModel('catalog/category')->load($breadcrumbCategory->getParentId());
142
-
143
- $_categoryBreadcrumb[] = '{
144
- "id": "'.$breadcrumbCategory->getId().'",
145
- "name": "'.htmlspecialchars($breadcrumbCategory->getName()).'",
146
- "parent": '.( $breadcrumbCategory->getLevel() > 2 ? '"'.$breadcrumbCategory->getParentId().'"' : 'false' ).'
147
- }';
148
- }
149
- $_categoryBreadcrumb = '['.implode(', ', $_categoryBreadcrumb).']';
150
- }
151
- $_category = '{"id": "'.$_category->getId().'", "name": "'.htmlspecialchars($_category->getName()).'", "parent": '.$_categoryParent.'}';
152
- } else {
153
- $_category = '{"id": "-1", "name": "no category", "parent": false}';
154
- }
155
- ?>
156
-
157
- var _ra = _ra || {};
158
- _ra.sendProductInfo = {
159
- "id": "<?php echo $_product->getId(); ?>",
160
- "name": "<?php echo htmlspecialchars($_product->getName()); ?>",
161
- "url": window.location.origin + window.location.pathname,
162
- "img": "<?php echo htmlspecialchars( Mage::helper('catalog/image')->init($_product, 'image')->resize(500) ); ?>",
163
- "price": <?php echo Mage::helper('tax')->getPrice($_product, $_product->getPrice()); ?>,
164
- "promo": <?php echo ( Mage::helper('tax')->getPrice($_product, $_product->getPrice()) - Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice()) > 0 ? Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice()) : 0 ); ?>,
165
- "stock": <?php echo $_product->getIsInStock() ?>,
166
- "brand": false,
167
- "category": <?php echo $_category; ?>,
168
- "category_breadcrumb": <?php echo $_categoryBreadcrumb; ?>
169
- };
170
-
171
- if (_ra.ready !== undefined) {
172
- if(typeof _ra.sendProduct !== "undefined") _ra.sendProduct(_ra.sendProductInfo);
173
- }
174
- <?php endif ?>
175
- <?php endif ?>
176
- <?php
177
- /*
178
- ----------------------- Trigger addToCart -----------------------
179
- */
180
- ?>
181
- <?php if ( $info = Mage::getSingleton('core/session')->getTriggerAddToCart() ) : ?>
182
-
183
- // Trigger addToCart
184
-
185
- <?php $referral = Mage::getSingleton('core/session')->getReferralController(); echo "/*".$referral."*/"; ?>
186
- <?php if ( $referral != "product" ) : ?>
187
-
188
- // Trigger sendProduct before addToCart
189
-
190
- <?php
191
- $_product = Mage::getModel('catalog/product')->load($info['product_id']);
192
- $_productUrl = $_product->getProductUrl();
193
- $_category = false;
194
-
195
- $_productCategoryIds = $_product->getCategoryIds();
196
- if ( count($_productCategoryIds) ) {
197
- $firstCategoryId = $_productCategoryIds[0];
198
- $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
199
- }
200
-
201
- $_categoryParent = "false";
202
- $_categoryBreadcrumb = "[]";
203
-
204
- if($_category) {
205
- if ( $_category->getLevel() > 2 ) {
206
- $_categoryParent = '"'.$_category->getParentId().'"';
207
- $_categoryBreadcrumb = array();
208
- $breadcrumbCategory = $_category;
209
- while ( $breadcrumbCategory->getLevel() > 2 ) {
210
- $breadcrumbCategory = Mage::getModel('catalog/category')->load($breadcrumbCategory->getParentId());
211
-
212
- $_categoryBreadcrumb[] = '{
213
- "id": "'.$breadcrumbCategory->getId().'",
214
- "name": "'.htmlspecialchars($breadcrumbCategory->getName()).'",
215
- "parent": '.( $breadcrumbCategory->getLevel() > 2 ? '"'.$breadcrumbCategory->getParentId().'"' : 'false' ).'
216
- }';
217
- }
218
- $_categoryBreadcrumb = '['.implode(', ', $_categoryBreadcrumb).']';
219
- }
220
- $_category = '{"id": "'.$_category->getId().'", "name": "'.htmlspecialchars($_category->getName()).'", "parent": '.$_categoryParent.'}';
221
- } else {
222
- $_category = '{"id": "-1", "name": "no category", "parent": false}';
223
- }
224
- ?>
225
-
226
- var _ra = _ra || {};
227
- _ra.sendProductInfo = {
228
- "id": "<?php echo $_product->getId(); ?>",
229
- "name": "<?php echo htmlspecialchars($_product->getName()); ?>",
230
- "url": window.location.origin + window.location.pathname,
231
- "img": "<?php echo htmlspecialchars( Mage::helper('catalog/image')->init($_product, 'image')->resize(500) ); ?>",
232
- "price": <?php echo Mage::helper('tax')->getPrice($_product, $_product->getPrice()); ?>,
233
- "promo": <?php echo ( Mage::helper('tax')->getPrice($_product, $_product->getPrice()) - Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice()) > 0 ? Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice()) : 0 ); ?>,
234
- "stock": <?php echo $_product->getIsInStock() ?>,
235
- "brand": false,
236
- "category": <?php echo $_category; ?>,
237
- "category_breadcrumb": <?php echo $_categoryBreadcrumb; ?>,
238
- "callback_function": function() {
239
- _ra.addToCartInfo = {
240
- "product_id": "<?php echo $info['product_id']; ?>",
241
- "variation": <?php echo $info['variation']; ?>
242
- };
243
- if(typeof _ra.addToCart !== "undefined") _ra.addToCart(_ra.addToCartInfo.product_id, _ra.addToCartInfo.variation);
244
- }
245
- };
246
-
247
- if (_ra.ready !== undefined) {
248
- if(typeof _ra.sendProduct !== "undefined") _ra.sendProduct(_ra.sendProductInfo);
249
- }
250
-
251
- <?php else : ?>
252
-
253
- var _ra = _ra || {};
254
- _ra.addToCartInfo = {
255
- "product_id": "<?php echo $info['product_id']; ?>",
256
- "variation": <?php echo $info['variation']; ?>
257
- };
258
-
259
- if (_ra.ready !== undefined) {
260
- if(typeof _ra.addToCart !== "undefined") _ra.addToCart(_ra.addToCartInfo.product_id, _ra.addToCartInfo.variation);
261
- }
262
-
263
- <?php endif ?>
264
-
265
- <?php Mage::getSingleton('core/session')->unsTriggerAddToCart(); ?>
266
- <?php endif ?>
267
- <?php
268
- /*
269
- ----------------------- Trigger setVariation -----------------------
270
- */
271
- if($magentoVersion > "1.4.2.0") :
272
- ?>
273
- <?php if ( Mage::app()->getFrontController()->getRequest()->getControllerName() == "product" && !is_null(Mage::registry('product')) ) : ?>
274
-
275
- // Trigger setVariation
276
-
277
- <?php $_product = Mage::registry('current_product'); ?>
278
- <?php if ($_product) : ?>
279
-
280
- <?php if ( !$_product->isConfigurable() ) : ?>
281
- <?php /*is not configurable*/ ?>
282
- <?php if ( $_product->getTypeInstance(true)->hasOptions($_product) ) : ?>
283
-
284
- function _ra_triggerSetVariation() {
285
- var _ra_variation = _ra_grabVariation();
286
- if(typeof _ra.setVariation !== "undefined") _ra.setVariation("<?php echo $_product->getId(); ?>", _ra_variation);
287
- }
288
-
289
- _ra_optElfunc = [];
290
- function _ra_grabVariation() {
291
- var _ra_vo = {};
292
- var _ra_voCode = [];
293
- var _ra_voDetails = {};
294
- <?php foreach ( $_product->getOptions() as $o ) : ?>
295
- <?php $optionType = $o->getType(); ?>
296
- <?php $optionId = $o->getId(); ?>
297
- <?php $optionTitle = $o->getTitle(); ?>
298
-
299
- <?php if ( $optionType == "area" ) : ?>
300
- if ( document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']") !== null ) {
301
- _ra_voCode.push(document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']").value);
302
- }
303
- <?php endif ?>
304
-
305
- <?php if ( $optionType == "field" ) : ?>
306
- if ( document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']") !== null ) {
307
- _ra_voCode.push(document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']").value);
308
- }
309
- <?php endif ?>
310
-
311
- <?php if ( $optionType == "checkbox" ) : ?>
312
- if ( document.querySelectorAll("input[type='checkbox'].product-custom-option[name='options[<?php echo $optionId; ?>][]']").length > 0 ) {
313
- var _ra_optionValue = [];
314
- var _ra_arr = document.querySelectorAll("input[type='checkbox'].product-custom-option[name='options[<?php echo $optionId; ?>][]']");
315
- for( var index = 0; index < _ra_arr.length; index ++ ) {
316
- if(_ra_arr[index].checked) {
317
- _ra_optionValue.push(document.querySelector("label[for='"+_ra_arr[index].getAttribute('id')+"']").innerText);
318
- }
319
- }
320
- _ra_voCode.push(_ra_optionValue.join(', '));
321
- }
322
- <?php endif ?>
323
-
324
- <?php if ( $optionType == "date" ) : ?>
325
- if ( document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']") !== null ) {
326
- var _ra_optionValue = [];
327
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']").selectedIndex].text);
328
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']").selectedIndex].text);
329
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']").selectedIndex].text);
330
- _ra_voCode.push(_ra_optionValue.join('/'));
331
- }
332
- <?php endif ?>
333
-
334
- <?php if ( $optionType == "date_time" ) : ?>
335
- if ( document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']") !== null ) {
336
- var _ra_optionValue = [];
337
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']").selectedIndex].text);
338
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']").selectedIndex].text);
339
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']").selectedIndex].text);
340
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']").selectedIndex].text);
341
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']").selectedIndex].text);
342
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']").selectedIndex].text);
343
- _ra_voCode.push(_ra_optionValue.join('/'));
344
- }
345
- <?php endif ?>
346
-
347
- <?php if ( $optionType == "drop_down" ) : ?>
348
- if ( document.querySelector("select.product-custom-option[name='options[<?php echo $optionId; ?>]']") !== null ) {
349
- _ra_voCode.push(document.querySelector("select.product-custom-option[name='options[<?php echo $optionId; ?>]']").options[document.querySelector("select.product-custom-option[name='options[<?php echo $optionId; ?>]']").selectedIndex].text);
350
- }
351
- <?php endif ?>
352
- <?php if ( $optionType == "multiple" ) : ?>
353
- if ( document.querySelector("select.multiselect.product-custom-option[name='options[<?php echo $optionId; ?>][]']") !== null ) {
354
- var _ra_optionValue = [];
355
- var _ra_arr = document.querySelector("select.multiselect.product-custom-option[name='options[<?php echo $optionId; ?>][]']").options;
356
- for ( var index = 0; index < _ra_arr.length; index ++ ) {
357
- if ( _ra_arr[index].selected ) _ra_optionValue.push(_ra_arr[index].text);
358
- }
359
- _ra_voCode.push(_ra_optionValue.join('_'));
360
- }
361
- <?php endif ?>
362
-
363
- <?php if ( $optionType == "radio" ) : ?>
364
- if ( document.querySelectorAll("input[type='radio'].product-custom-option[name='options[<?php echo $optionId; ?>]']").length > 0 ) {
365
- var _ra_optionValue = [];
366
- var _ra_arr = document.querySelectorAll("input[type='radio'].product-custom-option[name='options[<?php echo $optionId; ?>]']");
367
- for( var index = 0; index < _ra_arr.length; index ++ ) {
368
- if(_ra_arr[index].checked) {
369
- _ra_optionValue.push(document.querySelector("label[for='"+_ra_arr[index].getAttribute('id')+"']").innerText);
370
- }
371
- }
372
- _ra_voCode.push(_ra_optionValue.join(', '));
373
- }
374
- <?php endif ?>
375
- <?php if ( $optionType == "time" ) : ?>
376
- if ( document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']") !== null ) {
377
- var _ra_optionValue = [];
378
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']").selectedIndex].text);
379
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']").selectedIndex].text);
380
- _ra_optionValue.push(document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']").options[document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']").selectedIndex].text);
381
- _ra_voCode.push(_ra_optionValue.join('/'));
382
- }
383
- <?php endif ?>
384
-
385
- <?php if ( $optionType == "file" ) : ?>
386
- if ( document.querySelector("input[type='file'].product-custom-option[name='options_<?php echo $optionId; ?>_file']") !== null ) {
387
- _ra_voCode.push(document.querySelector("input[type='file'].product-custom-option[name='options_<?php echo $optionId; ?>_file']").value.split(/(\\|\/)/g).pop());
388
- }
389
- <?php endif ?>
390
-
391
- _ra_voDetails[_ra_voCode[_ra_voCode.length - 1].replace(RegExp("[- ]", 'g'), '')] = {
392
- "category_name": "<?php echo $optionTitle; ?>",
393
- "category": "<?php echo $optionTitle; ?>",
394
- "value": _ra_voCode[_ra_voCode.length - 1]
395
- };
396
- _ra_voCode[_ra_voCode.length - 1] = _ra_voCode[_ra_voCode.length - 1].replace(RegExp("[- ]", 'g'), '');
397
-
398
- <?php endforeach ?>
399
-
400
- var _ra_vo = {
401
- "code": _ra_voCode.join('-'),
402
- "details": _ra_voDetails
403
- }
404
- return _ra_vo;
405
- }
406
- _ra_helper_addLoadEvent(function() {
407
- <?php foreach ( $_product->getOptions() as $o ) : ?>
408
- <?php $optionType = $o->getType(); ?>
409
- <?php $optionId = $o->getId(); ?>
410
-
411
- <?php if ( $optionType == "area" ) : ?>
412
- if ( document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']") !== null ) {
413
- _ra_optElfunc[<?php echo $optionId; ?>] = document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']").onchange;
414
- document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']").onchange = function() {
415
- if ( _ra_optElfunc[<?php echo $optionId; ?>] !== null ) _ra_optElfunc[<?php echo $optionId; ?>]();
416
- _ra_triggerSetVariation();
417
- }
418
- }
419
- <?php endif ?>
420
-
421
- <?php if ( $optionType == "field" ) : ?>
422
- if ( document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']") !== null ) {
423
- _ra_optElfunc[<?php echo $optionId; ?>] = document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']").onchange;
424
- document.querySelector(".product-custom-option[name='options[<?php echo $optionId; ?>]']").onchange = function() {
425
- if ( _ra_optElfunc[<?php echo $optionId; ?>] !== null ) _ra_optElfunc[<?php echo $optionId; ?>]();
426
- _ra_triggerSetVariation();
427
- }
428
- }
429
- <?php endif ?>
430
-
431
- <?php if ( $optionType == "checkbox" ) : ?>
432
- if ( document.querySelectorAll("input[type='checkbox'].product-custom-option[name='options[<?php echo $optionId; ?>][]']").length > 0 ) {
433
- _ra_optElfunc[<?php echo $optionId; ?>] = [];
434
- for ( var index = 0; index < document.querySelectorAll("input[type='checkbox'].product-custom-option[name='options[<?php echo $optionId; ?>][]']").length; index ++ ) {
435
- _ra_optElfunc[document.querySelectorAll("input[type='checkbox'].product-custom-option[name='options[<?php echo $optionId; ?>][]']")[index]] = document.querySelectorAll("input[type='checkbox'].product-custom-option[name='options[<?php echo $optionId; ?>][]']")[index].onclick;
436
- document.querySelectorAll("input[type='checkbox'].product-custom-option[name='options[<?php echo $optionId; ?>][]']")[index].onclick = function() {
437
- if ( _ra_optElfunc[this] !== null ) _ra_optElfunc[this]();
438
- _ra_triggerSetVariation();
439
- }
440
- }
441
- }
442
- <?php endif ?>
443
-
444
- <?php if ( $optionType == "date" ) : ?>
445
- if ( document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']") !== null ) {
446
- _ra_optElfunc[<?php echo $optionId; ?>] = [];
447
- _ra_optElfunc[<?php echo $optionId; ?>][0] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']").onchange;
448
- _ra_optElfunc[<?php echo $optionId; ?>][1] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']").onchange;
449
- _ra_optElfunc[<?php echo $optionId; ?>][2] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']").onchange;
450
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']").onchange = function() {
451
- if ( _ra_optElfunc[<?php echo $optionId; ?>][0] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][0]();
452
- _ra_triggerSetVariation();
453
- }
454
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']").onchange = function() {
455
- if ( _ra_optElfunc[<?php echo $optionId; ?>][1] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][1]();
456
- _ra_triggerSetVariation();
457
- }
458
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']").onchange = function() {
459
- if ( _ra_optElfunc[<?php echo $optionId; ?>][2] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][2]();
460
- _ra_triggerSetVariation();
461
- }
462
- }
463
- <?php endif ?>
464
-
465
- <?php if ( $optionType == "date_time" ) : ?>
466
- if ( document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']") !== null ) {
467
- _ra_optElfunc[<?php echo $optionId; ?>] = [];
468
- _ra_optElfunc[<?php echo $optionId; ?>][0] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']").onchange;
469
- _ra_optElfunc[<?php echo $optionId; ?>][1] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']").onchange;
470
- _ra_optElfunc[<?php echo $optionId; ?>][2] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']").onchange;
471
- _ra_optElfunc[<?php echo $optionId; ?>][3] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']").onchange;
472
- _ra_optElfunc[<?php echo $optionId; ?>][4] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']").onchange;
473
- _ra_optElfunc[<?php echo $optionId; ?>][5] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']").onchange;
474
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][month]']").onchange = function() {
475
- if ( _ra_optElfunc[<?php echo $optionId; ?>][0] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][0]();
476
- _ra_triggerSetVariation();
477
- }
478
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day]']").onchange = function() {
479
- if ( _ra_optElfunc[<?php echo $optionId; ?>][1] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][1]();
480
- _ra_triggerSetVariation();
481
- }
482
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][year]']").onchange = function() {
483
- if ( _ra_optElfunc[<?php echo $optionId; ?>][2] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][2]();
484
- _ra_triggerSetVariation();
485
- }
486
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']").onchange = function() {
487
- if ( _ra_optElfunc[<?php echo $optionId; ?>][3] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][3]();
488
- _ra_triggerSetVariation();
489
- }
490
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']").onchange = function() {
491
- if ( _ra_optElfunc[<?php echo $optionId; ?>][4] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][4]();
492
- _ra_triggerSetVariation();
493
- }
494
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']").onchange = function() {
495
- if ( _ra_optElfunc[<?php echo $optionId; ?>][5] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][5]();
496
- _ra_triggerSetVariation();
497
- }
498
- }
499
- <?php endif ?>
500
-
501
- <?php if ( $optionType == "drop_down" ) : ?>
502
- if ( document.querySelector("select.product-custom-option[name='options[<?php echo $optionId; ?>]']") !== null ) {
503
- _ra_optElfunc[<?php echo $optionId; ?>] = document.querySelector("select.product-custom-option[name='options[<?php echo $optionId; ?>]']").onchange;
504
- document.querySelector("select.product-custom-option[name='options[<?php echo $optionId; ?>]']").onchange = function() {
505
- if ( _ra_optElfunc[<?php echo $optionId; ?>] !== null ) _ra_optElfunc[<?php echo $optionId; ?>]();
506
- _ra_triggerSetVariation();
507
- }
508
- }
509
- <?php endif ?>
510
-
511
- <?php if ( $optionType == "multiple" ) : ?>
512
- if ( document.querySelector("select.multiselect.product-custom-option[name='options[<?php echo $optionId; ?>][]']") !== null ) {
513
- _ra_optElfunc[<?php echo $optionId; ?>] = document.querySelector("select.multiselect.product-custom-option[name='options[<?php echo $optionId; ?>][]']").onchange;
514
- document.querySelector("select.multiselect.product-custom-option[name='options[<?php echo $optionId; ?>][]']").onchange = function() {
515
- if ( _ra_optElfunc[<?php echo $optionId; ?>] !== null ) _ra_optElfunc[<?php echo $optionId; ?>]();
516
- _ra_triggerSetVariation();
517
- }
518
- }
519
- <?php endif ?>
520
-
521
- <?php if ( $optionType == "radio" ) : ?>
522
- if ( document.querySelectorAll("input[type='radio'].product-custom-option[name='options[<?php echo $optionId; ?>]']").length > 0 ) {
523
- _ra_optElfunc[<?php echo $optionId; ?>] = [];
524
- for ( var index = 0; index < document.querySelectorAll("input[type='radio'].product-custom-option[name='options[<?php echo $optionId; ?>]']").length; index ++ ) {
525
- _ra_optElfunc[document.querySelectorAll("input[type='radio'].product-custom-option[name='options[<?php echo $optionId; ?>]']")[index]] = document.querySelectorAll("input[type='radio'].product-custom-option[name='options[<?php echo $optionId; ?>]']")[index].onclick;
526
- document.querySelectorAll("input[type='radio'].product-custom-option[name='options[<?php echo $optionId; ?>]']")[index].onclick = function() {
527
- if ( _ra_optElfunc[this] !== null ) _ra_optElfunc[this]();
528
- _ra_triggerSetVariation();
529
- }
530
- }
531
- }
532
- <?php endif ?>
533
-
534
- <?php if ( $optionType == "time" ) : ?>
535
- if ( document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']") !== null && document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']") !== null ) {
536
- _ra_optElfunc[<?php echo $optionId; ?>] = [];
537
- _ra_optElfunc[<?php echo $optionId; ?>][0] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']").onchange;
538
- _ra_optElfunc[<?php echo $optionId; ?>][1] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']").onchange;
539
- _ra_optElfunc[<?php echo $optionId; ?>][2] = document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']").onchange;
540
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][hour]']").onchange = function() {
541
- if ( _ra_optElfunc[<?php echo $optionId; ?>][0] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][0]();
542
- _ra_triggerSetVariation();
543
- }
544
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][minute]']").onchange = function() {
545
- if ( _ra_optElfunc[<?php echo $optionId; ?>][1] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][1]();
546
- _ra_triggerSetVariation();
547
- }
548
- document.querySelector(".datetime-picker.product-custom-option[name='options[<?php echo $optionId; ?>][day_part]']").onchange = function() {
549
- if ( _ra_optElfunc[<?php echo $optionId; ?>][2] !== null ) _ra_optElfunc[<?php echo $optionId; ?>][2]();
550
- _ra_triggerSetVariation();
551
- }
552
- }
553
- <?php endif ?>
554
-
555
- <?php if ( $optionType == "file" ) : ?>
556
- if ( document.querySelector("input[type='file'].product-custom-option[name='options_<?php echo $optionId; ?>_file']") !== null ) {
557
- _ra_optElfunc[<?php echo $optionId; ?>] = document.querySelector("input[type='file'].product-custom-option[name='options_<?php echo $optionId; ?>_file']").onchange;
558
- document.querySelector("input[type='file'].product-custom-option[name='options_<?php echo $optionId; ?>_file']").onchange = function() {
559
- if ( _ra_optElfunc[<?php echo $optionId; ?>] !== null ) _ra_optElfunc[<?php echo $optionId; ?>]();
560
- _ra_triggerSetVariation();
561
- }
562
- }
563
- <?php endif ?>
564
-
565
- <?php endforeach ?>
566
- });
567
- <?php endif ?>
568
-
569
-
570
-
571
- <?php /*is not configurable*/ ?>
572
- <?php else : ?>
573
- <?php /*is configurable*/ ?>
574
- /*configurable product..*/
575
- <?php $_productAttributeOptions = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product); ?>
576
- <?php if ( count( $_productAttributeOptions ) > 0 ) : ?>
577
-
578
- function _ra_triggerSetVariation() {
579
- var _ra_variation = _ra_grabVariation();
580
- if(typeof _ra.setVariation !== "undefined") _ra.setVariation("<?php echo $_product->getId(); ?>", _ra_variation);
581
- }
582
-
583
- _ra_optElfunc = [];
584
-
585
- function _ra_grabVariation() {
586
- var _ra_vo = {};
587
- var _ra_voCode = [];
588
- var _ra_voDetails = {};
589
-
590
- <?php foreach ($_productAttributeOptions as $_productAttribute) : ?>
591
- <?php $attributeId = $_productAttribute["attribute_id"]; ?>
592
- <?php $attributeTitle = $_productAttribute["label"]; ?>
593
- if ( document.getElementById("attribute<?php echo $attributeId; ?>") !== null ) {
594
- _ra_voCode.push(document.getElementById("attribute<?php echo $attributeId; ?>").options[document.getElementById("attribute<?php echo $attributeId; ?>").selectedIndex].text);
595
- }
596
- _ra_voDetails[_ra_voCode[_ra_voCode.length - 1].replace(RegExp("[- ]", 'g'), '')] = {
597
- "category_name": "<?php echo $attributeTitle; ?>",
598
- "category": "<?php echo $attributeTitle; ?>",
599
- "value": _ra_voCode[_ra_voCode.length - 1]
600
- };
601
- _ra_voCode[_ra_voCode.length - 1] = _ra_voCode[_ra_voCode.length - 1].replace(RegExp("[- ]", 'g'), '');
602
- <?php endforeach ?>
603
-
604
- var _ra_vo = {
605
- "code": _ra_voCode.join('-'),
606
- "details": _ra_voDetails
607
- }
608
-
609
- return _ra_vo;
610
- }
611
-
612
- _ra_helper_addLoadEvent(function() {
613
- <?php foreach ($_productAttributeOptions as $_productAttribute) : ?>
614
- <?php $attributeId = $_productAttribute["attribute_id"]; ?>
615
- <?php $attributeTitle = $_productAttribute["label"]; ?>
616
- if ( document.getElementById("attribute<?php echo $attributeId; ?>") !== null ) {
617
- _ra_optElfunc[<?php echo $attributeId; ?>] = document.getElementById("attribute<?php echo $attributeId; ?>").onchange;
618
- document.getElementById("attribute<?php echo $attributeId; ?>").onchange = function() {
619
- if ( _ra_optElfunc[<?php echo $attributeId; ?>] !== null ) _ra_optElfunc[<?php echo $attributeId; ?>]();
620
- _ra_triggerSetVariation();
621
- }
622
- }
623
- <?php endforeach ?>
624
- });
625
-
626
- <?php endif ?>
627
-
628
- <?php /*is configurable*/ ?>
629
- <?php endif ?>
630
-
631
-
632
- <?php endif ?>
633
- <?php endif ?>
634
- <?php endif //magento version ?>
635
-
636
-
637
- <?php
638
- /*
639
- ----------------------- Trigger addToWishlist -----------------------
640
- */
641
- ?>
642
- <?php if ( $info = Mage::getSingleton('core/session')->getTriggerAddToWishlist() ) : ?>
643
-
644
- // Trigger addToWishlist
645
-
646
- <?php $referral = Mage::getSingleton('core/session')->getReferralController(); echo "/*".$referral."*/"; ?>
647
- <?php if ( $referral != "product" ) : ?>
648
-
649
- // Trigger sendProduct before addToWishlist
650
-
651
- <?php
652
- $_product = Mage::getModel('catalog/product')->load($info['product_id']);
653
- $_productUrl = $_product->getProductUrl();
654
- $_category = false;
655
-
656
- $_productCategoryIds = $_product->getCategoryIds();
657
- if ( count($_productCategoryIds) ) {
658
- $firstCategoryId = $_productCategoryIds[0];
659
- $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
660
- }
661
-
662
- $_categoryParent = "false";
663
- $_categoryBreadcrumb = "[]";
664
-
665
- if($_category) {
666
- if ( $_category->getLevel() > 2 ) {
667
- $_categoryParent = '"'.$_category->getParentId().'"';
668
- $_categoryBreadcrumb = array();
669
- $breadcrumbCategory = $_category;
670
- while ( $breadcrumbCategory->getLevel() > 2 ) {
671
- $breadcrumbCategory = Mage::getModel('catalog/category')->load($breadcrumbCategory->getParentId());
672
-
673
- $_categoryBreadcrumb[] = '{
674
- "id": "'.$breadcrumbCategory->getId().'",
675
- "name": "'.htmlspecialchars($breadcrumbCategory->getName()).'",
676
- "parent": '.( $breadcrumbCategory->getLevel() > 2 ? '"'.$breadcrumbCategory->getParentId().'"' : 'false' ).'
677
- }';
678
- }
679
- $_categoryBreadcrumb = '['.implode(', ', $_categoryBreadcrumb).']';
680
- }
681
- $_category = '{"id": "'.$_category->getId().'", "name": "'.htmlspecialchars($_category->getName()).'", "parent": '.$_categoryParent.'}';
682
- } else {
683
- $_category = '{"id": "-1", "name": "no category", "parent": false}';
684
- }
685
- ?>
686
-
687
- var _ra = _ra || {};
688
- _ra.sendProductInfo = {
689
- "id": "<?php echo $_product->getId(); ?>",
690
- "name": "<?php echo htmlspecialchars($_product->getName()); ?>",
691
- "url": window.location.origin + window.location.pathname,
692
- "img": "<?php echo htmlspecialchars( Mage::helper('catalog/image')->init($_product, 'image')->resize(500) ); ?>",
693
- "price": <?php echo Mage::helper('tax')->getPrice($_product, $_product->getPrice()); ?>,
694
- "promo": <?php echo ( Mage::helper('tax')->getPrice($_product, $_product->getPrice()) - Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice()) > 0 ? Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice()) : 0 ); ?>,
695
- "stock": <?php echo $_product->getIsInStock() ?>,
696
- "brand": false,
697
- "category": <?php echo $_category; ?>,
698
- "category_breadcrumb": <?php echo $_categoryBreadcrumb; ?>,
699
- "callback_function": function() {
700
- _ra.addToWishlistInfo = {
701
- "product_id": "<?php echo $info['product_id']; ?>"
702
- };
703
- if(typeof _ra.addToWishlist !== "undefined") _ra.addToWishlist(_ra.addToWishlistInfo.product_id);
704
- }
705
- };
706
-
707
- if (_ra.ready !== undefined) {
708
- if(typeof _ra.sendProduct !== "undefined") _ra.sendProduct(_ra.sendProductInfo);
709
- }
710
-
711
- <?php else : ?>
712
-
713
- var _ra = _ra || {};
714
- _ra.addToWishlistInfo = {
715
- "product_id": "<?php echo $info['product_id']; ?>"
716
- };
717
-
718
- if (_ra.ready !== undefined) {
719
- if(typeof _ra.addToWishlist !== "undefined") _ra.addToWishlist(_ra.addToWishlistInfo.product_id);
720
- }
721
-
722
- <?php endif ?>
723
-
724
- <?php Mage::getSingleton('core/session')->unsTriggerAddToWishlist(); ?>
725
- <?php endif ?>
726
-
727
-
728
-
729
- <?php
730
- /*
731
- ----------------------- Trigger clickImage -----------------------
732
- */
733
- ?>
734
- <?php if ( Mage::app()->getFrontController()->getRequest()->getControllerName() == "product" && !is_null(Mage::registry('product')) ) : ?>
735
-
736
- // Trigger clickImage
737
-
738
- <?php
739
- $_product = Mage::registry('current_product');
740
- if($_product) :
741
- ?>
742
- <?php
743
-
744
- $customClass = Mage::helper('retargeting_tracker')->getCustomClass();
745
- if(Mage::helper('retargeting_tracker')->getCustomClass() != "") :
746
- ?>
747
-
748
- function _ra_triggerClickImage() {
749
- if(typeof _ra.clickImage !== "undefined") _ra.clickImage("<?php echo $_product->getId(); ?>");
750
- }
751
- _ra_helper_addLoadEvent(function() {
752
- if ( document.getElementsByClassName("<?php echo $customClass ?>").length > 0 ) {
753
- document.getElementsByClassName("<?php echo $customClass ?>")[0].onmouseover = _ra_triggerClickImage;
754
-
755
- }
756
- });
757
- //custom css
758
- <?php else : ?>
759
- function _ra_triggerClickImage() {
760
- if(typeof _ra.clickImage !== "undefined") _ra.clickImage("<?php echo $_product->getId(); ?>");
761
- }
762
-
763
- _ra_helper_addLoadEvent(function() {
764
- if ( document.getElementsByClassName("zoomWindow").length > 0 ) {
765
- document.getElementsByClassName("zoomWindow")[0].onmouseover = _ra_triggerClickImage;
766
- }
767
- if ( document.getElementsByClassName("zoomLens").length > 0 ) {
768
- document.getElementsByClassName("zoomLens")[0].onmouseover = _ra_triggerClickImage;
769
- }
770
- if ( document.getElementsByClassName("MagicToolboxContainer").length > 0 ) {
771
- document.getElementsByClassName("MagicZoomBigImageCont")[0].onmouseover = _ra_triggerClickImage;
772
- }
773
- if ( document.getElementById("image") !== null ) {
774
- document.getElementById("image").onclick = _ra_triggerClickImage;
775
- } else if ( document.querySelector(".product-image img") !== null ) {
776
- var el = document.querySelector(".product-image img").onclick = _ra_triggerClickImage;
777
- }
778
- });
779
- <?php endif //customcss?>
780
- <?php endif //endif product ?>
781
- <?php endif ?>
782
-
783
-
784
-
785
- <?php
786
- /*
787
- ----------------------- Trigger commentOnProduct -----------------------
788
- */
789
- ?>
790
- <?php if ( $info = Mage::getSingleton('core/session')->getTriggerCommentOnProduct() ) : ?>
791
-
792
- // Trigger commentOnProduct
793
-
794
- var _ra = _ra || {};
795
- _ra.commentOnProductInfo = {
796
- "product_id" : "<?php echo $info['product_id']; ?>"
797
- };
798
-
799
- if (_ra.ready !== undefined) {
800
- if(typeof _ra.commentOnProduct !== "undefined") _ra.commentOnProduct(_ra.commentOnProductInfo.product_id);
801
- }
802
-
803
- <?php Mage::getSingleton('core/session')->unsTriggerCommentOnProduct(); ?>
804
- <?php endif ?>
805
-
806
-
807
-
808
- <?php
809
- /*
810
- ----------------------- Trigger mouseOverPrice -----------------------
811
- */
812
- ?>
813
- <?php if ( Mage::app()->getFrontController()->getRequest()->getControllerName() == "product" && !is_null(Mage::registry('product')) ) : ?>
814
-
815
- // Trigger mouseOverPrice
816
-
817
- <?php $_product = Mage::registry('current_product'); ?>
818
- <?php if($_product): ?>
819
- function _ra_triggerMouseOverPrice() {
820
- if(typeof _ra.mouseOverPrice !== "undefined") _ra.mouseOverPrice("<?php echo $_product->getId(); ?>", {
821
- "price": <?php echo Mage::helper('tax')->getPrice($_product, $_product->getPrice()); ?>,
822
- "promo": <?php echo ( Mage::helper('tax')->getPrice($_product, $_product->getPrice()) - Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice()) > 0 ? Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice()) : 0 ); ?>
823
- });
824
- }
825
-
826
- _ra_helper_addLoadEvent(function() {
827
- if ( document.getElementById("product-price-<?php echo $_product->getId(); ?>") !== null ) {
828
- document.getElementById("product-price-<?php echo $_product->getId(); ?>").onmouseover = _ra_triggerMouseOverPrice;
829
- }
830
- if ( document.getElementById("old-price-<?php echo $_product->getId(); ?>") !== null ) {
831
- document.getElementById("old-price-<?php echo $_product->getId(); ?>").onmouseover = _ra_triggerMouseOverPrice;
832
- }
833
- });
834
-
835
- <?php endif ?>
836
- <?php endif ?>
837
-
838
-
839
-
840
- <?php
841
- /*
842
- ----------------------- Trigger mouseOverAddToCart -----------------------
843
- */
844
- ?>
845
- <?php if ( Mage::app()->getFrontController()->getRequest()->getControllerName() == "product" && !is_null(Mage::registry('product')) ) : ?>
846
-
847
- // Trigger mouseOverAddToCart
848
-
849
- <?php $_product = Mage::registry('current_product'); ?>
850
- <?php if($_product): ?>
851
- function _ra_triggerMouseOverAddToCart() {
852
- if(typeof _ra.mouseOverAddToCart !== "undefined") _ra.mouseOverAddToCart("<?php echo $_product->getId(); ?>");
853
- }
854
-
855
- _ra_helper_addLoadEvent(function() {
856
- if ( document.getElementById("product-addtocart-button") !== null ) {
857
- document.getElementById("product-addtocart-button").onmouseover = _ra_triggerMouseOverAddToCart;
858
- } else if ( document.getElementsByClassName("btn-cart").length > 0 ) {
859
- document.getElementsByClassName("btn-cart")[0].onmouseover = _ra_triggerMouseOverAddToCart;
860
- }
861
- });
862
-
863
- <?php endif ?>
864
- <?php endif ?>
865
-
866
-
867
-
868
- <?php
869
- /*
870
- ----------------------- Trigger saveOrder -----------------------
871
- */
872
- ?>
873
- <?php if ( $info = Mage::getSingleton('core/session')->getTriggerSaveOrder() ) : ?>
874
-
875
- // Trigger saveOrder
876
-
877
- var _ra = _ra || {};
878
- _ra.saveOrderInfo = {
879
- "order_no": "<?php echo $info['order_no']; ?>",
880
- "lastname": "<?php echo htmlspecialchars($info['lastname']); ?>",
881
- "firstname": "<?php echo htmlspecialchars($info['firstname']); ?>",
882
- "email": "<?php echo htmlspecialchars($info['email']); ?>",
883
- "phone": "<?php echo htmlspecialchars($info['phone']); ?>",
884
- "state": "<?php echo htmlspecialchars($info['state']); ?>",
885
- "city": "<?php echo htmlspecialchars($info['city']); ?>",
886
- "address": "<?php echo htmlspecialchars($info['address']); ?>",
887
- "discount": <?php echo $info['discount']; ?>,
888
- "discount_code": "<?php echo $info['discount_code']; ?>",
889
- "shipping": <?php echo $info['shipping']; ?>,
890
- "total": <?php echo $info['total']; ?>,
891
- };
892
- _ra.saveOrderProducts = <?php echo $info['products']; ?>
893
-
894
- if( _ra.ready !== undefined ){
895
- if(typeof _ra.saveOrder !== "undefined") _ra.saveOrder(_ra.saveOrderInfo, _ra.saveOrderProducts);
896
- }
897
-
898
- <?php Mage::getSingleton('core/session')->unsTriggerSaveOrder(); ?>
899
- <?php endif ?>
900
-
901
-
902
-
903
- <?php
904
- /*
905
- ----------------------- Trigger visitHelpPage -----------------------
906
- */
907
- ?>
908
- <?php if ( Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms' ) : ?>
909
-
910
- <?php
911
- $page = Mage::getSingleton('cms/page');
912
- $helpPages = Mage::getStoreConfig('retargetingtracker_options/more/help_pages');
913
- $helpPages = explode(',', $helpPages);
914
- ?>
915
-
916
- <?php if ( $page->getId() && in_array($page->getId(), $helpPages) ) : ?>
917
-
918
- // Trigger visitHelpPage
919
-
920
- var _ra = _ra || {};
921
- _ra.visitHelpPageInfo = {
922
- "visit" : true
923
- }
924
-
925
- if (_ra.ready !== undefined) {
926
- if(typeof _ra.visitHelpPage !== "undefined") _ra.visitHelpPage();
927
- }
928
-
929
- <?php endif ?>
930
-
931
-
932
- <?php endif ?>
933
-
934
-
935
-
936
- <?php
937
- /*
938
- ----------------------- Trigger checkoutIds -----------------------
939
- */
940
- ?>
941
- <?php
942
- $request = $this->getRequest();
943
- $module = $request->getModuleName();
944
- $controller = $request->getControllerName();
945
- $action = $request->getActionName();
946
- ?>
947
- <?php if ( ($module == 'checkout' && $controller == 'cart' && $action == 'index') || ($module == 'checkout' && $controller == 'onepage' && $action == 'index') || (Mage::getURL('checkout/onepage') == Mage::helper('core/url')->getCurrentUrl()) || (strrpos(Mage::helper('core/url')->getCurrentUrl(), "/onestepcheckout") === false) ) : ?>
948
-
949
- // Trigger checkoutIds
950
-
951
- <?php
952
- $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
953
- $products = array();
954
- foreach($items as $item) {
955
- $products[] = $item->getProductId();
956
- }
957
- $products = implode(", ", $products);
958
- ?>
959
-
960
- var _ra = _ra || {};
961
- _ra.checkoutIdsInfo = [<?php echo $products; ?>];
962
-
963
- if (_ra.ready !== undefined) {
964
- if(typeof _ra.checkoutIds !== "undefined") _ra.checkoutIds(_ra.checkoutIdsInfo);
965
- }
966
-
967
- <?php endif ?>
968
-
969
-
970
- <?php // likeFacebook
971
- $_product = Mage::registry('current_product');
972
- if($_product && Mage::helper('retargeting_tracker')->isFacebookAvailable()) :
973
- ?>
974
-
975
- if (typeof FB != "undefined") {
976
- FB.Event.subscribe('edge.create', function () {
977
- _ra.likeFacebook(<?php echo $_product->getId()?>);
978
- });
979
- };
980
- <?php endif; //end like facebook ?>
981
-
982
- </script>
983
- <?php
984
- /*
985
- ----------------------- Track URL History --------------------------
986
- */
987
- ?>
988
- <?php
989
- Mage::getSingleton('core/session')->setReferralController( Mage::app()->getFrontController()->getRequest()->getControllerName() );
990
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,54 +1,37 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Retargeting_Tracker</name>
4
- <version>1.1.3</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Retargeting and Marketing Automation. Personalized email content + Personalized live messages + SMS triggers to deliver to your customers the products they want to buy.</summary>
10
- <description>&amp;lt;h2&amp;gt;Retargeting and Marketing Automation&amp;lt;/h2&amp;gt;&amp;#xD;&#xD;
11
- &amp;#xD;&#xD;
12
- &amp;lt;p&amp;gt;Personalized email content + Personalized live messages + SMS triggers to deliver to your customers the products they want to buy.&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
13
- &amp;#xD;&#xD;
14
- &amp;lt;h2&amp;gt;Features&amp;lt;/h2&amp;gt;&amp;#xD;&#xD;
15
- &amp;#xD;&#xD;
16
- &amp;lt;h3&amp;gt;&amp;lt;strong&amp;gt;Live Triggers&amp;lt;/strong&amp;gt;&amp;lt;/h3&amp;gt;&amp;#xD;&#xD;
17
- &amp;#xD;&#xD;
18
- &amp;lt;p&amp;gt;When you have people in our online shop, if you see that someone&amp;amp;#39;s showing a lot of interest in one product, wouldn&amp;amp;#39;t you offer them a small discount to make sure they buy it? That&amp;amp;#39;s what we thought!&amp;amp;nbsp;&amp;lt;br /&amp;gt;&amp;#xD;&#xD;
19
- &amp;lt;br /&amp;gt;&amp;#xD;&#xD;
20
- With our personalized live triggers that&amp;amp;#39;s exactly what you&amp;amp;#39;ll do, just that you won&amp;amp;#39;t have to lift a finger.&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
21
- &amp;#xD;&#xD;
22
- &amp;lt;p&amp;gt;&amp;lt;a href="https://retargeting.biz/live-triggers-marketing"&amp;gt;read more about live triggers&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
23
- &amp;#xD;&#xD;
24
- &amp;lt;h3&amp;gt;&amp;lt;strong&amp;gt;E-mail triggers &amp;amp;amp; reminders&amp;lt;/strong&amp;gt;&amp;lt;/h3&amp;gt;&amp;#xD;&#xD;
25
- &amp;#xD;&#xD;
26
- &amp;lt;p&amp;gt;We all want to market someone when they&amp;amp;#39;re in a buying mood, but it&amp;amp;#39;s hard to get the right timing. But we found a secret formula and you&amp;amp;#39;ll have access to it through our e-mail marketing software. Someone leaves the site without finishing the order? We got your back!&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
27
- &amp;#xD;&#xD;
28
- &amp;lt;p&amp;gt;Someone browsed the site, found interesting products but didn&amp;amp;#39;t press the buy button? We&amp;amp;#39;ll remind him about those cool products through a triggered email. And that&amp;amp;#39;s not all, we can do so much more with our personalized emails!&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
29
- &amp;#xD;&#xD;
30
- &amp;lt;p&amp;gt;&amp;lt;a href="https://retargeting.biz/email-triggers-and-reminders"&amp;gt;read more about email triggers&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
31
- &amp;#xD;&#xD;
32
- &amp;lt;h3&amp;gt;&amp;lt;strong&amp;gt;SMS Triggers&amp;lt;/strong&amp;gt;&amp;lt;/h3&amp;gt;&amp;#xD;&#xD;
33
- &amp;#xD;&#xD;
34
- &amp;lt;p&amp;gt;Nowadays, with everyone checking their phones every 5 minutes, you can&amp;amp;#39;t go wrong with this, you&amp;amp;#39;re 100% sure that they will see your message. What better way to remind someone that they forgot to finish order a couple of hours ago?&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
35
- &amp;#xD;&#xD;
36
- &amp;lt;p&amp;gt;&amp;lt;a href="https://retargeting.biz/sms-triggers"&amp;gt;read more about sms triggers&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
37
- &amp;#xD;&#xD;
38
- &amp;lt;h3&amp;gt;&amp;lt;strong&amp;gt;Multitesting&amp;lt;/strong&amp;gt;&amp;lt;/h3&amp;gt;&amp;#xD;&#xD;
39
- &amp;#xD;&#xD;
40
- &amp;lt;p&amp;gt;We love A/B testing so much that we created Multitesting, an improved and limitless version compared to other email marketing softwares.&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
41
- &amp;#xD;&#xD;
42
- &amp;lt;p&amp;gt;You can test as many different versions as you want and you only need one click to add a new one.Did we tell you that you can do this for any trigger, e-mail or live? The perfect&amp;amp;nbsp;&amp;lt;a href="http://en.wikipedia.org/wiki/Marketing_automation"&amp;gt;marketing automation&amp;lt;/a&amp;gt;&amp;amp;nbsp;tool for your online shop!&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
43
- &amp;#xD;&#xD;
44
- &amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Contact&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;#xD;&#xD;
45
- &amp;#xD;&#xD;
46
- &amp;lt;p&amp;gt;For help or more info, please contact info@retargeting.biz or visit&amp;amp;nbsp;&amp;lt;a href="http://www.retargeting.biz"&amp;gt;retargeting.biz&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;</description>
47
- <notes>Retargeting</notes>
48
- <authors><author><name>Cosmin Atomei</name><user>retargeting</user><email>info@retargeting.biz</email></author></authors>
49
- <date>2015-09-09</date>
50
- <time>14:46:43</time>
51
- <contents><target name="magecommunity"><dir name="Retargeting"><dir name="Tracker"><dir name="Block"><file name="Embed.php" hash="d114429b378b186d144f75b725bd36c4"/><file name="Triggers.php" hash="fd2f2fad2041280b0d0572ea0e2220de"/></dir><dir name="Helper"><file name="Data.php" hash="6b547d3d67003b8bef48fd4eb8efe23f"/></dir><dir name="Model"><file name="Helppages.php" hash="51305978cda160ad7b3aa8bb8e42d3a5"/><file name="Observer.php" hash="6c737c6cdd63d6920a6ad6c258c88bca"/></dir><dir name="controllers"><file name="DiscountsController.php" hash="2c1386a96a75a2b3e5c3667a37dc285f"/><file name="IndexController.php" hash="9cbd5b979859b2014c5ed191d9b5686a"/><file name="ProductsController.php" hash="6498c0be8d4989d47f70f4c24b9fa904"/></dir><dir name="etc"><file name="config.xml" hash="4469382fa2b33f678366f5d0f597f855"/><file name="system.xml" hash="46a5ed1ce340892c1010240e9c622a4e"/></dir><dir name="sql"><dir name="retargeting_tracker_setup"><file name="mysql4-install-1.0.0.php" hash="6613b3db4b7ec61fe47f9b69591fa0c5"/><file name="mysql4-install-1.1.0.php" hash="6613b3db4b7ec61fe47f9b69591fa0c5"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Retargeting_Tracker.xml" hash="44dbbcea34bc8ed9cc6d744176adb9a6"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="retargeting_tracker.xml" hash="a27cb36a780ee24f3e70aba08599f37e"/></dir><dir name="template"><dir name="retargeting_tracker"><file name="embed.phtml" hash="2d973cc9fe231ebf13da0b8ae3d3ccbb"/><file name="triggers.phtml" hash="0a3a569053a8ab4754c9abcec00063da"/></dir></dir></dir></dir></dir></target></contents>
52
  <compatible/>
53
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
54
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Retargeting_Tracker</name>
4
+ <version>1.2.0</version>
5
  <stability>stable</stability>
6
+ <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Retargeting and Marketing Automation. Personalized email content + Personalized live messages + SMS triggers to deliver to your customers the products they want to buy.</summary>
10
+ <description>&lt;h2&gt;Retargeting and Marketing Automation&lt;/h2&gt;&#xD;
11
+ &lt;p&gt;Personalized email content + Personalized live messages + SMS triggers to deliver to your customers the products they want to buy.&lt;/p&gt;&#xD;
12
+ &lt;h2&gt;Features&lt;/h2&gt;&#xD;
13
+ &lt;h3&gt;&lt;strong&gt;Live Triggers&lt;/strong&gt;&lt;/h3&gt;&#xD;
14
+ &lt;p&gt; When you have people in our online shop, if you see that someone's showing a lot of interest in one product, wouldn't you offer them a small discount to make sure they buy it? That's what we thought!&#xA0;&lt;br /&gt;&#xD;
15
+ &lt;br /&gt;&#xD;
16
+ With our personalized live triggers that's exactly what you'll do, just that you won't have to lift a finger.&lt;/p&gt;&#xD;
17
+ &lt;p&gt;&lt;a href="https://retargeting.biz/live-triggers-marketing" title="Live Triggers"&gt;read more about live triggers&lt;/a&gt;&lt;/p&gt;&#xD;
18
+ &lt;h3&gt;&lt;strong&gt;E-mail triggers &amp; reminders&lt;/strong&gt;&lt;/h3&gt;&#xD;
19
+ &lt;p&gt; We all want to market someone when they're in a buying mood, but it's hard to get the right timing. But we found a secret formula and you'll have access to it through our e-mail marketing software. Someone leaves the site without finishing the order? We got your back!&lt;/p&gt;&#xD;
20
+ &lt;p&gt; Someone browsed the site, found interesting products but didn't press the buy button? We'll remind him about those cool products through a triggered email. And that's not all, we can do so much more with our personalized emails!&lt;/p&gt;&#xD;
21
+ &lt;p&gt;&lt;a href="https://retargeting.biz/email-triggers-and-reminders" title="E-mail triggers &amp; reminders"&gt;read more about email triggers&lt;/a&gt;&lt;/p&gt;&#xD;
22
+ &lt;h3&gt;&lt;strong&gt;SMS Triggers&lt;/strong&gt;&lt;/h3&gt;&#xD;
23
+ &lt;p&gt; Nowadays, with everyone checking their phones every 5 minutes, you can't go wrong with this, you're 100% sure that they will see your message. What better way to remind someone that they forgot to finish order a couple of hours ago?&lt;/p&gt;&#xD;
24
+ &lt;p&gt;&lt;a href="https://retargeting.biz/sms-triggers" title="SMS Triggers"&gt;read more about sms triggers&lt;/a&gt;&lt;/p&gt;&#xD;
25
+ &lt;h3&gt;&lt;strong&gt;Multitesting&lt;/strong&gt;&lt;/h3&gt;&#xD;
26
+ &lt;p&gt;We love A/B testing so much that we created Multitesting, an improved and limitless version compared to other email marketing softwares.&lt;/p&gt;&#xD;
27
+ &lt;p&gt;You can test as many different versions as you want and you only need one click to add a new one.Did we tell you that you can do this for any trigger, e-mail or live? The perfect&#xA0;&lt;a href="http://en.wikipedia.org/wiki/Marketing_automation" title="marketing automation"&gt;marketing automation&lt;/a&gt;&#xA0;tool for your online shop!&lt;/p&gt;&#xD;
28
+ &lt;p&gt;&lt;strong&gt;Contact&lt;/strong&gt;&lt;/p&gt;&#xD;
29
+ &lt;p&gt;For help or more info, please contact info@retargeting.biz or visit&#xA0;&lt;a href="http://retargeting.biz"&gt;retargeting.biz&lt;/a&gt;.&lt;/p&gt;</description>
30
+ <notes>Retargeting V3</notes>
31
+ <authors><author><name>Retargeting Team</name><user>retargeting</user><email>info@retargeting.biz</email></author></authors>
32
+ <date>2016-05-25</date>
33
+ <time>11:59:01</time>
34
+ <contents><target name="magecommunity"><dir name="Retargeting"><dir name="Tracker"><dir name="Block"><file name="Embed.php" hash="d114429b378b186d144f75b725bd36c4"/><file name="Triggers.php" hash="fd2f2fad2041280b0d0572ea0e2220de"/></dir><dir name="Helper"><file name="Data.php" hash="6b547d3d67003b8bef48fd4eb8efe23f"/></dir><dir name="Model"><file name="Helppages.php" hash="51305978cda160ad7b3aa8bb8e42d3a5"/><file name="Observer.php" hash="39967db79a6c206dcc7baeb19188dd67"/></dir><dir name="controllers"><file name="DiscountsController.php" hash="0d6c4bf8da7cbb8becde6091c959d797"/><file name="IndexController.php" hash="9cbd5b979859b2014c5ed191d9b5686a"/><file name="ProductsController.php" hash="f2f556aee8c80f3a77a884792520102a"/></dir><dir name="etc"><file name="config.xml" hash="a03f249b661ec65b30dde10701e5412c"/><file name="system.xml" hash="a9355f6a0d87bed6fb48d73db9646a41"/><file name=".DS_Store" hash="4eebcbc7406e8fc6848f48e3759208c3"/></dir><dir name="sql"><dir name="retargeting_tracker_setup"><file name="mysql4-install-1.0.0.php" hash="6613b3db4b7ec61fe47f9b69591fa0c5"/><file name="mysql4-install-1.1.0.php" hash="6613b3db4b7ec61fe47f9b69591fa0c5"/></dir></dir><file name=".DS_Store" hash="c188ca623ac80ca25f3ee47677fd8f2d"/></dir><file name=".DS_Store" hash="e4f04cfc2407bf8ef1a837cc4ce5677e"/></dir></target><target name="magelocal"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="retargeting_tracker.xml" hash=""/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Retargeting_Tracker.xml" hash="44dbbcea34bc8ed9cc6d744176adb9a6"/></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  <compatible/>
36
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
37
  </package>