Rejoiner - Version 1.1.16

Version Notes

Added automatic application of a coupon via query string parameter.
Added automatic addition of cart item to cart via query string parameter.

Download this release

Release Info

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


Code changes from version 1.1.15 to 1.1.16

app/code/community/Rejoiner/Acr/Helper/Data.php CHANGED
@@ -14,7 +14,7 @@ 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
- 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;
@@ -70,9 +70,9 @@ class Rejoiner_Acr_Helper_Data extends Mage_Core_Helper_Abstract
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();
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;
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();
app/code/community/Rejoiner/Acr/controllers/AddbyskuController.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
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
+ $productBySKU = Mage::getModel('catalog/product')->loadByAttribute('sku', $product['sku']);
20
+ $productId = $productBySKU->getId();
21
+ if ($productId) {
22
+ $qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId)->getQty();
23
+ try {
24
+ if(!$quote->hasProductId($productId) && is_numeric($product['qty']) && $qty > $product['qty']) {
25
+ $quote->addProduct($productBySKU, (int)$product['qty']);
26
+ $successMessage .= $this->__('%s was added to your shopping cart.'.'</br>', Mage::helper('core')->escapeHtml($productBySKU->getName()));
27
+ }
28
+ unset($params[$key]);
29
+ } catch (Exception $e) {
30
+ if(Mage::getStoreConfig(self::XML_PATH_REJOINER_DEBUG_ENABLED)) {
31
+ Mage::log($e->getMessage(), null, 'rejoiner.log');
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
37
+ if ($params['coupon_code']) {
38
+ Mage::getSingleton('checkout/cart')->getQuote()->setCouponCode($params['coupon_code'])->collectTotals()->save();;
39
+ }
40
+ try {
41
+ $quote->save();
42
+ } catch (Exception $e) {
43
+ if(Mage::getStoreConfig(self::XML_PATH_REJOINER_DEBUG_ENABLED)) {
44
+ Mage::log($e->getMessage(), null, 'rejoiner.log');
45
+ }
46
+ }
47
+ Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
48
+ if($successMessage) {
49
+ Mage::getSingleton('core/session')->addSuccess($successMessage);
50
+ }
51
+ $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart/'));
52
+ }
53
+
54
+ }
app/code/community/Rejoiner/Acr/controllers/AddtocartController.php CHANGED
@@ -1,11 +1,5 @@
1
  <?php
2
- /**
3
- * Created by JetBrains PhpStorm.
4
- * User: pavel
5
- * Date: 5/16/13
6
- * Time: 12:32 PM
7
- * To change this template use File | Settings | File Templates.
8
- */
9
  class Rejoiner_Acr_AddtocartController extends Mage_Core_Controller_Front_Action
10
  {
11
 
1
  <?php
2
+
 
 
 
 
 
 
3
  class Rejoiner_Acr_AddtocartController extends Mage_Core_Controller_Front_Action
4
  {
5
 
app/code/community/Rejoiner/Acr/etc/config.xml CHANGED
@@ -99,6 +99,7 @@
99
  <checkout>
100
  <rejoiner_acr>
101
  <email>0</email>
 
102
  </rejoiner_acr>
103
  </checkout>
104
  </default>
99
  <checkout>
100
  <rejoiner_acr>
101
  <email>0</email>
102
+ <debug_enabled>1</debug_enabled>
103
  </rejoiner_acr>
104
  </checkout>
105
  </default>
app/code/community/Rejoiner/Acr/etc/system.xml CHANGED
@@ -131,6 +131,16 @@
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>
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>Debig 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>
package.xml CHANGED
@@ -1,18 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Rejoiner</name>
4
- <version>1.1.15</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>Escaped single and double quotes in setCurrentItem parameters</notes>
 
12
  <authors><author><name>Mike</name><user>auto-converted</user><email>mike@rejoiner.com</email></author></authors>
13
- <date>2015-08-05</date>
14
- <time>14:15:50</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><file name="Notification.php" hash="4b4837b59ab85fa886e65be49d511490"/><dir name="Preinstalled"><file name="Form.php" hash="04f5b18db325c2e630c103779c704ebe"/></dir></dir><file name="Snippets.php" hash="36ccef9416a0d7b3768341fff28750ec"/></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="606c4d1b60559d857a9dbdf7db887057"/><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="538d7561470c2cc1c7f822e7fe1ffef8"/></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><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.1.16</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 automatic application of a coupon via query string parameter.&#xD;
12
+ Added automatic addition of cart item to cart via query string parameter.</notes>
13
  <authors><author><name>Mike</name><user>auto-converted</user><email>mike@rejoiner.com</email></author></authors>
14
+ <date>2015-10-13</date>
15
+ <time>12:12:04</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="36ccef9416a0d7b3768341fff28750ec"/></dir><dir name="Helper"><file name="Data.php" hash="1533241a5b0dd30b987464a719c0c25a"/></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="AddbyskuController.php" hash="7f258b4e6b5cb541913d9de5d374b44f"/><file name="AddtocartController.php" hash="c578297cdb4ef281aff17f33b27d6162"/><dir name="Adminhtml"><file name="RejoinerController.php" hash="c2e5fea12a2fc23905d86f119c2baa39"/></dir></dir><dir name="etc"><file name="config.xml" hash="1ab8698bb8cea86c3f129dcfcea6da39"/><file name="system.xml" hash="d2648094f032c9994a1054598be51655"/></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="538d7561470c2cc1c7f822e7fe1ffef8"/></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>
17
  <compatible/>
18
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
19
  </package>