Rejoiner - Version 1.1.23

Version Notes

Improved compatibility with Varnish cache

Download this release

Release Info

Developer Magento Core Team
Extension Rejoiner
Version 1.1.23
Comparing to
See all releases


Code changes from version 1.1.22 to 1.1.23

app/code/community/Rejoiner/Acr/Block/Adminhtml/Custom/Form.php CHANGED
@@ -1,7 +1,6 @@
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(
1
  <?php
2
  class Rejoiner_Acr_Block_Adminhtml_Custom_Form extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
3
  {
 
4
  public function __construct()
5
  {
6
  $this->addColumn('attr_name', array(
app/code/community/Rejoiner/Acr/Helper/Data.php CHANGED
@@ -24,13 +24,15 @@ class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
24
  return Mage::getStoreConfig(self::XML_PATH_REJOINER_SITE_ID);
25
  }
26
 
27
-
28
  public function getRestoreUrl()
29
  {
30
  $product = array();
31
- if (Mage::helper('checkout/cart')->getCart()->getItems()) {
32
- $items = Mage::helper('checkout/cart')->getCart()->getItems()->load()->getItems();
33
- foreach ($items as $item) {
 
 
 
34
  if (!$item->getParentItem()) {
35
  $options = unserialize($item->getOptionByCode('info_buyRequest')->getValue());
36
  $options['qty'] = $item->getQty();
@@ -41,7 +43,12 @@ class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
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
 
@@ -67,25 +74,31 @@ class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
67
 
68
  public function generateCouponCode()
69
  {
70
- $couponCode = Mage::helper('checkout/cart')->getCart()->getQuote()->getPromo();
71
- $rule_id = Mage::getStoreConfig('checkout/rejoiner_acr/salesrule_model');
 
 
 
 
72
  $ruleItem = Mage::getModel('salesrule/rule')
73
  ->getCollection()
74
- ->addFieldToFilter('rule_id', array('eq' => $rule_id))
75
  ->getFirstItem();
76
- if ($ruleItem->getUseAutoGeneration() && !$couponCode)
77
- {
78
- $couponCode = Mage::getModel('salesrule/coupon_codegenerator')->generateCode();
79
 
80
- Mage::getModel('salesrule/coupon')
81
- ->setRuleId($rule_id)
 
 
 
 
 
 
82
  ->setCode($couponCode)
83
  ->setUsageLimit(1)
84
- ->setCreatedAt(time())
85
  ->setType(Mage_SalesRule_Helper_Coupon::COUPON_TYPE_SPECIFIC_AUTOGENERATED)
86
  ->save();
87
 
88
- Mage::getSingleton('checkout/cart')
89
  ->getQuote()
90
  ->setPromo(strlen($couponCode) ? $couponCode : '')
91
  ->save();
@@ -194,7 +207,7 @@ class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
194
  return $result;
195
  }
196
 
197
- public function getProductCategories($product, $categoriesArray)
198
  {
199
  $result = array();
200
  foreach ($product->getCategoryIds() as $catId) {
@@ -204,5 +217,4 @@ class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
204
  }
205
  return implode(' ', $result);
206
  }
207
-
208
  }
24
  return Mage::getStoreConfig(self::XML_PATH_REJOINER_SITE_ID);
25
  }
26
 
 
27
  public function getRestoreUrl()
28
  {
29
  $product = array();
30
+ /** @var Mage_Checkout_Helper_Cart $cartHelper */
31
+ $cartHelper = Mage::helper('checkout/cart');
32
+
33
+ if ($itemsCollection = $cartHelper->getCart()->getItems()) {
34
+ /** @var Mage_Sales_Model_Quote_Item $item */
35
+ foreach ($itemsCollection as $item) {
36
  if (!$item->getParentItem()) {
37
  $options = unserialize($item->getOptionByCode('info_buyRequest')->getValue());
38
  $options['qty'] = $item->getQty();
43
  }
44
  $googleAttributesArray = $this->returnGoogleAttributes();
45
  $customAttributesArray = $this->returnCustomAttributes();
46
+
47
+ $queryParams = array_merge($product, $googleAttributesArray, $customAttributesArray);
48
+ $url = Mage::getUrl('rejoiner/addtocart/', array(
49
+ '_query' => $queryParams,
50
+ '_secure' => true
51
+ ));
52
  return substr($url, 0, strlen($url)-1);
53
  }
54
 
74
 
75
  public function generateCouponCode()
76
  {
77
+ /** @var Mage_Checkout_Helper_Cart $cartHelper */
78
+ $cartHelper = Mage::helper('checkout/cart');
79
+ $couponCode = $cartHelper->getCart()->getQuote()->getPromo();
80
+ $ruleId = Mage::getStoreConfig('checkout/rejoiner_acr/salesrule_model');
81
+
82
+ /** @var Mage_SalesRule_Model_Rule $ruleItem */
83
  $ruleItem = Mage::getModel('salesrule/rule')
84
  ->getCollection()
85
+ ->addFieldToFilter('rule_id', array('eq' => $ruleId))
86
  ->getFirstItem();
 
 
 
87
 
88
+ if ($ruleItem->getUseAutoGeneration() && !$couponCode) {
89
+ /** @var Mage_SalesRule_Model_Coupon_Codegenerator $codeGenerator */
90
+ $codeGenerator = Mage::getModel('salesrule/coupon_codegenerator');
91
+ $couponCode = $codeGenerator->generateCode();
92
+
93
+ /** @var Mage_SalesRule_Model_Coupon $coupon */
94
+ $coupon = Mage::getModel('salesrule/coupon');
95
+ $coupon->setRuleId($ruleId)
96
  ->setCode($couponCode)
97
  ->setUsageLimit(1)
 
98
  ->setType(Mage_SalesRule_Helper_Coupon::COUPON_TYPE_SPECIFIC_AUTOGENERATED)
99
  ->save();
100
 
101
+ $cartHelper->getCart()
102
  ->getQuote()
103
  ->setPromo(strlen($couponCode) ? $couponCode : '')
104
  ->save();
207
  return $result;
208
  }
209
 
210
+ public function getProductCategories(Mage_Catalog_Model_Product $product, $categoriesArray)
211
  {
212
  $result = array();
213
  foreach ($product->getCategoryIds() as $catId) {
217
  }
218
  return implode(' ', $result);
219
  }
 
220
  }
app/code/community/Rejoiner/Acr/Model/Observer.php CHANGED
@@ -11,19 +11,21 @@ class Rejoiner_Acr_Model_Observer
11
 
12
  public function trackOrderSuccessConversion(Varien_Event_Observer $observer)
13
  {
14
- /** @var Mage_Checkout_Model_Session $session */
15
- $lastOrderId = $observer->getEvent()->getData('order_ids');
16
- /** @var Mage_Sales_Model_Order $order */
17
- $order = Mage::getModel('sales/order')->load($lastOrderId[0]);
18
- $customerEmail = $order->getBillingAddress()->getEmail();
19
  $apiKey = Mage::getStoreConfig(self::XML_PATH_REJOINER_API_KEY);
20
  $apiSecret = utf8_encode(Mage::getStoreConfig(self::XML_PATH_REJOINER_API_SECRET));
21
- $siteId = Mage::getStoreConfig(self::XML_PATH_REJOINER_API_SITE_ID);
22
- $requestPath = sprintf(self::REJOINER_API_REQUEST_PATH, $siteId);
23
- $requestBody = utf8_encode(sprintf('{"email": "%s"}', $customerEmail));
24
- $hmacData = utf8_encode(implode("\n", array(Varien_Http_Client::POST, $requestPath, $requestBody)));
25
 
26
  if ($apiKey && $apiSecret) {
 
 
 
 
 
 
 
 
 
 
 
27
  $codedApiSecret = base64_encode(hash_hmac('sha1', $hmacData, $apiSecret, true));
28
  $authorization = sprintf('Rejoiner %s:%s', $apiKey , $codedApiSecret);
29
  $client = new Varien_Http_Client(self::REJOINER_API_URL . $requestPath);
@@ -57,11 +59,10 @@ class Rejoiner_Acr_Model_Observer
57
  public function removeCartItem(Varien_Event_Observer $observer)
58
  {
59
  $session = Mage::getSingleton('core/session', array('name' => 'frontend'));
 
60
  if ($quote = $observer->getQuoteItem()) {
61
- $quote->getSku();
62
  $removedItem[] = $quote->getSku();
63
  $session->setData(Rejoiner_Acr_Helper_Data::REMOVED_CART_ITEM_SKU_VARIABLE, $removedItem);
64
  }
65
-
66
  }
67
  }
11
 
12
  public function trackOrderSuccessConversion(Varien_Event_Observer $observer)
13
  {
 
 
 
 
 
14
  $apiKey = Mage::getStoreConfig(self::XML_PATH_REJOINER_API_KEY);
15
  $apiSecret = utf8_encode(Mage::getStoreConfig(self::XML_PATH_REJOINER_API_SECRET));
 
 
 
 
16
 
17
  if ($apiKey && $apiSecret) {
18
+ /** @var Mage_Checkout_Model_Session $session */
19
+ $lastOrderId = $observer->getEvent()->getData('order_ids');
20
+ /** @var Mage_Sales_Model_Order $order */
21
+ $order = Mage::getModel('sales/order')->load($lastOrderId[0]);
22
+ $customerEmail = $order->getBillingAddress()->getEmail();
23
+
24
+ $siteId = Mage::getStoreConfig(self::XML_PATH_REJOINER_API_SITE_ID);
25
+ $requestPath = sprintf(self::REJOINER_API_REQUEST_PATH, $siteId);
26
+ $requestBody = utf8_encode(sprintf('{"email": "%s"}', $customerEmail));
27
+ $hmacData = utf8_encode(implode("\n", array(Varien_Http_Client::POST, $requestPath, $requestBody)));
28
+
29
  $codedApiSecret = base64_encode(hash_hmac('sha1', $hmacData, $apiSecret, true));
30
  $authorization = sprintf('Rejoiner %s:%s', $apiKey , $codedApiSecret);
31
  $client = new Varien_Http_Client(self::REJOINER_API_URL . $requestPath);
59
  public function removeCartItem(Varien_Event_Observer $observer)
60
  {
61
  $session = Mage::getSingleton('core/session', array('name' => 'frontend'));
62
+ /** @var Mage_Sales_Model_Quote_Item $quote */
63
  if ($quote = $observer->getQuoteItem()) {
 
64
  $removedItem[] = $quote->getSku();
65
  $session->setData(Rejoiner_Acr_Helper_Data::REMOVED_CART_ITEM_SKU_VARIABLE, $removedItem);
66
  }
 
67
  }
68
  }
app/code/community/Rejoiner/Acr/controllers/AddbyskuController.php CHANGED
@@ -2,23 +2,22 @@
2
 
3
  class Rejoiner_Acr_AddbyskuController extends Mage_Core_Controller_Front_Action
4
  {
5
-
6
  const XML_PATH_REJOINER_DEBUG_ENABLED = 'checkout/rejoiner_acr/debug_enabled';
7
 
8
- function indexAction()
9
  {
10
  $params = $this->getRequest()->getParams();
11
- if(Mage::helper('checkout/cart')->getItemsCount()) {
12
- $quote = Mage::getSingleton('checkout/session')->getQuote();
13
- } else {
14
- $quote = Mage::helper('checkout/cart')->getCart();
15
- }
16
  $successMessage = '';
17
  foreach ($params as $key => $product) {
18
  if ($product && is_array($product)) {
19
  if (!isset($product['sku'])) {
20
  continue;
21
  }
 
22
  $productModel = Mage::getModel('catalog/product');
23
  $productBySKU = $productModel->loadByAttribute('sku', $product['sku']);
24
  if (!$productBySKU->getId()) {
@@ -26,7 +25,9 @@ class Rejoiner_Acr_AddbyskuController extends Mage_Core_Controller_Front_Action
26
  }
27
  $productId = $productBySKU->getId();
28
  if ($productId) {
29
- $qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId)->getQty();
 
 
30
  try {
31
  if(!$quote->hasProductId($productId) && is_numeric($product['qty']) && $qty > $product['qty']) {
32
  $quote->addProduct($productBySKU, (int)$product['qty']);
@@ -42,7 +43,7 @@ class Rejoiner_Acr_AddbyskuController extends Mage_Core_Controller_Front_Action
42
  }
43
  }
44
  if ($params['coupon_code']) {
45
- Mage::getSingleton('checkout/cart')->getQuote()->setCouponCode($params['coupon_code'])->collectTotals()->save();;
46
  }
47
  try {
48
  $quote->save();
@@ -57,5 +58,4 @@ class Rejoiner_Acr_AddbyskuController extends Mage_Core_Controller_Front_Action
57
  }
58
  $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart/'));
59
  }
60
-
61
  }
2
 
3
  class Rejoiner_Acr_AddbyskuController extends Mage_Core_Controller_Front_Action
4
  {
 
5
  const XML_PATH_REJOINER_DEBUG_ENABLED = 'checkout/rejoiner_acr/debug_enabled';
6
 
7
+ public function indexAction()
8
  {
9
  $params = $this->getRequest()->getParams();
10
+ /** @var Mage_Checkout_Helper_Cart $cart */
11
+ $cart = Mage::helper('checkout/cart');
12
+ $quote = $cart->getQuote();
13
+
 
14
  $successMessage = '';
15
  foreach ($params as $key => $product) {
16
  if ($product && is_array($product)) {
17
  if (!isset($product['sku'])) {
18
  continue;
19
  }
20
+ /** @var Mage_Catalog_Model_Product $productModel */
21
  $productModel = Mage::getModel('catalog/product');
22
  $productBySKU = $productModel->loadByAttribute('sku', $product['sku']);
23
  if (!$productBySKU->getId()) {
25
  }
26
  $productId = $productBySKU->getId();
27
  if ($productId) {
28
+ /** @var Mage_CatalogInventory_Model_Stock_Item $stockItem */
29
+ $stockItem = Mage::getModel('cataloginventory/stock_item');
30
+ $qty = $stockItem->loadByProduct($productId)->getQty();
31
  try {
32
  if(!$quote->hasProductId($productId) && is_numeric($product['qty']) && $qty > $product['qty']) {
33
  $quote->addProduct($productBySKU, (int)$product['qty']);
43
  }
44
  }
45
  if ($params['coupon_code']) {
46
+ $quote->setCouponCode($params['coupon_code'])->collectTotals()->save();;
47
  }
48
  try {
49
  $quote->save();
58
  }
59
  $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart/'));
60
  }
 
61
  }
app/code/community/Rejoiner/Acr/controllers/AddtocartController.php CHANGED
@@ -2,12 +2,12 @@
2
 
3
  class Rejoiner_Acr_AddtocartController extends Mage_Core_Controller_Front_Action
4
  {
5
-
6
- function indexAction()
7
  {
8
- Mage::getSingleton('checkout/cart')->truncate();
 
 
9
  $params = $this->getRequest()->getParams();
10
- $cart = Mage::helper('checkout/cart')->getCart();
11
  foreach ($params as $key => $product) {
12
  if ($product && is_array($product)) {
13
  $prodModel = Mage::getModel('catalog/product')->load((int)$product['product']);
@@ -27,7 +27,10 @@ class Rejoiner_Acr_AddtocartController extends Mage_Core_Controller_Front_Action
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
  }
2
 
3
  class Rejoiner_Acr_AddtocartController extends Mage_Core_Controller_Front_Action
4
  {
5
+ public function indexAction()
 
6
  {
7
+ /** @var Mage_Checkout_Model_Cart $cart */
8
+ $cart = Mage::getSingleton('checkout/cart');
9
+ $cart->truncate();
10
  $params = $this->getRequest()->getParams();
 
11
  foreach ($params as $key => $product) {
12
  if ($product && is_array($product)) {
13
  $prodModel = Mage::getModel('catalog/product')->load((int)$product['product']);
27
  }
28
  $cart->save();
29
  Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
 
 
30
 
31
+ /** @var Rejoiner_Acr_Helper_Data $rejoinerHelper */
32
+ $rejoinerHelper = Mage::helper('rejoiner_acr');
33
+ $queryParams = array_merge($rejoinerHelper->returnGoogleAttributes(), $params);
34
+ $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart/', array('_query' => $queryParams)));
35
+ }
36
  }
app/code/community/Rejoiner/Acr/controllers/Adminhtml/RejoinerController.php CHANGED
@@ -2,7 +2,6 @@
2
 
3
  class Rejoiner_Acr_Adminhtml_RejoinerController extends Mage_Adminhtml_Controller_Action
4
  {
5
-
6
  public function denyNotificationAction()
7
  {
8
  if ($this->getRequest()->getParam('isAjax', false)) {
2
 
3
  class Rejoiner_Acr_Adminhtml_RejoinerController extends Mage_Adminhtml_Controller_Action
4
  {
 
5
  public function denyNotificationAction()
6
  {
7
  if ($this->getRequest()->getParam('isAjax', false)) {
app/code/community/Rejoiner/Acr/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Rejoiner_Acr>
5
- <version>1.0.1.1</version>
6
  </Rejoiner_Acr>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Rejoiner_Acr>
5
+ <version>1.1.23</version>
6
  </Rejoiner_Acr>
7
  </modules>
8
  <global>
app/design/frontend/base/default/template/rejoiner_acr/conversion.phtml CHANGED
@@ -1,11 +1,12 @@
1
- <?php
2
- /* @var $this Rejoiner_Acr_Block_Snippets */
 
3
  ?>
4
  <!-- Rejoiner Conversion -->
5
  <script type="text/javascript">
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
  _rejoiner.push(["sendConversion"]);
10
 
11
  (function() {
1
+ <?php /* @var Rejoiner_Acr_Block_Snippets $this */ ?>
2
+ <?php /** @var Rejoiner_Acr_Helper_Data $rejoinerHelper */
3
+ $rejoinerHelper = $this->helper('rejoiner_acr');
4
  ?>
5
  <!-- Rejoiner Conversion -->
6
  <script type="text/javascript">
7
  var _rejoiner = _rejoiner || [];
8
+ _rejoiner.push(["setAccount", "<?php echo $rejoinerHelper->getRejoinerSiteId(); ?>"]);
9
+ _rejoiner.push(["setDomain", "<?php echo $rejoinerHelper->getDomain(); ?>"]);
10
  _rejoiner.push(["sendConversion"]);
11
 
12
  (function() {
app/design/frontend/base/default/template/rejoiner_acr/email.phtml CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
- if ($customer = Mage::getSingleton('customer/session')->isLoggedIn()):
3
- $customerData = Mage::getModel('customer/customer')->load(Mage::getSingleton('customer/session')->getId())->getData(); ?>
4
- "email":"<?php echo $customerData['email']?>"
5
- <?php else:
6
- return false;
7
- endif;?>
1
  <?php
2
+ /** @var Mage_Customer_Model_Session $customerSession */
3
+ $customerSession = Mage::getSingleton('customer/session');
4
+ if ($customerSession->isLoggedIn()): ?>
5
+ "email":"<?php echo $customerSession->getCustomer()->getEmail(); ?>"
6
+ <?php endif; ?>
 
app/design/frontend/base/default/template/rejoiner_acr/tracking.phtml CHANGED
@@ -1,36 +1,37 @@
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
- _rejoiner.push(["setCartItem", <?php echo $itemsAsJson?>]);
34
  <?php endforeach ?>
35
  <?php endif ?>
36
  //]]>
@@ -39,9 +40,9 @@
39
  <script type="text/javascript">
40
  /** removeCartItem **/
41
  //<![CDATA[
42
- <?php if ($removedItems = $this->helper('rejoiner_acr')->checkRemovedItem()): ?>
43
  <?php foreach ($removedItems as $item): ?>
44
- _rejoiner.push(['removeCartItem', {product_id: '<?php echo $item ?>'}]);
45
  <?php endforeach; ?>
46
  <?php endif; ?>
47
  //]]>
1
+ <?php /* @var Rejoiner_Acr_Block_Snippets $this */ ?>
2
+ <?php /** @var Rejoiner_Acr_Helper_Data $rejoinerHelper */
3
+ $rejoinerHelper = $this->helper('rejoiner_acr');
4
  ?>
5
  <script type="text/javascript">
6
  //<![CDATA[
7
  var _rejoiner = _rejoiner || [];
8
+ _rejoiner.push(["setAccount", "<?php echo $rejoinerHelper->getRejoinerSiteId(); ?>"]);
9
+ _rejoiner.push(["setDomain", "<?php echo $rejoinerHelper->getDomain(); ?>"]);
10
 
11
+ <?php if ($rejoinerHelper->getTrackNumberEnabled()): ?>
12
  _rejoiner.push(["trackNumbers"]);
13
+ <?php endif; ?>
14
+ <?php if ($rejoinerHelper->getPersistFormsEnabled()): ?>
15
  _rejoiner.push(["persistForms"]);
16
+ <?php endif; ?>
17
  (function() {
18
  var s = document.createElement('script'); s.type = 'text/javascript';
19
  s.async = true; s.src = 'https://s3.amazonaws.com/rejoiner/js/v3/t.js';
20
  var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
21
  })();
22
+ <?php if (Mage::helper('checkout/cart')->getCart()->getSummaryQty()): ?>
23
+ <?php $items = $this->getCartItems();
24
+ $cartData = $this->getCartData();
25
+ $cartData .= ($this->getChildHtml('rejoiner_email'))? ' ,' . $this->getChildHtml('rejoiner_email'): '';
26
+ ?>
27
+ <?php if (Mage::getStoreConfig('checkout/rejoiner_acr/coupon_code')): ?>
28
+ <?php $couponCode = $rejoinerHelper->generateCouponCode();
29
+ $cartData .= ','.'"promo"'.':'.'"'.$couponCode.'"';?>
30
+ <?php endif; ?>
31
  _rejoiner.push(["setCartData", <?php echo $cartData? "{". $cartData . "}" : ''?>]);
32
  <?php foreach ($items as $item): ?>
33
  <?php $itemsAsJson = Mage::helper('core')->jsonEncode($item); ?>
34
+ _rejoiner.push(["setCartItem", <?php echo $itemsAsJson; ?>]);
35
  <?php endforeach ?>
36
  <?php endif ?>
37
  //]]>
40
  <script type="text/javascript">
41
  /** removeCartItem **/
42
  //<![CDATA[
43
+ <?php if ($removedItems = $rejoinerHelper->checkRemovedItem()): ?>
44
  <?php foreach ($removedItems as $item): ?>
45
+ _rejoiner.push(['removeCartItem', {product_id: '<?php echo $item; ?>'}]);
46
  <?php endforeach; ?>
47
  <?php endif; ?>
48
  //]]>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Rejoiner</name>
4
- <version>1.1.22</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>Turn abandoned carts into 15% more sales with Rejoiner.</description>
11
- <notes>Added 'category' to setCartItem API call</notes>
12
  <authors><author><name>Mike</name><user>auto-converted</user><email>mike@rejoiner.com</email></author></authors>
13
- <date>2016-03-29</date>
14
- <time>07:29:05</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"><dir name="Custom"><file name="Form.php" hash="88c8a6fa07de1c1f9ea12b79a791c370"/></dir><dir name="Form"><dir name="Field"><file name="Source.php" hash="87fca4bcce28c32b51d1ab0be864a11d"/></dir></dir><dir name="Preinstalled"><file name="Form.php" hash="04f5b18db325c2e630c103779c704ebe"/></dir><file name="Notification.php" hash="4b4837b59ab85fa886e65be49d511490"/></dir><file name="Snippets.php" hash="f3093cc38dfa69da65a51bb8ac79f992"/></dir><dir name="Helper"><file name="Data.php" hash="b04adceaeebee51b1cb521365d551d53"/></dir><dir name="Model"><dir name="Api"><file name="Client.php" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir><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><file name="Notification.php" hash="a03d68e9bbaa820ce87557fca9f8f811"/><file name="Observer.php" hash="6a90f25f0a4378f9b5dad032b0a975a5"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="RejoinerController.php" hash="c2e5fea12a2fc23905d86f119c2baa39"/></dir><file name="AddbyskuController.php" hash="2a09648d5550ab0c9b8f934615c2e8bf"/><file name="AddtocartController.php" hash="3449e820f5f46fc4aa12a5b989ddae89"/></dir><dir name="etc"><file name="config.xml" hash="525db600c2c3572bc4fdfb3bb01121fb"/><file name="system.xml" hash="13cdcf93f5638abf82c1499db974dec5"/></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="908d4f08cc1d82189c8d94b5959e45db"/></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="87e4d3e22c3b4876cca8ccb9cb3744c6"/></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/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Rejoiner</name>
4
+ <version>1.1.23</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>Turn abandoned carts into 15% more sales with Rejoiner.</description>
11
+ <notes>Improved compatibility with Varnish cache</notes>
12
  <authors><author><name>Mike</name><user>auto-converted</user><email>mike@rejoiner.com</email></author></authors>
13
+ <date>2016-08-19</date>
14
+ <time>14:14:58</time>
15
+ <contents><target name="mageetc"><dir><dir name="modules"><file name="Rejoiner_Acr.xml" hash="1aad3601804cead81b6e687dfcb5b83f"/></dir></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="badb91abb912c6e346c76c7de0f0a6ad"/></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="f3093cc38dfa69da65a51bb8ac79f992"/></dir><dir name="Helper"><file name="Data.php" hash="c4f0cc16219acc4ce46ddb77eae4d9c1"/></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="242bb955ba3761acc8ef29a4f981cfaa"/><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="AddbyskuController.php" hash="deb41c920fb2a87f45dc63d52a0f70e8"/><file name="AddtocartController.php" hash="4eec569879e29327f34f525fc1236de8"/><dir name="Adminhtml"><file name="RejoinerController.php" hash="0c1a1df3d91d5596ae4026c484a4bd1f"/></dir></dir><dir name="etc"><file name="config.xml" hash="738fef7afa19932e158dcfc74139489c"/><file name="system.xml" hash="13cdcf93f5638abf82c1499db974dec5"/></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><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><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="rejoiner_acr.xml" hash="908d4f08cc1d82189c8d94b5959e45db"/></dir><dir name="template"><dir name="rejoiner_acr"><file name="conversion.phtml" hash="3e0606911dbff98678ec8c3f7d9f3e3b"/><file name="email.phtml" hash="f0ee74651e9400429772f4a17ef2c9ec"/><file name="tracking.phtml" hash="ead414c490ef07842637ab0640bfeb24"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Rejoiner_Acr.csv" hash="9015e31d97b9bc4746bc0a5241f8013b"/></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
18
  </package>