Retargeting_Tracker - Version 1.2.3

Version Notes

Minor bugfixes

Download this release

Release Info

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


Code changes from version 1.2.2 to 1.2.3

app/code/community/Retargeting/Tracker/Model/Observer.php CHANGED
@@ -177,7 +177,7 @@ class Retargeting_Tracker_Model_Observer
177
  }
178
  }
179
 
180
- $variationCode = count($optionsCode) > 0 ? '"'.implode('-', $optionsCode).'"' : "false";
181
 
182
  $products[] = '{
183
  "id": "'. $item->getProductId() .'",
@@ -233,7 +233,7 @@ class Retargeting_Tracker_Model_Observer
233
  "id": "'. $item->getProductId() .'",
234
  "quantity": '. $item->getQtyOrdered() .',
235
  "price": ' . Mage::helper('tax')->getPrice($item, $item->getPrice()).',
236
- "variation_code": false}';
237
  }
238
 
239
  $info = array(
177
  }
178
  }
179
 
180
+ $variationCode = count($optionsCode) > 0 ? '"'.implode('-', $optionsCode).'"' : "\"\"";
181
 
182
  $products[] = '{
183
  "id": "'. $item->getProductId() .'",
233
  "id": "'. $item->getProductId() .'",
234
  "quantity": '. $item->getQtyOrdered() .',
235
  "price": ' . Mage::helper('tax')->getPrice($item, $item->getPrice()).',
236
+ "variation_code": ""}';
237
  }
238
 
239
  $info = array(
app/design/frontend/base/default/template/retargeting_tracker/embed.phtml CHANGED
@@ -23,11 +23,5 @@
23
  var ra = document.createElement("script"); ra.type ="text/javascript"; ra.async = true; ra.src = ("https:" ==
24
  document.location.protocol ? "https://" : "http://") + "tracking.retargeting.biz/v3/rajs/" + ra_key + ".js";
25
  var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ra,s);})();
26
- <?php else : ?>
27
- (function(){
28
- var ra = document.createElement("script"); ra.type ="text/javascript"; ra.async = true; ra.src = ("https:" ==
29
- document.location.protocol ? "https://" : "http://") + "retargeting-data.eu/" +
30
- document.location.hostname.replace("www.","") + "/ra.js"; var s =
31
- document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ra,s);})();
32
  <?php endif; ?>
33
  </script>
23
  var ra = document.createElement("script"); ra.type ="text/javascript"; ra.async = true; ra.src = ("https:" ==
24
  document.location.protocol ? "https://" : "http://") + "tracking.retargeting.biz/v3/rajs/" + ra_key + ".js";
25
  var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ra,s);})();
 
 
 
 
 
 
26
  <?php endif; ?>
27
  </script>
app/design/frontend/base/default/template/retargeting_tracker/triggers.phtml CHANGED
@@ -155,7 +155,7 @@
155
  '}]';
156
  } else {
157
  $_category = '[{
158
- "id": "-1",
159
  "name": "no category",
160
  "parent": false
161
  }]';
@@ -234,36 +234,18 @@
234
  "breadcrumb" : '.$_categoryBreadcrumb.
235
  '}]';
236
  } else {
237
- $_category = '[{"id": "-1", "name": "no category", "parent": false}]';
238
  }
239
  ?>
240
 
241
  var _ra = _ra || {};
242
- _ra.sendProductInfo = {
243
- "id": "<?php echo $_product->getId(); ?>",
244
- "name": "<?php echo htmlspecialchars($_product->getName()); ?>",
245
- "url": "<?php echo htmlspecialchars(strtok($_productUrl,'?')); ?>",
246
- "img": "<?php echo htmlspecialchars( Mage::helper('catalog/image')->init($_product, 'image')->resize(500) ); ?>",
247
- "price": <?php echo Mage::helper('tax')->getPrice($_product, $_product->getPrice()); ?>,
248
- "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 ); ?>,
249
- "inventory": {
250
- "variations": false,
251
- "stock": <?php echo $_product->getIsInStock() ?>
252
- },
253
- "brand": false,
254
- "category": <?php echo $_category; ?>,
255
- "callback_function": function() {
256
- _ra.addToCartInfo = {
257
- "product_id": "<?php echo $info['product_id']; ?>",
258
- "quantity": <?php echo $_product->getIsInStock() ?>,
259
- "variation": <?php echo $info['variation']; ?>
260
- };
261
- if(typeof _ra.addToCart !== "undefined") _ra.addToCart(_ra.addToCartInfo.product_id, _ra.addToCartInfo.variation);
262
- }
263
  };
264
-
265
- if (_ra.ready !== undefined) {
266
- if(typeof _ra.sendProduct !== "undefined") _ra.sendProduct(_ra.sendProductInfo);
267
  }
268
 
269
  <?php else : ?>
@@ -418,6 +400,7 @@
418
 
419
  var _ra_vo = {
420
  "code": _ra_voCode.join('-'),
 
421
  "details": _ra_voDetails
422
  }
423
  return _ra_vo;
@@ -672,68 +655,17 @@
672
  $_productUrl = $_product->getProductUrl();
673
  $_category = false;
674
 
675
- $_productCategoryIds = $_product->getCategoryIds();
676
- if ( count($_productCategoryIds) ) {
677
- $firstCategoryId = $_productCategoryIds[0];
678
- $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
679
- }
680
-
681
- $_categoryParent = "false";
682
- $_categoryBreadcrumb = "[]";
683
-
684
- if($_category) {
685
- if ( $_category->getLevel() > 2 ) {
686
- $_categoryParent = '"'.$_category->getParentId().'"';
687
- $_categoryBreadcrumb = array();
688
- $breadcrumbCategory = $_category;
689
- while ( $breadcrumbCategory->getLevel() > 2 ) {
690
- $breadcrumbCategory = Mage::getModel('catalog/category')->load($breadcrumbCategory->getParentId());
691
-
692
- $_categoryBreadcrumb[] = '{
693
- "id": "'.$breadcrumbCategory->getId().'",
694
- "name": "'.htmlspecialchars($breadcrumbCategory->getName()).'",
695
- "parent": '.( $breadcrumbCategory->getLevel() > 2 ? '"'.$breadcrumbCategory->getParentId().'"' : 'false' ).'
696
- }';
697
- }
698
- $_categoryBreadcrumb = '['.implode(', ', $_categoryBreadcrumb).']';
699
- }
700
- $_category = '[{
701
- "id": "'.$_category->getId().'",
702
- "name": "'.htmlspecialchars($_category->getName()).'",
703
- "parent": '.$_categoryParent.',
704
- "breadcrumb" : '.$_categoryBreadcrumb.
705
- '}]';
706
- } else {
707
- $_category = '[{"id": "-1", "name": "no category", "parent": false}]';
708
- }
709
  ?>
710
-
711
  var _ra = _ra || {};
712
- _ra.sendProductInfo = {
713
- "id": "<?php echo $_product->getId(); ?>",
714
- "name": "<?php echo htmlspecialchars($_product->getName()); ?>",
715
- "url": "<?php echo htmlspecialchars(strtok($_productUrl,'?')); ?>",
716
- "img": "<?php echo htmlspecialchars( Mage::helper('catalog/image')->init($_product, 'image')->resize(500) ); ?>",
717
- "price": <?php echo Mage::helper('tax')->getPrice($_product, $_product->getPrice()); ?>,
718
- "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 ); ?>,
719
- "inventory": {
720
- "variations": false,
721
- "stock": <?php echo $_product->getIsInStock() ?>
722
- },
723
- "brand": false,
724
- "category": <?php echo $_category; ?>,
725
- "callback_function": function() {
726
- _ra.addToWishlistInfo = {
727
- "product_id": "<?php echo $info['product_id']; ?>"
728
- };
729
- if(typeof _ra.addToWishlist !== "undefined") _ra.addToWishlist(_ra.addToWishlistInfo.product_id);
730
- }
731
  };
732
-
733
  if (_ra.ready !== undefined) {
734
- if(typeof _ra.sendProduct !== "undefined") _ra.sendProduct(_ra.sendProductInfo);
735
  }
736
 
 
737
  <?php else : ?>
738
 
739
  var _ra = _ra || {};
@@ -829,68 +761,6 @@ _ra_helper_addLoadEvent(function() {
829
  <?php Mage::getSingleton('core/session')->unsTriggerCommentOnProduct(); ?>
830
  <?php endif ?>
831
 
832
-
833
-
834
- <?php
835
- /*
836
- ----------------------- Trigger mouseOverPrice -----------------------
837
- */
838
- ?>
839
- <?php if ( Mage::app()->getFrontController()->getRequest()->getControllerName() == "product" && !is_null(Mage::registry('product')) ) : ?>
840
-
841
- // Trigger mouseOverPrice
842
-
843
- <?php $_product = Mage::registry('current_product'); ?>
844
- <?php if($_product): ?>
845
- function _ra_triggerMouseOverPrice() {
846
- if(typeof _ra.mouseOverPrice !== "undefined") _ra.mouseOverPrice("<?php echo $_product->getId(); ?>", {
847
- "price": <?php echo Mage::helper('tax')->getPrice($_product, $_product->getPrice()); ?>,
848
- "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 ); ?>
849
- });
850
- }
851
-
852
- _ra_helper_addLoadEvent(function() {
853
- if ( document.getElementById("product-price-<?php echo $_product->getId(); ?>") !== null ) {
854
- document.getElementById("product-price-<?php echo $_product->getId(); ?>").onmouseover = _ra_triggerMouseOverPrice;
855
- }
856
- if ( document.getElementById("old-price-<?php echo $_product->getId(); ?>") !== null ) {
857
- document.getElementById("old-price-<?php echo $_product->getId(); ?>").onmouseover = _ra_triggerMouseOverPrice;
858
- }
859
- });
860
-
861
- <?php endif ?>
862
- <?php endif ?>
863
-
864
-
865
-
866
- <?php
867
- /*
868
- ----------------------- Trigger mouseOverAddToCart -----------------------
869
- */
870
- ?>
871
- <?php if ( Mage::app()->getFrontController()->getRequest()->getControllerName() == "product" && !is_null(Mage::registry('product')) ) : ?>
872
-
873
- // Trigger mouseOverAddToCart
874
-
875
- <?php $_product = Mage::registry('current_product'); ?>
876
- <?php if($_product): ?>
877
- function _ra_triggerMouseOverAddToCart() {
878
- if(typeof _ra.mouseOverAddToCart !== "undefined") _ra.mouseOverAddToCart("<?php echo $_product->getId(); ?>");
879
- }
880
-
881
- _ra_helper_addLoadEvent(function() {
882
- if ( document.getElementById("product-addtocart-button") !== null ) {
883
- document.getElementById("product-addtocart-button").onmouseover = _ra_triggerMouseOverAddToCart;
884
- } else if ( document.getElementsByClassName("btn-cart").length > 0 ) {
885
- document.getElementsByClassName("btn-cart")[0].onmouseover = _ra_triggerMouseOverAddToCart;
886
- }
887
- });
888
-
889
- <?php endif ?>
890
- <?php endif ?>
891
-
892
-
893
-
894
  <?php
895
  /*
896
  ----------------------- Trigger saveOrder -----------------------
@@ -913,6 +783,8 @@ _ra_helper_addLoadEvent(function() {
913
  "discount": <?php echo $info['discount']; ?>,
914
  "discount_code": "<?php echo $info['discount_code']; ?>",
915
  "shipping": <?php echo $info['shipping']; ?>,
 
 
916
  "total": <?php echo $info['total']; ?>,
917
  };
918
  _ra.saveOrderProducts = <?php echo $info['products']; ?>
@@ -1013,4 +885,4 @@ if (typeof FB != "undefined") {
1013
  ?>
1014
  <?php
1015
  Mage::getSingleton('core/session')->setReferralController( Mage::app()->getFrontController()->getRequest()->getControllerName() );
1016
- ?>
155
  '}]';
156
  } else {
157
  $_category = '[{
158
+ "id": "1",
159
  "name": "no category",
160
  "parent": false
161
  }]';
234
  "breadcrumb" : '.$_categoryBreadcrumb.
235
  '}]';
236
  } else {
237
+ $_category = '[{"id": "1", "name": "no category", "parent": false}]';
238
  }
239
  ?>
240
 
241
  var _ra = _ra || {};
242
+ _ra.addToCartInfo = {
243
+ "product_id": "<?php echo $info['product_id']; ?>",
244
+ "quantity": 1,
245
+ "variation": <?php echo $info['variation']; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  };
247
+ if (_ra.ready !== undefined) {
248
+ if(typeof _ra.addToCart !== "undefined") _ra.addToCart(_ra.addToCartInfo.product_id, _ra.addToCartInfo.variation);
 
249
  }
250
 
251
  <?php else : ?>
400
 
401
  var _ra_vo = {
402
  "code": _ra_voCode.join('-'),
403
+ "stock": 1,
404
  "details": _ra_voDetails
405
  }
406
  return _ra_vo;
655
  $_productUrl = $_product->getProductUrl();
656
  $_category = false;
657
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
  ?>
 
659
  var _ra = _ra || {};
660
+ _ra.addToWishlistInfo = {
661
+ "product_id": "<?php echo $info['product_id']; ?>"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
662
  };
663
+
664
  if (_ra.ready !== undefined) {
665
+ if(typeof _ra.addToWishlist !== "undefined") _ra.addToWishlist(_ra.addToWishlistInfo.product_id);
666
  }
667
 
668
+
669
  <?php else : ?>
670
 
671
  var _ra = _ra || {};
761
  <?php Mage::getSingleton('core/session')->unsTriggerCommentOnProduct(); ?>
762
  <?php endif ?>
763
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
764
  <?php
765
  /*
766
  ----------------------- Trigger saveOrder -----------------------
783
  "discount": <?php echo $info['discount']; ?>,
784
  "discount_code": "<?php echo $info['discount_code']; ?>",
785
  "shipping": <?php echo $info['shipping']; ?>,
786
+ "rebates": 0,
787
+ "fees": 0,
788
  "total": <?php echo $info['total']; ?>,
789
  };
790
  _ra.saveOrderProducts = <?php echo $info['products']; ?>
885
  ?>
886
  <?php
887
  Mage::getSingleton('core/session')->setReferralController( Mage::app()->getFrontController()->getRequest()->getControllerName() );
888
+ ?>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Retargeting_Tracker</name>
4
- <version>1.2.2</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -29,9 +29,9 @@
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>Minor bugfixes</notes>
31
  <authors><author><name>Retargeting Team</name><user>retargeting</user><email>info@retargeting.biz</email></author></authors>
32
- <date>2016-05-27</date>
33
- <time>15:24:32</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="1d49627473482ffbd78e51f115b1af29"/><file name=".DS_Store" hash="d11404072f2b23ac744502af2efbfe93"/></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="760e4da0cdb51039b90a9613a021b9d1"/><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="bc053f9d11fcc53044eb3bd713f11973"/></dir><file name=".DS_Store" hash="d29b7baf1fa7ffc25b67aa991cd3515e"/></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="61395cd9bcc55a21807f627b8d108aac"/><file name="triggers.phtml" hash="69ca1957ffad152904acf110bb4d9bac"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Retargeting_Tracker.xml" hash="44dbbcea34bc8ed9cc6d744176adb9a6"/></dir></target><target name="magelib"><dir name="Retargeting"><file name="Retargeting_REST_API_Client.php" hash="fd92942d4feb817768bb8157c01c7138"/></dir></target></contents>
35
  <compatible/>
36
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
37
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Retargeting_Tracker</name>
4
+ <version>1.2.3</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
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>Minor bugfixes</notes>
31
  <authors><author><name>Retargeting Team</name><user>retargeting</user><email>info@retargeting.biz</email></author></authors>
32
+ <date>2016-06-01</date>
33
+ <time>09:22:25</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="c0c093509accc2181e77b01775baa8bd"/><file name=".DS_Store" hash="d11404072f2b23ac744502af2efbfe93"/></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="760e4da0cdb51039b90a9613a021b9d1"/><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="bc053f9d11fcc53044eb3bd713f11973"/></dir><file name=".DS_Store" hash="d29b7baf1fa7ffc25b67aa991cd3515e"/></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="40d6d969660176cd05d9ab3ea463d4fb"/><file name="triggers.phtml" hash="827a0436a956b041de8eaf4163c5d34b"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Retargeting_Tracker.xml" hash="44dbbcea34bc8ed9cc6d744176adb9a6"/></dir></target><target name="magelib"><dir name="Retargeting"><file name="Retargeting_REST_API_Client.php" hash="fd92942d4feb817768bb8157c01c7138"/></dir></target></contents>
35
  <compatible/>
36
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
37
  </package>