Rejoiner - Version 1.1.8

Version Notes

Feature of Google Analytics campaign tracking by "return URL" was addedd.
Feature of "Remove Cart Item" event tracking was added.

Download this release

Release Info

Developer Mike
Extension Rejoiner
Version 1.1.8
Comparing to
See all releases


Code changes from version 1.1.7 to 1.1.8

app/code/community/Rejoiner/Acr/Block/Adminhtml/Custom/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Rejoiner_Acr_Block_Adminhtml_Custom_Form extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
3
+ {
4
+
5
+ public function __construct()
6
+ {
7
+ $this->addColumn('attr_name', array(
8
+ 'label' => Mage::helper('adminhtml')->__('Attribute Name'),
9
+ 'style' => 'width:120px',
10
+ ));
11
+ $this->addColumn('value', array(
12
+ 'label' => Mage::helper('adminhtml')->__('Value'),
13
+ 'style' => 'width:120px',
14
+ ));
15
+ $this->_addAfter = false;
16
+ $this->_addButtonLabel = Mage::helper('adminhtml')->__('Add Attribute');
17
+ parent::__construct();
18
+ }
19
+ }
app/code/community/Rejoiner/Acr/Block/Adminhtml/Form/Field/Source.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Rejoiner_Acr_Block_Adminhtml_Form_Field_Source extends Mage_Core_Block_Html_Select
3
+ {
4
+ protected $_metaSources = array(
5
+ 'utm_source' => 'Campaign Source',
6
+ 'utm_medium' => 'Campaign Medium',
7
+ 'utm_campaign' => 'Campaign Name',
8
+ );
9
+
10
+ protected $_addGroupAllOption = true;
11
+
12
+
13
+ protected function _getMetaSources()
14
+ {
15
+ return $this->_metaSources;
16
+ }
17
+
18
+ public function setInputName($value)
19
+ {
20
+ return $this->setName($value);
21
+ }
22
+
23
+ /**
24
+ * Render block HTML
25
+ *
26
+ * @return string
27
+ */
28
+ public function _toHtml()
29
+ {
30
+ if (!$this->getOptions()) {
31
+ foreach ($this->_getMetaSources() as $groupId => $groupLabel) {
32
+ $this->addOption($groupId, Mage::helper('adminhtml')->__(addslashes($groupLabel)));
33
+ }
34
+ }
35
+ return parent::_toHtml();
36
+ }
37
+ }
app/code/community/Rejoiner/Acr/Block/Adminhtml/Preinstalled/Form.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Rejoiner_Acr_Block_Adminhtml_Preinstalled_Form extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
3
+ {
4
+ protected $_sourceRenderer;
5
+
6
+ protected function _prepareToRender()
7
+ {
8
+ $this->addColumn('attr_name', array(
9
+ 'label' => Mage::helper('adminhtml')->__('Attribute Name'),
10
+ 'style' => 'width:120px',
11
+ 'renderer' => $this->_getSourceRenderer()
12
+ ));
13
+ $this->addColumn('value', array(
14
+ 'label' => Mage::helper('adminhtml')->__('Value'),
15
+ 'style' => 'width:120px',
16
+ ));
17
+ $this->_addAfter = false;
18
+ $this->_addButtonLabel = Mage::helper('adminhtml')->__('Add Attribute');
19
+ }
20
+
21
+ protected function _getSourceRenderer()
22
+ {
23
+ if (!$this->_sourceRenderer) {
24
+ $this->_sourceRenderer = Mage::getSingleton('core/layout')->createBlock(
25
+ 'rejoiner_acr/adminhtml_form_field_source', 'google_anal',
26
+ array('is_render_to_js_template' => true)
27
+ );
28
+ }
29
+ return $this->_sourceRenderer;
30
+ }
31
+
32
+ protected function _prepareArrayRow(Varien_Object $row)
33
+ {
34
+ $row->setData(
35
+ 'option_extra_attr_' . $this->_getSourceRenderer()->calcOptionHash($row->getData('attr_name')),
36
+ 'selected="selected"'
37
+ );
38
+ }
39
+ }
app/code/community/Rejoiner/Acr/Block/Snippets.php CHANGED
@@ -37,14 +37,14 @@ class Rejoiner_Acr_Block_Snippets extends Mage_Core_Block_Template
37
  $imageHelper = Mage::helper('catalog/image');
38
  // get thumbnail from configurable product
39
  if ($product->getData('thumbnail') && ($product->getData('thumbnail') != 'no_selection')) {
40
- $thumbnail = $mediaUrl . 'catalog/product' . $product->getData('thumbnail');
41
  // or try finding it in the simple one
42
  } elseif ($item->getProductType() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {
43
  /** @var Mage_Sales_Model_Quote_Item $simpleItem */
44
  $simpleItem = $parentToChild[$item->getId()];
45
  $simpleProduct = $simpleItem->getProduct();
46
  if ($simpleProduct->getData('thumbnail') && ($simpleProduct->getData('thumbnail') != 'no_selection')) {
47
- $thumbnail = $mediaUrl . 'catalog/product' . $simpleProduct->getData('thumbnail');
48
  }
49
  } elseif ($productId = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getEntityId())) {
50
  if (isset($productId[0])) {
@@ -53,18 +53,22 @@ class Rejoiner_Acr_Block_Snippets extends Mage_Core_Block_Template
53
  ->addAttributeToSelect('thumbnail')
54
  ->addAttributeToFilter('entity_id', $productId)
55
  ->getFirstItem();
56
- $thumbnail = $mediaUrl . 'catalog/product' . $configurableProduct->getData('thumbnail');
57
  }
58
  }
59
  // use placeholder image if nor simple nor configurable products does not have images
60
  if ($thumbnail == 'no_selection') {
61
  $imageHelper->init($product, 'thumbnail');
62
- $thumbnail = Mage::getDesign()->getSkinUrl($imageHelper->getPlaceholder());
 
 
 
 
63
  }
64
 
65
  $newItem = array();
66
  $newItem['name'] = $item->getName();
67
- $newItem['image_url'] = $thumbnail;
68
  $newItem['price'] = (string) $this->_convertPriceToCents($item->getBaseCalculationPrice());
69
  $newItem['product_id'] = (string) $item->getSku();
70
  $newItem['item_qty'] = (string) $item->getQty();
37
  $imageHelper = Mage::helper('catalog/image');
38
  // get thumbnail from configurable product
39
  if ($product->getData('thumbnail') && ($product->getData('thumbnail') != 'no_selection')) {
40
+ $thumbnail = $product->getData('thumbnail');
41
  // or try finding it in the simple one
42
  } elseif ($item->getProductType() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {
43
  /** @var Mage_Sales_Model_Quote_Item $simpleItem */
44
  $simpleItem = $parentToChild[$item->getId()];
45
  $simpleProduct = $simpleItem->getProduct();
46
  if ($simpleProduct->getData('thumbnail') && ($simpleProduct->getData('thumbnail') != 'no_selection')) {
47
+ $thumbnail = $simpleProduct->getData('thumbnail');
48
  }
49
  } elseif ($productId = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getEntityId())) {
50
  if (isset($productId[0])) {
53
  ->addAttributeToSelect('thumbnail')
54
  ->addAttributeToFilter('entity_id', $productId)
55
  ->getFirstItem();
56
+ $thumbnail = $configurableProduct->getData('thumbnail');
57
  }
58
  }
59
  // use placeholder image if nor simple nor configurable products does not have images
60
  if ($thumbnail == 'no_selection') {
61
  $imageHelper->init($product, 'thumbnail');
62
+ $image = Mage::getDesign()->getSkinUrl($imageHelper->getPlaceholder());
63
+ } elseif($imagePath = Mage::helper('rejoiner_acr')->resizeImage($thumbnail)) {
64
+ $image = str_replace(Mage::getBaseDir('media') . '/', $mediaUrl, $imagePath);
65
+ } else {
66
+ $image = $mediaUrl . 'catalog/product' . $thumbnail;
67
  }
68
 
69
  $newItem = array();
70
  $newItem['name'] = $item->getName();
71
+ $newItem['image_url'] = $image;
72
  $newItem['price'] = (string) $this->_convertPriceToCents($item->getBaseCalculationPrice());
73
  $newItem['product_id'] = (string) $item->getSku();
74
  $newItem['item_qty'] = (string) $item->getQty();
app/code/community/Rejoiner/Acr/Helper/Data.php CHANGED
@@ -14,7 +14,10 @@ class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
14
  const XML_PATH_REJOINER_DOMAIN = 'checkout/rejoiner_acr/domain';
15
  const XML_PATH_REJOINER_TRACK_NUMBERS = 'checkout/rejoiner_acr/track_numbers';
16
  const XML_PATH_REJOINER_PERSIST_FORMS = 'checkout/rejoiner_acr/persist_forms';
 
 
17
 
 
18
 
19
  public function getRejoinerSiteId()
20
  {
@@ -36,7 +39,9 @@ class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
36
  }
37
  }
38
  }
39
- $url = Mage::getUrl('rejoiner/addtocart?'.http_build_query($product));
 
 
40
  return substr($url, 0, strlen($url)-1);
41
  }
42
 
@@ -107,4 +112,85 @@ class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
107
 
108
  return $secure;
109
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
14
  const XML_PATH_REJOINER_DOMAIN = 'checkout/rejoiner_acr/domain';
15
  const XML_PATH_REJOINER_TRACK_NUMBERS = 'checkout/rejoiner_acr/track_numbers';
16
  const XML_PATH_REJOINER_PERSIST_FORMS = 'checkout/rejoiner_acr/persist_forms';
17
+ const XML_PATH_REJOINER_THUMBNAIL_SIZE = 'checkout/rejoiner_acr/thumbnail_size';
18
+ const REMOVED_CART_ITEM_SKU_VARIABLE = 'rejoiner_sku';
19
 
20
+ protected $_currentProtocolSecurity = null;
21
 
22
  public function getRejoinerSiteId()
23
  {
39
  }
40
  }
41
  }
42
+ $googleAttributesArray = $this->returnGoogleAttributes();
43
+ $customAttributesArray = $this->returnCustomAttributes();
44
+ $url = Mage::getUrl('rejoiner/addtocart?'.http_build_query(array_merge($product, $googleAttributesArray, $customAttributesArray)));
45
  return substr($url, 0, strlen($url)-1);
46
  }
47
 
112
 
113
  return $secure;
114
  }
115
+
116
+ /**
117
+ * @param $productImageName
118
+ * @return bool
119
+ */
120
+
121
+ public function resizeImage($productImageName)
122
+ {
123
+ if($size = $this->_parseSize(Mage::getStoreConfig(self::XML_PATH_REJOINER_THUMBNAIL_SIZE))) {
124
+ $imageResized = Mage::getBaseDir('media') . '/catalog/resized/' . $size['width'] . 'x' . $size['height'] . $productImageName;
125
+ if (!file_exists($imageResized)) {
126
+ $imageObj = new Varien_Image(Mage::getBaseDir('media') . '/catalog/product' . $productImageName);
127
+ $imageObj->resize($size['width'], $size['height']);
128
+ $imageObj->save($imageResized);
129
+ }
130
+ } else {
131
+ return false;
132
+ }
133
+ return $imageResized;
134
+ }
135
+
136
+ /**
137
+ * @param $string
138
+ * @return array|bool
139
+ */
140
+
141
+ protected function _parseSize($string)
142
+ {
143
+ $size = explode('x', strtolower($string));
144
+ if (sizeof($size) == 2) {
145
+ return array(
146
+ 'width' => ($size[0] > 0) ? $size[0] : null,
147
+ 'height' => ($size[1] > 0) ? $size[1] : null,
148
+ );
149
+ }
150
+ return false;
151
+ }
152
+
153
+ /**
154
+ * @return bool
155
+ */
156
+
157
+ /**
158
+ * @return bool|mixed
159
+ */
160
+ public function checkRemovedItem()
161
+ {
162
+ $session = Mage::getSingleton('core/session', array('name' => 'frontend'));
163
+ if ($session->hasData(self::REMOVED_CART_ITEM_SKU_VARIABLE)) {
164
+ $removedItems = $session->getData(self::REMOVED_CART_ITEM_SKU_VARIABLE);
165
+ $session->unsetData(self::REMOVED_CART_ITEM_SKU_VARIABLE);
166
+ return $removedItems;
167
+ }
168
+ return false;
169
+ }
170
+
171
+
172
+
173
+ public function returnGoogleAttributes() {
174
+ $result=array();
175
+ if ($googleAnalitics = Mage::getStoreConfig('checkout/rejoiner_acr/google_attributes')) {
176
+ foreach (unserialize($googleAnalitics) as $attr) {
177
+ if ($attr['attr_name'] && $attr['value']) {
178
+ $result[$attr['attr_name']] = $attr['value'];
179
+ }
180
+ }
181
+ }
182
+ return $result;
183
+ }
184
+
185
+ public function returnCustomAttributes() {
186
+ $result=array();
187
+ if ($customAttr = Mage::getStoreConfig('checkout/rejoiner_acr/custom_attributes')) {
188
+ foreach (unserialize($customAttr) as $attr) {
189
+ if ($attr['attr_name'] && $attr['value']) {
190
+ $result[$attr['attr_name']] = $attr['value'];
191
+ }
192
+ }
193
+ }
194
+ return $result;
195
+ }
196
  }
app/code/community/Rejoiner/Acr/Model/Api/Client.php ADDED
File without changes
app/code/community/Rejoiner/Acr/Model/Observer.php CHANGED
@@ -80,4 +80,15 @@ class Rejoiner_Acr_Model_Observer
80
  }
81
  }
82
  }
 
 
 
 
 
 
 
 
 
 
 
83
  }
80
  }
81
  }
82
  }
83
+
84
+ public function removeCartItem(Varien_Event_Observer $observer)
85
+ {
86
+ $session = Mage::getSingleton('core/session', array('name' => 'frontend'));
87
+ if ($quote = $observer->getQuoteItem()) {
88
+ $quote->getSku();
89
+ $removedItem[] = $quote->getSku();
90
+ $session->setData(Rejoiner_Acr_Helper_Data::REMOVED_CART_ITEM_SKU_VARIABLE, $removedItem);
91
+ }
92
+
93
+ }
94
  }
app/code/community/Rejoiner/Acr/controllers/AddtocartController.php CHANGED
@@ -14,11 +14,12 @@ class Rejoiner_Acr_AddtocartController extends Mage_Core_Controller_Front_Action
14
  Mage::getSingleton('checkout/cart')->truncate();
15
  $params = $this->getRequest()->getParams();
16
  $cart = Mage::helper('checkout/cart')->getCart();
17
- foreach ($params as $product) {
18
  if ($product && is_array($product)) {
19
  $prodModel = Mage::getModel('catalog/product')->load((int)$product['product']);
20
  try {
21
  $cart->addProduct($prodModel, $product);
 
22
  } catch (Exception $e) {
23
  Mage::log($e->getMessage(), null, 'rejoiner.log');
24
  }
@@ -26,7 +27,7 @@ class Rejoiner_Acr_AddtocartController extends Mage_Core_Controller_Front_Action
26
  }
27
  $cart->save();
28
  Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
29
- $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart/'));
30
  }
31
 
32
  }
14
  Mage::getSingleton('checkout/cart')->truncate();
15
  $params = $this->getRequest()->getParams();
16
  $cart = Mage::helper('checkout/cart')->getCart();
17
+ foreach ($params as $key => $product) {
18
  if ($product && is_array($product)) {
19
  $prodModel = Mage::getModel('catalog/product')->load((int)$product['product']);
20
  try {
21
  $cart->addProduct($prodModel, $product);
22
+ unset($params[$key]);
23
  } catch (Exception $e) {
24
  Mage::log($e->getMessage(), null, 'rejoiner.log');
25
  }
27
  }
28
  $cart->save();
29
  Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
30
+ $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart/', array('_query' => $params)));
31
  }
32
 
33
  }
app/code/community/Rejoiner/Acr/etc/config.xml CHANGED
@@ -56,6 +56,14 @@
56
  </rejoiner_order_success>
57
  </observers>
58
  </checkout_onepage_controller_success_action>
 
 
 
 
 
 
 
 
59
  </events>
60
  </frontend>
61
  <admin>
56
  </rejoiner_order_success>
57
  </observers>
58
  </checkout_onepage_controller_success_action>
59
+ <sales_quote_remove_item>
60
+ <observers>
61
+ <remove_cart_item>
62
+ <class>rejoiner_acr/observer</class>
63
+ <method>removeCartItem</method>
64
+ </remove_cart_item>
65
+ </observers>
66
+ </sales_quote_remove_item>
67
  </events>
68
  </frontend>
69
  <admin>
app/code/community/Rejoiner/Acr/etc/system.xml CHANGED
@@ -102,6 +102,35 @@
102
  <show_in_website>1</show_in_website>
103
  <show_in_store>1</show_in_store>
104
  </salesrule_model>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  </fields>
106
  </rejoiner_acr>
107
  </groups>
102
  <show_in_website>1</show_in_website>
103
  <show_in_store>1</show_in_store>
104
  </salesrule_model>
105
+ <thumbnail_size>
106
+ <label>Thumbnail Default Size</label>
107
+ <comment>Example format: 200x300.</comment>
108
+ <frontend_type>text</frontend_type>
109
+ <sort_order>120</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>0</show_in_website>
112
+ <show_in_store>0</show_in_store>
113
+ </thumbnail_size>
114
+ <google_attributes translate="label">
115
+ <label>Google Analytics data</label>
116
+ <frontend_model>rejoiner_acr/adminhtml_preinstalled_form</frontend_model>
117
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
118
+ <sort_order>130</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>1</show_in_store>
122
+ <depends><show_standard>0</show_standard></depends>
123
+ </google_attributes>
124
+ <custom_attributes translate="label">
125
+ <label>Custom parameters</label>
126
+ <frontend_model>rejoiner_acr/adminhtml_custom_form</frontend_model>
127
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
128
+ <sort_order>140</sort_order>
129
+ <show_in_default>1</show_in_default>
130
+ <show_in_website>1</show_in_website>
131
+ <show_in_store>1</show_in_store>
132
+ <depends><show_standard>0</show_standard></depends>
133
+ </custom_attributes>
134
  </fields>
135
  </rejoiner_acr>
136
  </groups>
app/design/frontend/base/default/template/rejoiner_acr/tracking.phtml CHANGED
@@ -1,42 +1,49 @@
1
  <?php
2
  /* @var $this Rejoiner_Acr_Block_Snippets */
3
  ?>
 
 
 
 
 
4
 
5
- <?php if (Mage::helper('checkout/cart')->getCart()->getSummaryQty()):?>
6
- <?php $items = $this->getCartItems() ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
- <script type="text/javascript">
9
- var _rejoiner = _rejoiner || [];
10
- _rejoiner.push(["setAccount", "<?php echo $this->helper('rejoiner_acr')->getRejoinerSiteId() ?>"]);
11
- _rejoiner.push(["setDomain", "<?php echo $this->helper('rejoiner_acr')->getDomain() ?>"]);
12
-
13
- <?php if ($this->helper('rejoiner_acr')->getTrackNumberEnabled()):?>
14
- _rejoiner.push(["trackNumbers"]);
15
- <?php endif ?>
16
-
17
- <?php if ($this->helper('rejoiner_acr')->getPersistFormsEnabled()):?>
18
- _rejoiner.push(["persistForms"]);
19
- <?php endif ?>
20
- (function() {
21
- var s = document.createElement('script'); s.type = 'text/javascript';
22
- s.async = true; s.src = 'https://s3.amazonaws.com/rejoiner/js/v3/t.js';
23
- var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
24
- })();
25
- </script>
26
-
27
- <script type="text/javascript">
28
- <?php
29
- $cartData = $this->getCartData();
30
- $cartData .= ($this->getChildHtml('rejoiner_email'))? ' ,'.$this->getChildHtml('rejoiner_email'): '';?>
31
- <?php if (Mage::getStoreConfig('checkout/rejoiner_acr/coupon_code')):?>
32
- <?php $couponCode = $this->helper('rejoiner_acr')->generateCouponCode();
33
- $cartData .= ','.'"promo"'.':'.'"'.$couponCode.'"';?>
34
- <?php endif; ?>
35
- _rejoiner.push(["setCartData", <?php echo $cartData? "{". $cartData . "}" : ''?>]);
36
- <?php foreach ($items as $item): ?>
37
- <?php $itemsAsJson = Mage::helper('core')->jsonEncode($item); ?>
38
- <?php $itemsAsJson = str_replace('\\', '', $itemsAsJson); ?>
39
- _rejoiner.push(["setCartItem", <?php echo $itemsAsJson?>]);
40
- <?php endforeach ?>
41
- </script>
42
- <?php endif ?>
1
  <?php
2
  /* @var $this Rejoiner_Acr_Block_Snippets */
3
  ?>
4
+ <script type="text/javascript">
5
+ //<![CDATA[
6
+ var _rejoiner = _rejoiner || [];
7
+ _rejoiner.push(["setAccount", "<?php echo $this->helper('rejoiner_acr')->getRejoinerSiteId() ?>"]);
8
+ _rejoiner.push(["setDomain", "<?php echo $this->helper('rejoiner_acr')->getDomain() ?>"]);
9
 
10
+ <?php if ($this->helper('rejoiner_acr')->getTrackNumberEnabled()):?>
11
+ _rejoiner.push(["trackNumbers"]);
12
+ <?php endif ?>
13
+ <?php if ($this->helper('rejoiner_acr')->getPersistFormsEnabled()):?>
14
+ _rejoiner.push(["persistForms"]);
15
+ <?php endif ?>
16
+ (function() {
17
+ var s = document.createElement('script'); s.type = 'text/javascript';
18
+ s.async = true; s.src = 'https://s3.amazonaws.com/rejoiner/js/v3/t.js';
19
+ var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
20
+ })();
21
+ <?php if (Mage::helper('checkout/cart')->getCart()->getSummaryQty()):?>
22
+ <?php $items = $this->getCartItems() ?>
23
+ <?php
24
+ $cartData = $this->getCartData();
25
+ $cartData .= ($this->getChildHtml('rejoiner_email'))? ' ,' . $this->getChildHtml('rejoiner_email'): '';?>
26
+ <?php if (Mage::getStoreConfig('checkout/rejoiner_acr/coupon_code')):?>
27
+ <?php $couponCode = $this->helper('rejoiner_acr')->generateCouponCode();
28
+ $cartData .= ','.'"promo"'.':'.'"'.$couponCode.'"';?>
29
+ <?php endif; ?>
30
+ _rejoiner.push(["setCartData", <?php echo $cartData? "{". $cartData . "}" : ''?>]);
31
+ <?php foreach ($items as $item): ?>
32
+ <?php $itemsAsJson = Mage::helper('core')->jsonEncode($item); ?>
33
+ <?php $itemsAsJson = str_replace('\\', '', $itemsAsJson); ?>
34
+ _rejoiner.push(["setCartItem", <?php echo $itemsAsJson?>]);
35
+ <?php endforeach ?>
36
+ <?php endif ?>
37
+ //]]>
38
+ </script>
39
 
40
+ <script type="text/javascript">
41
+ /** removeCartItem **/
42
+ //<![CDATA[
43
+ <?php if ($removedItems = $this->helper('rejoiner_acr')->checkRemovedItem()): ?>
44
+ <?php foreach ($removedItems as $item): ?>
45
+ _rejoiner.push(['removeCartItem', {product_id: '<?php echo $item ?>'}]);
46
+ <?php endforeach; ?>
47
+ <?php endif; ?>
48
+ //]]>
49
+ </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Rejoiner</name>
4
- <version>1.1.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Rejoiner Cart Abandonment Remarketing</summary>
10
  <description>Minor changes in rejoiner notifications functionality.</description>
11
- <notes>Issue caused by "Simple Configurable Products" extension was fixed.</notes>
 
12
  <authors><author><name>Mike</name><user>rejoiner</user><email>mike@rejoiner.com</email></author></authors>
13
- <date>2014-08-18</date>
14
- <time>08:21:04</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Rejoiner_Acr.xml" hash="1aad3601804cead81b6e687dfcb5b83f"/></dir></target><target name="magecommunity"><dir name="Rejoiner"><dir name="Acr"><dir name="Block"><dir name="Adminhtml"><file name="Notification.php" hash="4b4837b59ab85fa886e65be49d511490"/></dir><file name="Snippets.php" hash="3b0330f2aebf9c797455d6081f56df35"/></dir><dir name="Helper"><file name="Data.php" hash="bb0962b1d17663b9b8013b93390cc799"/></dir><dir name="Model"><file name="Notification.php" hash="a03d68e9bbaa820ce87557fca9f8f811"/><file name="Observer.php" hash="4709c0114a9f95c455eccc3ef731f2ec"/><dir name="Resource"><file name="Setup.php" hash="48f66ad159e3d10a21cc04a980ca923e"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Salesrule.php" hash="1b6a8d728b5fa308b18a222c5981ed52"/></dir></dir></dir></dir><dir name="controllers"><file name="AddtocartController.php" hash="4777a4c68b3693738a3409c95c7596eb"/><dir name="Adminhtml"><file name="RejoinerController.php" hash="c2e5fea12a2fc23905d86f119c2baa39"/></dir></dir><dir name="etc"><file name="config.xml" hash="7599dc7571149cb04bc66061590d9207"/><file name="system.xml" hash="2a128aff548ea844225e7d7eb7cd814b"/></dir><dir name="sql"><dir name="rejoiner_setup"><file name="mysql4-install-1.0.0.0.php" hash="8d9a21c9c09fe44c6fe51ddd2106e3e0"/><file name="mysql4-upgrade-1.0.0.0-1.0.1.0.php" hash="36cc70cc6dd37aab7f3c460e0af58d59"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="rejoiner_acr.xml" hash="ac5de6f021a440fe3bc1359133406ba7"/></dir><dir name="template"><dir name="rejoiner_acr"><file name="conversion.phtml" hash="13a53b2f28e5f5fa6e0644ea9cf5a6a4"/><file name="email.phtml" hash="05e54d0999953acf865b6a439c4bb6b5"/><file name="tracking.phtml" hash="1fb47f23cd14449a3978c12bb320fdd4"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="rejoiner_acr.xml" hash="3181cf1ca63813a9ce633ed3268659f4"/></dir><dir name="template"><dir name="rejoiner_acr"><file name="notification.phtml" hash="3a3872e6434bf7d2ca7fa0edfe6f9726"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Rejoiner_Acr.csv" hash="9015e31d97b9bc4746bc0a5241f8013b"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Rejoiner</name>
4
+ <version>1.1.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Rejoiner Cart Abandonment Remarketing</summary>
10
  <description>Minor changes in rejoiner notifications functionality.</description>
11
+ <notes>Feature of Google Analytics campaign tracking by "return URL" was addedd.&#xD;
12
+ Feature of "Remove Cart Item" event tracking was added.</notes>
13
  <authors><author><name>Mike</name><user>rejoiner</user><email>mike@rejoiner.com</email></author></authors>
14
+ <date>2014-09-24</date>
15
+ <time>13:30:18</time>
16
+ <contents><target name="mageetc"><dir name="modules"><file name="Rejoiner_Acr.xml" hash="1aad3601804cead81b6e687dfcb5b83f"/></dir></target><target name="magecommunity"><dir name="Rejoiner"><dir name="Acr"><dir name="Block"><dir name="Adminhtml"><dir name="Custom"><file name="Form.php" hash="88c8a6fa07de1c1f9ea12b79a791c370"/></dir><dir name="Form"><dir name="Field"><file name="Source.php" hash="87fca4bcce28c32b51d1ab0be864a11d"/></dir></dir><file name="Notification.php" hash="4b4837b59ab85fa886e65be49d511490"/><dir name="Preinstalled"><file name="Form.php" hash="04f5b18db325c2e630c103779c704ebe"/></dir></dir><file name="Snippets.php" hash="d217610765bef56ffe3b7ec708e7a4ac"/></dir><dir name="Helper"><file name="Data.php" hash="d639bc88bda659fc25664eb1bf13c696"/></dir><dir name="Model"><dir name="Api"><file name="Client.php" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir><file name="Notification.php" hash="a03d68e9bbaa820ce87557fca9f8f811"/><file name="Observer.php" hash="57f06c367f45041bb83c1700dc8d81e4"/><dir name="Resource"><file name="Setup.php" hash="48f66ad159e3d10a21cc04a980ca923e"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Salesrule.php" hash="1b6a8d728b5fa308b18a222c5981ed52"/></dir></dir></dir></dir><dir name="controllers"><file name="AddtocartController.php" hash="0b0b320358b4189c4e74d84f82097c67"/><dir name="Adminhtml"><file name="RejoinerController.php" hash="c2e5fea12a2fc23905d86f119c2baa39"/></dir></dir><dir name="etc"><file name="config.xml" hash="3b30082ec4eb7e18c4174e3ba9b422fc"/><file name="system.xml" hash="33879fa0e6df077529ad2b19b2f18e2b"/></dir><dir name="sql"><dir name="rejoiner_setup"><file name="mysql4-install-1.0.0.0.php" hash="8d9a21c9c09fe44c6fe51ddd2106e3e0"/><file name="mysql4-upgrade-1.0.0.0-1.0.1.0.php" hash="36cc70cc6dd37aab7f3c460e0af58d59"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="rejoiner_acr.xml" hash="ac5de6f021a440fe3bc1359133406ba7"/></dir><dir name="template"><dir name="rejoiner_acr"><file name="conversion.phtml" hash="13a53b2f28e5f5fa6e0644ea9cf5a6a4"/><file name="email.phtml" hash="05e54d0999953acf865b6a439c4bb6b5"/><file name="tracking.phtml" hash="e41f9ce034e822ebd2e648eeebce0a7e"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="rejoiner_acr.xml" hash="3181cf1ca63813a9ce633ed3268659f4"/></dir><dir name="template"><dir name="rejoiner_acr"><file name="notification.phtml" hash="3a3872e6434bf7d2ca7fa0edfe6f9726"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Rejoiner_Acr.csv" hash="9015e31d97b9bc4746bc0a5241f8013b"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>