Rejoiner - Version 1.2.0

Version Notes

Migrated to updated JS lib v4

Download this release

Release Info

Developer Mike
Extension Rejoiner
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.23 to 1.2.0

Files changed (27) hide show
  1. app/code/community/Rejoiner/Acr/Block/Adminhtml/Custom/Form.php +0 -18
  2. app/code/community/Rejoiner/Acr/Block/Adminhtml/Form/Field/Source.php +0 -37
  3. app/code/community/Rejoiner/Acr/Block/Adminhtml/Notification.php +0 -44
  4. app/code/community/Rejoiner/Acr/Block/Adminhtml/Preinstalled/Form.php +0 -39
  5. app/code/community/Rejoiner/Acr/Block/Snippets.php +0 -137
  6. app/code/community/Rejoiner/Acr/Helper/Data.php +0 -220
  7. app/code/community/Rejoiner/Acr/Model/Api/Client.php +0 -0
  8. app/code/community/Rejoiner/Acr/Model/Notification.php +0 -44
  9. app/code/community/Rejoiner/Acr/Model/Observer.php +0 -68
  10. app/code/community/Rejoiner/Acr/Model/Resource/Setup.php +0 -6
  11. app/code/community/Rejoiner/Acr/Model/System/Config/Source/Salesrule.php +0 -28
  12. app/code/community/Rejoiner/Acr/controllers/AddbyskuController.php +0 -61
  13. app/code/community/Rejoiner/Acr/controllers/AddtocartController.php +0 -36
  14. app/code/community/Rejoiner/Acr/controllers/Adminhtml/RejoinerController.php +0 -22
  15. app/code/community/Rejoiner/Acr/etc/config.xml +0 -106
  16. app/code/community/Rejoiner/Acr/etc/system.xml +0 -149
  17. app/code/community/Rejoiner/Acr/sql/rejoiner_setup/mysql4-install-1.0.0.0.php +0 -5
  18. app/code/community/Rejoiner/Acr/sql/rejoiner_setup/mysql4-upgrade-1.0.0.0-1.0.1.0.php +0 -11
  19. app/design/adminhtml/default/default/layout/rejoiner_acr.xml +0 -11
  20. app/design/adminhtml/default/default/template/rejoiner_acr/notification.phtml +0 -24
  21. app/design/frontend/base/default/layout/rejoiner_acr.xml +0 -88
  22. app/design/frontend/base/default/template/rejoiner_acr/conversion.phtml +0 -18
  23. app/design/frontend/base/default/template/rejoiner_acr/email.phtml +0 -6
  24. app/design/frontend/base/default/template/rejoiner_acr/tracking.phtml +0 -49
  25. app/etc/modules/Rejoiner_Acr.xml +0 -12
  26. app/locale/en_US/Rejoiner_Acr.csv +0 -10
  27. package.xml +7 -7
app/code/community/Rejoiner/Acr/Block/Adminhtml/Custom/Form.php DELETED
@@ -1,18 +0,0 @@
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(
7
- 'label' => Mage::helper('adminhtml')->__('Attribute Name'),
8
- 'style' => 'width:120px',
9
- ));
10
- $this->addColumn('value', array(
11
- 'label' => Mage::helper('adminhtml')->__('Value'),
12
- 'style' => 'width:120px',
13
- ));
14
- $this->_addAfter = false;
15
- $this->_addButtonLabel = Mage::helper('adminhtml')->__('Add Attribute');
16
- parent::__construct();
17
- }
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/Block/Adminhtml/Form/Field/Source.php DELETED
@@ -1,37 +0,0 @@
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/Notification.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Block to check overriding for checkout by other extensions and show warning message
5
- *
6
- * @category Rejoiner
7
- * @package Rejoiner_Acr
8
- */
9
- class Rejoiner_Acr_Block_Adminhtml_Notification extends Mage_Core_Block_Template
10
- {
11
-
12
- public function canShow()
13
- {
14
- if (Rejoiner_Acr_Model_Notification::isNotificationViewed()) {
15
- return false;
16
- }
17
-
18
- if ($this->_isCoreCheckoutControllerOverridden()
19
- || $this->_isCoreCheckoutUrlHelperOverridden()
20
- ) {
21
- return true;
22
- }
23
-
24
- return false;
25
- }
26
-
27
- protected function _isCoreCheckoutControllerOverridden()
28
- {
29
- $frontController = new Mage_Core_Controller_Varien_Front();
30
- $frontController->init();
31
-
32
- $standard = $frontController->getRouter('standard');
33
-
34
- $modules = $standard->getModuleByFrontName('checkout');
35
-
36
- return reset($modules) != 'Mage_Checkout';
37
- }
38
-
39
- protected function _isCoreCheckoutUrlHelperOverridden()
40
- {
41
- return get_class(Mage::helper('checkout/url')) != 'Mage_Checkout_Helper_Url';
42
- }
43
-
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/Block/Adminhtml/Preinstalled/Form.php DELETED
@@ -1,39 +0,0 @@
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 DELETED
@@ -1,137 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Main block for module
5
- *
6
- * @category Rejoiner
7
- * @package Rejoiner_Acr
8
- */
9
- class Rejoiner_Acr_Block_Snippets extends Mage_Core_Block_Template
10
- {
11
-
12
- const XML_PATH_REJOINER_TRACK_PRICE_WITH_TAX = 'checkout/rejoiner_acr/price_with_tax';
13
-
14
- public function getCartItems()
15
- {
16
- $items = array();
17
- if ($quote = $this->_getQuote()) {
18
- $mediaUrl = Mage::getBaseUrl('media');
19
- $quoteItems = $quote->getAllItems();
20
- $displayPriceWithTax = $this->getTrackPriceWithTax();
21
- $rejoinerHelper = Mage::helper('rejoiner_acr');
22
- $parentToChild = array();
23
- $categories = array();
24
- /** @var Mage_Sales_Model_Quote_Item $item */
25
- foreach ($quoteItems as $item) {
26
- /** @var Mage_Sales_Model_Quote_Item $parent */
27
- if ($parent = $item->getParentItem()) {
28
- if ($parent->getProductType() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {
29
- $parentToChild[$parent->getId()] = $item;
30
- }
31
- }
32
- $categories = array_merge($categories, $item->getProduct()->getCategoryIds());
33
- }
34
-
35
- $categoriesArray = Mage::getModel('catalog/category')
36
- ->getCollection()
37
- ->addAttributeToSelect('name')
38
- ->addFieldToFilter('entity_id', array('in' => $categories))
39
- ->load()
40
- ->getItems();
41
-
42
- foreach ($quote->getAllItems() as $item) {
43
- if ($item->getParentItem()) {
44
- continue;
45
- }
46
-
47
- $product = $item->getProduct();
48
- $productCategories = $rejoinerHelper->getProductCategories($product, $categoriesArray);
49
- $thumbnail = 'no_selection';
50
- $imageHelper = Mage::helper('catalog/image');
51
- // get thumbnail from configurable product
52
- if ($product->getData('thumbnail') && ($product->getData('thumbnail') != 'no_selection')) {
53
- $thumbnail = $product->getData('thumbnail');
54
- // or try finding it in the simple one
55
- } elseif ($item->getProductType() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {
56
- /** @var Mage_Sales_Model_Quote_Item $simpleItem */
57
- $simpleItem = $parentToChild[$item->getId()];
58
- $simpleProduct = $simpleItem->getProduct();
59
- if ($simpleProduct->getData('thumbnail') && ($simpleProduct->getData('thumbnail') != 'no_selection')) {
60
- $thumbnail = $simpleProduct->getData('thumbnail');
61
- }
62
- } elseif ($productId = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getEntityId())) {
63
- if (isset($productId[0])) {
64
- $configurableProduct = Mage::getModel('catalog/product')
65
- ->getCollection()
66
- ->addAttributeToSelect('thumbnail')
67
- ->addAttributeToFilter('entity_id', $productId)
68
- ->getFirstItem();
69
- $thumbnail = $configurableProduct->getData('thumbnail');
70
- }
71
- }
72
-
73
- if (!file_exists(Mage::getBaseDir('media') . '/catalog/product' . $thumbnail)) {
74
- $thumbnail = 'no_selection';
75
- }
76
- // use placeholder image if nor simple nor configurable products does not have images
77
- if ($thumbnail == 'no_selection') {
78
- $imageHelper->init($product, 'thumbnail');
79
- $image = Mage::getDesign()->getSkinUrl($imageHelper->getPlaceholder());
80
- } elseif($imagePath = $rejoinerHelper->resizeImage($thumbnail)) {
81
- $image = str_replace(Mage::getBaseDir('media') . '/', $mediaUrl, $imagePath);
82
- } else {
83
- $image = $mediaUrl . 'catalog/product' . $thumbnail;
84
- }
85
-
86
- if ($displayPriceWithTax) {
87
- $prodPrice = $item->getPriceInclTax();
88
- $rowTotal = $item->getRowTotalInclTax();
89
- } else {
90
- $prodPrice = $item->getBaseCalculationPrice();
91
- $rowTotal = $item->getBaseRowTotal();
92
- }
93
- $newItem = array();
94
- $newItem['name'] = addslashes($item->getName());
95
- $newItem['image_url'] = $image;
96
- $newItem['price'] = (string) $this->_convertPriceToCents($prodPrice);
97
- $newItem['product_id'] = (string) $item->getSku();
98
- $newItem['product_url'] = (string) $item->getProduct()->getProductUrl();
99
- $newItem['item_qty'] = (string) $item->getQty();
100
- $newItem['qty_price'] = (string) $this->_convertPriceToCents($rowTotal);
101
- $newItem['category'] = $productCategories;
102
- $items[] = $newItem;
103
- }
104
- }
105
- return $items;
106
- }
107
-
108
- public function getCartData()
109
- {
110
- if ($quote = $this->_getQuote()) {
111
- if ($this->getTrackPriceWithTax()) {
112
- $total = $this->_getQuote()->getGrandTotal();
113
- } else {
114
- $total = $this->_getQuote()->getSubtotal();
115
- }
116
-
117
- return '"totalItems":"'.$this->_getQuote()->getItemsQty().'","value":"'.$this->_convertPriceToCents($total).'","returnUrl":"'.Mage::helper('rejoiner_acr')->getRestoreUrl().'"';
118
- }
119
- return '';
120
- }
121
-
122
-
123
- protected function _getQuote()
124
- {
125
- return Mage::getSingleton('checkout/session')->getQuote();
126
- }
127
-
128
- protected function _convertPriceToCents($price) {
129
- return round($price*100);
130
- }
131
-
132
- protected function getTrackPriceWithTax()
133
- {
134
- return Mage::getStoreConfig(self::XML_PATH_REJOINER_TRACK_PRICE_WITH_TAX);
135
- }
136
-
137
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/Helper/Data.php DELETED
@@ -1,220 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Generic helper for module
5
- *
6
- * @category Rejoiner
7
- * @package Rejoiner_Acr
8
- */
9
- class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
10
- {
11
-
12
- const XML_PATH_REJOINER_ENABLED = 'checkout/rejoiner_acr/enabled';
13
- const XML_PATH_REJOINER_SITE_ID = 'checkout/rejoiner_acr/site_id';
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
- {
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();
39
- $options['product'] = $item->getProductId();
40
- $product[] = $options;
41
- }
42
- }
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
-
55
- public function getDomain()
56
- {
57
- $domain = trim(Mage::getStoreConfig(self::XML_PATH_REJOINER_DOMAIN));
58
- if ($domain[0] == '.') {
59
- return $domain;
60
- } else {
61
- return '.' . $domain;
62
- }
63
- }
64
-
65
- public function getTrackNumberEnabled()
66
- {
67
- return Mage::getStoreConfig(self::XML_PATH_REJOINER_TRACK_NUMBERS);
68
- }
69
-
70
- public function getPersistFormsEnabled()
71
- {
72
- return Mage::getStoreConfig(self::XML_PATH_REJOINER_PERSIST_FORMS);
73
- }
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();
105
- }
106
- return $couponCode;
107
- }
108
-
109
- public function checkHttps()
110
- {
111
- if (empty($this->_currentProtocolSecurity)) {
112
- if (isset($_SERVER['HTTPS']) &&
113
- ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
114
- isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
115
- $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
116
- $secure = true;
117
- }
118
- else {
119
- $secure = false;
120
- }
121
- $this->_currentProtocolSecurity = $secure;
122
- } else {
123
- $secure = $this->_currentProtocolSecurity;
124
- }
125
-
126
- return $secure;
127
- }
128
-
129
- /**
130
- * @param $productImageName
131
- * @return bool
132
- */
133
-
134
- public function resizeImage($productImageName)
135
- {
136
- if($size = $this->_parseSize(Mage::getStoreConfig(self::XML_PATH_REJOINER_THUMBNAIL_SIZE))) {
137
- $imageResized = Mage::getBaseDir('media') . '/catalog/resized/' . $size['width'] . 'x' . $size['height'] . $productImageName;
138
- if (!file_exists($imageResized)) {
139
- $imageObj = new Varien_Image(Mage::getBaseDir('media') . '/catalog/product' . $productImageName);
140
- $imageObj->resize($size['width'], $size['height']);
141
- $imageObj->save($imageResized);
142
- }
143
- } else {
144
- return false;
145
- }
146
- return $imageResized;
147
- }
148
-
149
- /**
150
- * @param $string
151
- * @return array|bool
152
- */
153
-
154
- protected function _parseSize($string)
155
- {
156
- $size = explode('x', strtolower($string));
157
- if (sizeof($size) == 2) {
158
- return array(
159
- 'width' => ($size[0] > 0) ? $size[0] : null,
160
- 'height' => ($size[1] > 0) ? $size[1] : null,
161
- );
162
- }
163
- return false;
164
- }
165
-
166
- /**
167
- * @return bool
168
- */
169
-
170
- /**
171
- * @return bool|mixed
172
- */
173
- public function checkRemovedItem()
174
- {
175
- $session = Mage::getSingleton('core/session', array('name' => 'frontend'));
176
- if ($session->hasData(self::REMOVED_CART_ITEM_SKU_VARIABLE)) {
177
- $removedItems = $session->getData(self::REMOVED_CART_ITEM_SKU_VARIABLE);
178
- $session->unsetData(self::REMOVED_CART_ITEM_SKU_VARIABLE);
179
- return $removedItems;
180
- }
181
- return false;
182
- }
183
-
184
-
185
-
186
- public function returnGoogleAttributes() {
187
- $result=array();
188
- if ($googleAnalitics = Mage::getStoreConfig('checkout/rejoiner_acr/google_attributes')) {
189
- foreach (unserialize($googleAnalitics) as $attr) {
190
- if ($attr['attr_name'] && $attr['value']) {
191
- $result[$attr['attr_name']] = $attr['value'];
192
- }
193
- }
194
- }
195
- return $result;
196
- }
197
-
198
- public function returnCustomAttributes() {
199
- $result=array();
200
- if ($customAttr = Mage::getStoreConfig('checkout/rejoiner_acr/custom_attributes')) {
201
- foreach (unserialize($customAttr) as $attr) {
202
- if ($attr['attr_name'] && $attr['value']) {
203
- $result[$attr['attr_name']] = $attr['value'];
204
- }
205
- }
206
- }
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) {
214
- if (isset($categoriesArray[$catId])) {
215
- $result[] = $categoriesArray[$catId]->getName();
216
- }
217
- }
218
- return implode(' ', $result);
219
- }
220
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/Model/Api/Client.php DELETED
File without changes
app/code/community/Rejoiner/Acr/Model/Notification.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
-
3
- class Rejoiner_Acr_Model_Notification
4
- {
5
- protected static $_flagCode = 'admin_notification_rejoiner';
6
- protected static $_flagModel = null;
7
-
8
- /**
9
- * Return core flag model
10
- *
11
- * @return Mage_Core_Model_Flag
12
- */
13
- protected static function _getFlagModel()
14
- {
15
- if (self::$_flagModel === null) {
16
- self::$_flagModel = Mage::getModel('core/flag', array('flag_code' => self::$_flagCode))->loadSelf();
17
- }
18
- return self::$_flagModel;
19
- }
20
-
21
- /**
22
- * Check if notification was viewed
23
- *
24
- * @return boolean
25
- */
26
- public static function isNotificationViewed()
27
- {
28
- $flagData = self::_getFlagModel()->getFlagData();
29
- if (isset($flagData['notification_viewed']) && $flagData['notification_viewed'] == 1) {
30
- return true;
31
- }
32
- return false;
33
- }
34
-
35
- /**
36
- * Save notification viewed flag in core flag
37
- *
38
- * @param boolean $viewed
39
- */
40
- public static function saveNotificationViewed()
41
- {
42
- self::_getFlagModel()->setFlagData(array('notification_viewed' => true))->save();
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/Model/Observer.php DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
- class Rejoiner_Acr_Model_Observer
3
- {
4
- const REJOINER_API_URL = 'https://app.rejoiner.com';
5
- const REJOINER_API_REQUEST_PATH = '/api/1.0/site/%s/lead/convert';
6
- const REJOINER_API_LOG_FILE = 'rejoiner_api.log';
7
-
8
- const XML_PATH_REJOINER_API_KEY = 'checkout/rejoiner_acr/api_key';
9
- const XML_PATH_REJOINER_API_SECRET = 'checkout/rejoiner_acr/api_secret';
10
- const XML_PATH_REJOINER_API_SITE_ID = 'checkout/rejoiner_acr/site_id';
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);
32
- $client->setRawData($requestBody);
33
- $client->setHeaders(array('Authorization' => $authorization, 'Content-type' => 'application/json;' ));
34
- try{
35
- $response = $client->request(Varien_Http_Client::POST);
36
- switch ($response->getStatus()) {
37
- case '200':
38
- Mage::log(print_r($response->getStatus(), true) . ' Everything is alright.', null, self::REJOINER_API_LOG_FILE);
39
- break;
40
- case '400':
41
- Mage::log(print_r($response->getStatus(), true) . ' required params were not specified and/or the body was malformed', null, self::REJOINER_API_LOG_FILE);
42
- break;
43
- case '403':
44
- Mage::log(print_r($response->getStatus(), true) . ' failed authentication and/or incorrect signature', null, self::REJOINER_API_LOG_FILE);
45
- break;
46
- case '500':
47
- Mage::log(print_r($response->getStatus(), true) . ' internal error, contact us for details', null, self::REJOINER_API_LOG_FILE);
48
- break;
49
- default:
50
- Mage::log(print_r($response->getStatus(), true) . ' unexpected response code', null, self::REJOINER_API_LOG_FILE);
51
- break;
52
- }
53
- } catch (Exception $e) {
54
- Mage::log($e->getMessage(), null, 'exception.log');
55
- }
56
- }
57
- }
58
-
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/Model/Resource/Setup.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Rejoiner_Acr_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Eav_Mysql4_Setup
4
- {
5
- }
6
-
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/Model/System/Config/Source/Salesrule.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
- class Rejoiner_Acr_Model_System_Config_Source_Salesrule {
4
-
5
- public function toOptionArray()
6
- {
7
- $options = array();
8
- $additional= array(
9
- 'value' => 'rule_id',
10
- 'label' => 'name'
11
- );
12
- $collection = Mage::getResourceModel('salesrule/rule_collection')->loadData();
13
- foreach ($collection as $item) {
14
- if ($item->getUseAutoGeneration()) {
15
- $data = array();
16
- foreach ($additional as $code => $field) {
17
- $data[$code] = $item->getData($field);
18
- }
19
- $options[] = $data;
20
- }
21
-
22
- }
23
- array_unshift($options, array('value'=>'', 'label'=> Mage::helper('adminhtml')->__('--Please Select--')));
24
-
25
- return $options;
26
- }
27
-
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/controllers/AddbyskuController.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
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()) {
24
- continue;
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']);
34
- $successMessage .= $this->__('%s was added to your shopping cart.'.'</br>', Mage::helper('core')->escapeHtml($productBySKU->getName()));
35
- }
36
- unset($params[$key]);
37
- } catch (Exception $e) {
38
- if(Mage::getStoreConfig(self::XML_PATH_REJOINER_DEBUG_ENABLED)) {
39
- Mage::log($e->getMessage(), null, 'rejoiner.log');
40
- }
41
- }
42
- }
43
- }
44
- }
45
- if ($params['coupon_code']) {
46
- $quote->setCouponCode($params['coupon_code'])->collectTotals()->save();;
47
- }
48
- try {
49
- $quote->save();
50
- } catch (Exception $e) {
51
- if(Mage::getStoreConfig(self::XML_PATH_REJOINER_DEBUG_ENABLED)) {
52
- Mage::log($e->getMessage(), null, 'rejoiner.log');
53
- }
54
- }
55
- Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
56
- if($successMessage) {
57
- Mage::getSingleton('core/session')->addSuccess($successMessage);
58
- }
59
- $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart/'));
60
- }
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/controllers/AddtocartController.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
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']);
14
- if (!$prodModel->getId()) {
15
- continue;
16
- }
17
- try {
18
- $cart->addProduct($prodModel, $product);
19
- unset($params[$key]);
20
- } catch (Exception $e) {
21
- Mage::log($e->getMessage(), null, 'rejoiner.log');
22
- }
23
- }
24
- }
25
- if ($params['coupon_code']) {
26
- $cart->getQuote()->setCouponCode($params['coupon_code'])->collectTotals()->save();;
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 DELETED
@@ -1,22 +0,0 @@
1
- <?php
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)) {
8
- Rejoiner_Acr_Model_Notification::saveNotificationViewed();
9
- }
10
- $this->getResponse()->setBody(Zend_Json::encode(array('deny_notification_saved' => 1)));
11
- }
12
-
13
- /**
14
- * Check if user has enough privileges
15
- *
16
- * @return boolean
17
- */
18
- protected function _isAllowed()
19
- {
20
- return Mage::getSingleton('admin/session')->isAllowed('all');
21
- }
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/etc/config.xml DELETED
@@ -1,106 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Rejoiner_Acr>
5
- <version>1.1.23</version>
6
- </Rejoiner_Acr>
7
- </modules>
8
- <global>
9
- <blocks>
10
- <rejoiner_acr>
11
- <class>Rejoiner_Acr_Block</class>
12
- </rejoiner_acr>
13
- </blocks>
14
- <helpers>
15
- <rejoiner_acr>
16
- <class>Rejoiner_Acr_Helper</class>
17
- </rejoiner_acr>
18
- </helpers>
19
- <models>
20
- <rejoiner_acr>
21
- <class>Rejoiner_Acr_Model</class>
22
- </rejoiner_acr>
23
- </models>
24
- <resources>
25
- <rejoiner_setup>
26
- <setup>
27
- <module>Rejoiner_Acr</module>
28
- <class>Rejoiner_Acr_Model_Resource_Setup</class>
29
- </setup>
30
- </rejoiner_setup>
31
- </resources>
32
- </global>
33
- <frontend>
34
- <routers>
35
- <rejoiner>
36
- <use>standard</use>
37
- <args>
38
- <module>Rejoiner_Acr</module>
39
- <frontName>rejoiner</frontName>
40
- </args>
41
- </rejoiner>
42
- </routers>
43
- <layout>
44
- <updates>
45
- <rejoiner_acr>
46
- <file>rejoiner_acr.xml</file>
47
- </rejoiner_acr>
48
- </updates>
49
- </layout>
50
- <events>
51
- <checkout_onepage_controller_success_action>
52
- <observers>
53
- <rejoiner_order_success>
54
- <class>rejoiner_acr/observer</class>
55
- <method>trackOrderSuccessConversion</method>
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>
70
- <routers>
71
- <adminhtml>
72
- <args>
73
- <modules>
74
- <rejoiner_acr before="Mage_Adminhtml">Rejoiner_Acr_Adminhtml</rejoiner_acr>
75
- </modules>
76
- </args>
77
- </adminhtml>
78
- </routers>
79
- </admin>
80
- <adminhtml>
81
- <translate>
82
- <modules>
83
- <Rejoiner_Acr>
84
- <files>
85
- <default>Rejoiner_Acr.csv</default>
86
- </files>
87
- </Rejoiner_Acr>
88
- </modules>
89
- </translate>
90
- <layout>
91
- <updates>
92
- <rejoiner_acr>
93
- <file>rejoiner_acr.xml</file>
94
- </rejoiner_acr>
95
- </updates>
96
- </layout>
97
- </adminhtml>
98
- <default>
99
- <checkout>
100
- <rejoiner_acr>
101
- <email>0</email>
102
- <debug_enabled>1</debug_enabled>
103
- </rejoiner_acr>
104
- </checkout>
105
- </default>
106
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/etc/system.xml DELETED
@@ -1,149 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <sections>
4
- <checkout>
5
- <groups>
6
- <rejoiner_acr translate="label" module="rejoiner_acr">
7
- <label>eCommerce Lifecycle Email by Rejoiner</label>
8
- <frontend_type>text</frontend_type>
9
- <sort_order>100</sort_order>
10
- <show_in_default>1</show_in_default>
11
- <show_in_website>1</show_in_website>
12
- <show_in_store>1</show_in_store>
13
- <fields>
14
- <enabled translate="label">
15
- <label>Enabled</label>
16
- <frontend_type>select</frontend_type>
17
- <source_model>adminhtml/system_config_source_yesno</source_model>
18
- <sort_order>10</sort_order>
19
- <show_in_default>1</show_in_default>
20
- <show_in_website>1</show_in_website>
21
- <show_in_store>1</show_in_store>
22
- </enabled>
23
- <site_id translate="label">
24
- <label>Rejoiner Site ID</label>
25
- <frontend_type>text</frontend_type>
26
- <sort_order>20</sort_order>
27
- <show_in_default>1</show_in_default>
28
- <show_in_website>1</show_in_website>
29
- <show_in_store>1</show_in_store>
30
- </site_id>
31
- <api_key translate="label">
32
- <label>Rejoiner API key</label>
33
- <frontend_type>text</frontend_type>
34
- <sort_order>30</sort_order>
35
- <show_in_default>1</show_in_default>
36
- <show_in_website>1</show_in_website>
37
- <show_in_store>1</show_in_store>
38
- </api_key>
39
- <api_secret translate="label">
40
- <label>Rejoiner API secret</label>
41
- <frontend_type>text</frontend_type>
42
- <sort_order>40</sort_order>
43
- <show_in_default>1</show_in_default>
44
- <show_in_website>1</show_in_website>
45
- <show_in_store>1</show_in_store>
46
- </api_secret>
47
- <domain translate="label">
48
- <label>Store Domain *</label>
49
- <!--<comment>Required field</comment>-->
50
- <validate>required-entry</validate>
51
- <frontend_type>text</frontend_type>
52
- <sort_order>50</sort_order>
53
- <show_in_default>1</show_in_default>
54
- <show_in_website>1</show_in_website>
55
- <show_in_store>1</show_in_store>
56
- </domain>
57
- <track_numbers>
58
- <label>Track Phone Numbers</label>
59
- <frontend_type>select</frontend_type>
60
- <comment>Enable this parameter if you want to track phone numbers.</comment>
61
- <source_model>adminhtml/system_config_source_yesno</source_model>
62
- <sort_order>70</sort_order>
63
- <show_in_default>1</show_in_default>
64
- <show_in_website>1</show_in_website>
65
- <show_in_store>1</show_in_store>
66
- </track_numbers>
67
- <price_with_tax>
68
- <label>Track Prices with Taxes</label>
69
- <frontend_type>select</frontend_type>
70
- <comment>Enable this parameter if you want to track price with taxes.</comment>
71
- <source_model>adminhtml/system_config_source_yesno</source_model>
72
- <sort_order>75</sort_order>
73
- <show_in_default>1</show_in_default>
74
- <show_in_website>1</show_in_website>
75
- <show_in_store>1</show_in_store>
76
- </price_with_tax>
77
- <persist_forms>
78
- <label>Persist Forms</label>
79
- <frontend_type>select</frontend_type>
80
- <comment>If a user returns to the cart, the form fields will repopulate with the data they previously entered (excludes credit card numbers).</comment>
81
- <source_model>adminhtml/system_config_source_yesno</source_model>
82
- <sort_order>80</sort_order>
83
- <show_in_default>1</show_in_default>
84
- <show_in_website>1</show_in_website>
85
- <show_in_store>1</show_in_store>
86
- </persist_forms>
87
- <coupon_code translate="label">
88
- <label>Generate Coupon Code</label>
89
- <frontend_type>select</frontend_type>
90
- <source_model>adminhtml/system_config_source_yesno</source_model>
91
- <sort_order>90</sort_order>
92
- <show_in_default>1</show_in_default>
93
- <show_in_website>1</show_in_website>
94
- <show_in_store>1</show_in_store>
95
- </coupon_code>
96
- <salesrule_model translate="label">
97
- <label>Select Shopping Cart Price Rule</label>
98
- <frontend_type>select</frontend_type>
99
- <source_model>rejoiner_acr/system_config_source_salesrule</source_model>
100
- <sort_order>100</sort_order>
101
- <show_in_default>1</show_in_default>
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
- <debug_enabled translate="label">
135
- <label>Debug Mode</label>
136
- <frontend_type>select</frontend_type>
137
- <comment>Enable this parameter if you want to enabled debug extension.</comment>
138
- <source_model>adminhtml/system_config_source_yesno</source_model>
139
- <sort_order>150</sort_order>
140
- <show_in_default>1</show_in_default>
141
- <show_in_website>1</show_in_website>
142
- <show_in_store>1</show_in_store>
143
- </debug_enabled>
144
- </fields>
145
- </rejoiner_acr>
146
- </groups>
147
- </checkout>
148
- </sections>
149
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Rejoiner/Acr/sql/rejoiner_setup/mysql4-install-1.0.0.0.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
- $installer->startSetup();
5
- $installer->endSetup();
 
 
 
 
 
app/code/community/Rejoiner/Acr/sql/rejoiner_setup/mysql4-upgrade-1.0.0.0-1.0.1.0.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
- $installer->startSetup();
5
-
6
- $installer->run("
7
- ALTER TABLE `{$installer->getTable('sales_flat_quote')}`
8
- ADD `promo` VARCHAR(255) NULL;
9
- ");
10
-
11
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/layout/rejoiner_acr.xml DELETED
@@ -1,11 +0,0 @@
1
- <?xml version="1.0"?>
2
-
3
- <layout version="0.1.0">
4
-
5
- <default>
6
- <reference name="notifications">
7
- <block type="rejoiner_acr/adminhtml_notification" name="notification_rejoiner" template="rejoiner_acr/notification.phtml"></block>
8
- </reference>
9
- </default>
10
-
11
- </layout>
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/rejoiner_acr/notification.phtml DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- /**
3
- * @see Rejoiner_Acr_Block_Adminhtml_Notification
4
- */
5
- ?>
6
- <?php if ($this->canShow()): ?>
7
- <?php $secure = Mage::helper('rejoiner_acr')->checkHttps(); ?>
8
- <script type="text/javascript">
9
- function denyRejoinerNotification() {
10
- new Ajax.Request('<?php echo $this->getUrl('*/rejoiner/denyNotification', array('_current' => true, '_secure' => $secure)); ?>', {
11
- method: 'post',
12
- onComplete: function(transport) {
13
- if (200 == transport.status) {
14
- if ($('rejoiner_notification'))
15
- $('rejoiner_notification').remove();
16
- }
17
- }
18
- });
19
- }
20
- </script>
21
- <div id="rejoiner_notification" class="notification-global notification-global-notice">
22
- <strong>Rejoiner:</strong> <?php echo $this->helper('rejoiner_acr')->__('It looks like your checkout configuration has been modified by another extension. This is not always an issue, but please email') ?> <a href="mailto:support@rejoiner.com" >support@rejoiner.com</a><?php echo $this->helper('rejoiner_acr')->__(' to verify that your Rejoiner tags are injecting properly') ?>. <a href="#" onclick="denyRejoinerNotification(); return false;"><?php echo $this->helper('rejoiner_acr')->__('Never show this message again') ?></a>
23
- </div>
24
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/rejoiner_acr.xml DELETED
@@ -1,88 +0,0 @@
1
- <?xml version="1.0"?>
2
-
3
- <layout version="0.1.0">
4
-
5
- <rejoiner_acr_tracking>
6
- <reference name="head">
7
- <block type="rejoiner_acr/snippets" name="rejoiner_tracking" before="-">
8
- <action method="setTemplate" ifconfig="checkout/rejoiner_acr/enabled"><template>rejoiner_acr/tracking.phtml</template></action>
9
- </block>
10
- </reference>
11
- </rejoiner_acr_tracking>
12
-
13
- <rejoiner_acr_conversion>
14
- <reference name="head">
15
- <block type="rejoiner_acr/snippets" name="rejoiner_tracking" before="-">
16
- <action method="setTemplate" ifconfig="checkout/rejoiner_acr/enabled"><template>rejoiner_acr/conversion.phtml</template></action>
17
- </block>
18
- </reference>
19
- </rejoiner_acr_conversion>
20
-
21
- <checkout_cart_index>
22
- <reference name="rejoiner_tracking">
23
- <block type="core/template" template="rejoiner_acr/email.phtml" name="rejoiner_email"/>
24
- </reference>
25
- <update handle="rejoiner_acr_tracking"/>
26
- </checkout_cart_index>
27
-
28
- <checkout_onepage_index>
29
- <update handle="rejoiner_acr_tracking"/>
30
- </checkout_onepage_index>
31
-
32
- <onestepcheckout_index_index>
33
- <update handle="rejoiner_acr_tracking"/>
34
- </onestepcheckout_index_index>
35
-
36
- <checkout_multishipping_addresses>
37
- <update handle="rejoiner_acr_tracking"/>
38
- </checkout_multishipping_addresses>
39
-
40
- <gomage_checkout_onepage_index>
41
- <update handle="rejoiner_acr_tracking"/>
42
- </gomage_checkout_onepage_index>
43
-
44
- <checkout_onepage_success>
45
- <update handle="rejoiner_acr_conversion"/>
46
- </checkout_onepage_success>
47
-
48
- <checkout_multishipping_success>
49
- <update handle="rejoiner_acr_conversion"/>
50
- </checkout_multishipping_success>
51
-
52
- <aitcheckout_checkout_default>
53
- <update handle="rejoiner_acr_tracking"/>
54
- </aitcheckout_checkout_default>
55
-
56
- <aitcheckout_checkout_index>
57
- <update handle="rejoiner_acr_tracking"/>
58
- </aitcheckout_checkout_index>
59
-
60
- <firecheckout_index_index>
61
- <update handle="rejoiner_acr_tracking"/>
62
- </firecheckout_index_index>
63
-
64
- <firecheckout_index_updatecheckout>
65
- <update handle="rejoiner_acr_tracking"/>
66
- </firecheckout_index_updatecheckout>
67
-
68
- <firecheckout_index_saveorder>
69
- <update handle="rejoiner_acr_tracking"/>
70
- </firecheckout_index_saveorder>
71
-
72
- <onepagecheckout_index_success>
73
- <update handle="rejoiner_acr_tracking"/>
74
- </onepagecheckout_index_success>
75
-
76
- <onepagecheckout_index_updatecheckout>
77
- <update handle="rejoiner_acr_tracking"/>
78
- </onepagecheckout_index_updatecheckout>
79
-
80
- <opc_index_index>
81
- <update handle="rejoiner_acr_tracking"/>
82
- </opc_index_index>
83
-
84
- <checkout_prime_index>
85
- <update handle="rejoiner_acr_tracking"/>
86
- </checkout_prime_index>
87
-
88
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/rejoiner_acr/conversion.phtml DELETED
@@ -1,18 +0,0 @@
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() {
13
- var s = document.createElement('script'); s.type = 'text/javascript';
14
- s.async = true; s.src = 'https://s3.amazonaws.com/rejoiner/js/v3/t.js';
15
- var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
16
- })();
17
- </script>
18
- <!-- End Rejoiner Conversion -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/rejoiner_acr/email.phtml DELETED
@@ -1,6 +0,0 @@
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 DELETED
@@ -1,49 +0,0 @@
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
- //]]>
38
- </script>
39
-
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
- //]]>
49
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/Rejoiner_Acr.xml DELETED
@@ -1,12 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Rejoiner_Acr>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- <depends>
8
- <Mage_Checkout />
9
- </depends>
10
- </Rejoiner_Acr>
11
- </modules>
12
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
app/locale/en_US/Rejoiner_Acr.csv DELETED
@@ -1,10 +0,0 @@
1
- "Rejoiner Abandoned Cart Recovery","Rejoiner Abandoned Cart Recovery"
2
- "Rejoiner site-id","Rejoiner site-id"
3
- "Rejoiner API key","Rejoiner API key"
4
- "Rejoiner API secret","Rejoiner API secret"
5
- "It looks like your checkout configuration has been modified by another extension. This is not always an issue, but please email","It looks like your checkout configuration has been modified by another extension. This is not always an issue, but please email"
6
- "to verify that your Rejoiner tags are injecting properly", "to verify that your Rejoiner tags are injecting properly"
7
- "Never show this message again", "Never show this message again"
8
- "Remove this notification","Remove this notification"
9
- "Generate Coupon Code","Generate Coupon Code"
10
- "Select Shopping Cart Price Rule","Select Shopping Cart Price Rule"
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,18 @@
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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Rejoiner</name>
4
+ <version>1.2.0</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>Migrated to updated JS lib v4</notes>
12
+ <authors><author><name>Mike</name><user>rejoiner</user><email>mike@rejoiner.com</email></author></authors>
13
+ <date>2016-09-21</date>
14
+ <time>10:21:18</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Rejoiner_Acr.xml" hash=""/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="rejoiner_acr.xml" hash=""/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="rejoiner_acr.xml" hash=""/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Rejoiner_Acr.csv" hash=""/></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
18
  </package>