DigitalPianism_Abandonedcarts - Version 1.0.2

Version Notes

- Fix a bug where the admin URL would be used when notifying from the backend
- Fix a bug where admin users store would not remain on a multistore install

Download this release

Release Info

Developer Digital Pianism
Extension DigitalPianism_Abandonedcarts
Version 1.0.2
Comparing to
See all releases


Code changes from version 1.0.1 to 1.0.2

app/code/community/DigitalPianism/Abandonedcarts/Block/Adminhtml/Abandonedcarts.php CHANGED
@@ -17,7 +17,7 @@ class DigitalPianism_Abandonedcarts_Block_Adminhtml_Abandonedcarts extends Mage_
17
  $this->_removeButton('add');
18
  $this->_addButton('notify', array(
19
  'label' => Mage::helper('abandonedcarts')->__('Send notifications'),
20
- 'onclick' => "setLocation('".$this->getUrl('*/*/notifyAll')."')",
21
  ));
22
  $this->setTemplate('digitalpianism/abandonedcarts/list.phtml');
23
  }
17
  $this->_removeButton('add');
18
  $this->_addButton('notify', array(
19
  'label' => Mage::helper('abandonedcarts')->__('Send notifications'),
20
+ 'onclick' => "setLocation('".$this->getUrl('*/*/notifyAll', array('store' => $this->getRequest()->getParam('store', 0)))."')",
21
  ));
22
  $this->setTemplate('digitalpianism/abandonedcarts/list.phtml');
23
  }
app/code/community/DigitalPianism/Abandonedcarts/Block/Adminhtml/Abandonedcarts/Grid.php CHANGED
@@ -139,7 +139,7 @@ class DigitalPianism_Abandonedcarts_Block_Adminhtml_Abandonedcarts_Grid extends
139
 
140
  $this->getMassactionBlock()->addItem('notify', array(
141
  'label' => Mage::helper('abandonedcarts')->__('Send notification'),
142
- 'url' => $this->getUrl('*/*/notify')
143
  ));
144
 
145
  return $this;
@@ -171,7 +171,7 @@ class DigitalPianism_Abandonedcarts_Block_Adminhtml_Abandonedcarts_Grid extends
171
  */
172
  public function getGridUrl()
173
  {
174
- return $this->getUrl('*/*/grid', array('current' => true));
175
  }
176
 
177
  /**
139
 
140
  $this->getMassactionBlock()->addItem('notify', array(
141
  'label' => Mage::helper('abandonedcarts')->__('Send notification'),
142
+ 'url' => $this->getUrl('*/*/notify', array('store' => $this->getRequest()->getParam('store', 0)))
143
  ));
144
 
145
  return $this;
171
  */
172
  public function getGridUrl()
173
  {
174
+ return $this->getUrl('*/*/grid', array('current' => true, 'store' => $this->getRequest()->getParam('store', 0)));
175
  }
176
 
177
  /**
app/code/community/DigitalPianism/Abandonedcarts/Block/Adminhtml/Saleabandonedcarts.php CHANGED
@@ -17,7 +17,7 @@ class DigitalPianism_Abandonedcarts_Block_Adminhtml_Saleabandonedcarts extends M
17
  $this->_removeButton('add');
18
  $this->_addButton('notify', array(
19
  'label' => Mage::helper('abandonedcarts')->__('Send notifications'),
20
- 'onclick' => "setLocation('".$this->getUrl('*/*/notifySaleAll')."')",
21
  ));
22
  $this->setTemplate('digitalpianism/abandonedcarts/list.phtml');
23
  }
17
  $this->_removeButton('add');
18
  $this->_addButton('notify', array(
19
  'label' => Mage::helper('abandonedcarts')->__('Send notifications'),
20
+ 'onclick' => "setLocation('".$this->getUrl('*/*/notifySaleAll', array('store' => $this->getRequest()->getParam('store', 0)))."')",
21
  ));
22
  $this->setTemplate('digitalpianism/abandonedcarts/list.phtml');
23
  }
app/code/community/DigitalPianism/Abandonedcarts/Block/Adminhtml/Saleabandonedcarts/Grid.php CHANGED
@@ -148,7 +148,7 @@ class DigitalPianism_Abandonedcarts_Block_Adminhtml_Saleabandonedcarts_Grid exte
148
 
149
  $this->getMassactionBlock()->addItem('notifySale', array(
150
  'label' => Mage::helper('abandonedcarts')->__('Send notification'),
151
- 'url' => $this->getUrl('*/*/notifySale')
152
  ));
153
 
154
  return $this;
@@ -180,7 +180,7 @@ class DigitalPianism_Abandonedcarts_Block_Adminhtml_Saleabandonedcarts_Grid exte
180
  */
181
  public function getGridUrl()
182
  {
183
- return $this->getUrl('*/*/salegrid', array('current' => true));
184
  }
185
 
186
  /**
148
 
149
  $this->getMassactionBlock()->addItem('notifySale', array(
150
  'label' => Mage::helper('abandonedcarts')->__('Send notification'),
151
+ 'url' => $this->getUrl('*/*/notifySale', array('store' => $this->getRequest()->getParam('store', 0)))
152
  ));
153
 
154
  return $this;
180
  */
181
  public function getGridUrl()
182
  {
183
+ return $this->getUrl('*/*/salegrid', array('current' => true, 'store' => $this->getRequest()->getParam('store', 0)));
184
  }
185
 
186
  /**
app/code/community/DigitalPianism/Abandonedcarts/Model/Notifier.php CHANGED
@@ -152,9 +152,9 @@ class DigitalPianism_Abandonedcarts_Model_Notifier extends Mage_Core_Model_Abstr
152
  $token = "";
153
  // Autologin only applies to real customer (skip not logged in customer group)
154
  if (Mage::helper('abandonedcarts')->isAutologin()) {
155
- $token = $this->_generateToken($args['row']['customer_email']);
156
  }
157
- $emailTemplateVariables['link'] = $this->_generateUrl($token);
158
  } else {
159
  // We create some extra variables if there is several products in the cart
160
  $emailTemplateVariables = $this->_recipients[$args['row']['customer_email']]['emailTemplateVariables'];
@@ -233,9 +233,9 @@ class DigitalPianism_Abandonedcarts_Model_Notifier extends Mage_Core_Model_Abstr
233
  $token = "";
234
  // Autologin only applies to real customer (skip not logged in customer group)
235
  if (Mage::helper('abandonedcarts')->isAutologin()) {
236
- $token = $this->_generateToken($args['row']['customer_email']);
237
  }
238
- $emailTemplateVariables['link'] = $this->_generateUrl($token);
239
 
240
  // If one product before
241
  $emailTemplateVariables['discount'] = number_format(floatval($args['row']['product_price_in_cart']),2) - number_format(floatval($args['row']['product_special_price']),2);
@@ -590,19 +590,23 @@ class DigitalPianism_Abandonedcarts_Model_Notifier extends Mage_Core_Model_Abstr
590
  /**
591
  * @return mixed|string
592
  */
593
- protected function _generateUrl($token = "")
594
  {
595
  if (!Mage::helper('abandonedcarts')->isCampaignEnabled()) {
596
  return Mage::getUrl('abandonedcarts',
597
  array(
598
- '_query' => ($token ? "?token=" . $token : ''),
 
 
599
  '_secure' => true
600
  )
601
  );
602
  }
603
 
604
  return Mage::getUrl('abandonedcarts', array(
605
- '_query' => "?utm_source=" . self::CAMPAIGN_SOURCE . "&utm_medium=" . self::CAMPAIGN_MEDIUM . "&utm_campaign=" . Mage::helper('abandonedcarts')->getCampaignName() . ($token ? "&token=" . $token : ''),
 
 
606
  '_secure' => true
607
  )
608
  );
152
  $token = "";
153
  // Autologin only applies to real customer (skip not logged in customer group)
154
  if (Mage::helper('abandonedcarts')->isAutologin()) {
155
+ $token = urlencode($this->_generateToken($args['row']['customer_email']));
156
  }
157
+ $emailTemplateVariables['link'] = $this->_generateUrl($token, $this->_currentStoreId);
158
  } else {
159
  // We create some extra variables if there is several products in the cart
160
  $emailTemplateVariables = $this->_recipients[$args['row']['customer_email']]['emailTemplateVariables'];
233
  $token = "";
234
  // Autologin only applies to real customer (skip not logged in customer group)
235
  if (Mage::helper('abandonedcarts')->isAutologin()) {
236
+ $token = urlencode($this->_generateToken($args['row']['customer_email']));
237
  }
238
+ $emailTemplateVariables['link'] = $this->_generateUrl($token, $this->_currentStoreId);
239
 
240
  // If one product before
241
  $emailTemplateVariables['discount'] = number_format(floatval($args['row']['product_price_in_cart']),2) - number_format(floatval($args['row']['product_special_price']),2);
590
  /**
591
  * @return mixed|string
592
  */
593
+ protected function _generateUrl($token = "", $storeId = 0)
594
  {
595
  if (!Mage::helper('abandonedcarts')->isCampaignEnabled()) {
596
  return Mage::getUrl('abandonedcarts',
597
  array(
598
+ '_store' => $storeId,
599
+ '_nosid' => true,
600
+ '_query' => ($token ? "token=" . $token : ''),
601
  '_secure' => true
602
  )
603
  );
604
  }
605
 
606
  return Mage::getUrl('abandonedcarts', array(
607
+ '_store' => $storeId,
608
+ '_nosid' => true,
609
+ '_query' => "utm_source=" . self::CAMPAIGN_SOURCE . "&utm_medium=" . self::CAMPAIGN_MEDIUM . "&utm_campaign=" . Mage::helper('abandonedcarts')->getCampaignName() . ($token ? "&token=" . $token : ''),
610
  '_secure' => true
611
  )
612
  );
app/code/community/DigitalPianism/Abandonedcarts/etc/config.xml CHANGED
@@ -4,7 +4,7 @@
4
 
5
  <modules>
6
  <DigitalPianism_Abandonedcarts>
7
- <version>1.0.1</version>
8
  </DigitalPianism_Abandonedcarts>
9
  </modules>
10
 
4
 
5
  <modules>
6
  <DigitalPianism_Abandonedcarts>
7
+ <version>1.0.2</version>
8
  </DigitalPianism_Abandonedcarts>
9
  </modules>
10
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>DigitalPianism_Abandonedcarts</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -95,11 +95,12 @@ Save the configuration.&#xD;
95
  &#xD;
96
  &lt;p&gt;To manually trigger the notification system, please access System &amp;gt; Configuration &amp;gt; Digital Pianism &amp;gt; Abandoned carts email and click on the "Send" button&lt;/p&gt;&#xD;
97
  &lt;p&gt;Please note that this functionality will send abandoned carts notification regardless the delay you provided, all possible abandoned carts emails will be sent.&lt;/p&gt;</description>
98
- <notes>- Fix a bug where the data script would never run</notes>
 
99
  <authors><author><name>Digital Pianism</name><user>digitalpianism</user><email>contact@digital-pianism.com</email></author></authors>
100
- <date>2016-07-14</date>
101
- <time>16:00:43</time>
102
- <contents><target name="magecommunity"><dir name="DigitalPianism"><dir name="Abandonedcarts"><dir name="Block"><dir name="Adminhtml"><dir name="Abandonedcarts"><file name="Grid.php" hash="f0d080d29b7d784004ef412ed5a337d6"/></dir><file name="Abandonedcarts.php" hash="3c8d3c5676cb3bda46a580566f35fd9d"/><dir name="Logs"><file name="Grid.php" hash="05c4ca332a6ad168e28e9a9128252231"/></dir><file name="Logs.php" hash="1173ec175c365fa5c01cbc72a98c0284"/><dir name="Saleabandonedcarts"><file name="Grid.php" hash="cc43378214837f8f9c7c7a66dc47adf4"/></dir><file name="Saleabandonedcarts.php" hash="da29b0f8262da3ec0b993816c5fc5be0"/></dir></dir><dir name="Helper"><file name="Data.php" hash="f7d07930e3276bb06e6209293f287dc3"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Observer.php" hash="d54b2bc70a87fca4f0c3bbb519b84c81"/></dir><file name="Collection.php" hash="3e19497dd2cd2170293136f8cff891dc"/><dir name="Link"><file name="Cleaner.php" hash="aced9e659252056b0f4747a78c6154c8"/></dir><file name="Link.php" hash="6f19c7976980e558d98589021d4d294f"/><file name="Log.php" hash="c9ce940c6a14cfa85c401183559661e4"/><file name="Notifier.php" hash="38c1fcb51994dc155ce62bbb38564526"/><dir name="Resource"><dir name="Link"><file name="Collection.php" hash="39ea2cfb265412d82b9fda822af6d324"/></dir><file name="Link.php" hash="49d00b249de30aefc978f4515f6dbdd7"/><dir name="Log"><file name="Collection.php" hash="54abd79af31a1a853bc08eeed75dc7d0"/></dir><file name="Log.php" hash="00edba4d934093236ac78b42f066ba73"/></dir><dir name="Sales"><dir name="Resource"><file name="Quote.php" hash="3b2f9f24a74a6ea3b6851d64bd6ae5ba"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AbandonedcartsController.php" hash="32a56a5033b64320879da37f8b2a88e8"/></dir><file name="IndexController.php" hash="5c06db338a20d3de9b19c3f606edbc9a"/></dir><dir name="data"><dir name="abandonedcarts_setup"><file name="data-upgrade-0.3.6-1.0.0.php" hash="a60f9bccf9e42a458f808bc697320bb0"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ce393eb00049f28ff92401be828cd613"/><file name="config.xml" hash="7876a45fd0530d3d3c495b3991457d1b"/><file name="system.xml" hash="e6a53269f6223eb246c2495600eb307d"/></dir><dir name="sql"><dir name="abandonedcarts_setup"><file name="install-0.0.1.php" hash="851338e4a710b5d94fead688b065f4b5"/><file name="upgrade-0.0.1-0.0.2.php" hash="0227c009e49b97bcf3f34f84c49f0927"/><file name="upgrade-0.3.6-1.0.0.php" hash="1ac772ef331c8a2278e2c8df77aeb799"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DigitalPianism_Abandonedcarts.xml" hash="8a7657855486c68d548db4ba48e083d2"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="digitalpianism"><dir name="abandonedcarts"><file name="list.phtml" hash="6af16de73f1b0a3c580e65a95642722f"/></dir></dir></dir><dir name="layout"><dir name="digitalpianism"><file name="abandonedcarts.xml" hash="2f4ec5178aed1c84213605b5212d676e"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="digitalpianism"><dir name="abandonedcarts"><dir name="email"><file name="items.phtml" hash="1938d5ee30752918b1be76be845b9214"/><file name="sale_items.phtml" hash="7dfce25f17ba19532e68592772bf63ad"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="digitalpianism"><dir name="abandonedcarts"><file name="sales_abandonedcarts.html" hash="a35bd61e1f172b37ac4ed317e1ad44e9"/><file name="sales_abandonedcarts_sale.html" hash="4f437deca852efeacfec0fb3ba929971"/></dir></dir></dir></dir><file name="DigitalPianism_Abandonedcarts.csv" hash="bd3ed00291684eac5149305ed829a824"/></dir><dir name="fr_FR"><dir name="template"><dir name="email"><dir name="digitalpianism"><dir name="abandonedcarts"><file name="sales_abandonedcarts.html" hash="3ec93757d563ed926090a394577f1dbd"/><file name="sales_abandonedcarts_sale.html" hash="3586968516c8e8374cfa913a3eea7995"/></dir></dir></dir></dir><file name="DigitalPianism_Abandonedcarts.csv" hash="2a9c63b4d83cb922b3060a4735dabe38"/></dir></target></contents>
103
  <compatible/>
104
  <dependencies><required><php><min>4.1.0</min><max>6.0.0</max></php></required></dependencies>
105
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>DigitalPianism_Abandonedcarts</name>
4
+ <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
95
  &#xD;
96
  &lt;p&gt;To manually trigger the notification system, please access System &amp;gt; Configuration &amp;gt; Digital Pianism &amp;gt; Abandoned carts email and click on the "Send" button&lt;/p&gt;&#xD;
97
  &lt;p&gt;Please note that this functionality will send abandoned carts notification regardless the delay you provided, all possible abandoned carts emails will be sent.&lt;/p&gt;</description>
98
+ <notes>- Fix a bug where the admin URL would be used when notifying from the backend&#xD;
99
+ - Fix a bug where admin users store would not remain on a multistore install</notes>
100
  <authors><author><name>Digital Pianism</name><user>digitalpianism</user><email>contact@digital-pianism.com</email></author></authors>
101
+ <date>2016-07-15</date>
102
+ <time>15:23:21</time>
103
+ <contents><target name="magecommunity"><dir name="DigitalPianism"><dir name="Abandonedcarts"><dir name="Block"><dir name="Adminhtml"><dir name="Abandonedcarts"><file name="Grid.php" hash="7e68586db67733350fae2cb2231edc8f"/></dir><file name="Abandonedcarts.php" hash="5ed2323b6a2ffd66d0738f8635c660e3"/><dir name="Logs"><file name="Grid.php" hash="05c4ca332a6ad168e28e9a9128252231"/></dir><file name="Logs.php" hash="1173ec175c365fa5c01cbc72a98c0284"/><dir name="Saleabandonedcarts"><file name="Grid.php" hash="808a965b09d2958f6340c8e51c2fe68c"/></dir><file name="Saleabandonedcarts.php" hash="b1195b3697ccc733c61a03cb7d9032b1"/></dir></dir><dir name="Helper"><file name="Data.php" hash="f7d07930e3276bb06e6209293f287dc3"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Observer.php" hash="d54b2bc70a87fca4f0c3bbb519b84c81"/></dir><file name="Collection.php" hash="3e19497dd2cd2170293136f8cff891dc"/><dir name="Link"><file name="Cleaner.php" hash="aced9e659252056b0f4747a78c6154c8"/></dir><file name="Link.php" hash="6f19c7976980e558d98589021d4d294f"/><file name="Log.php" hash="c9ce940c6a14cfa85c401183559661e4"/><file name="Notifier.php" hash="9eec0d81e83ffa591b8364e36ea61487"/><dir name="Resource"><dir name="Link"><file name="Collection.php" hash="39ea2cfb265412d82b9fda822af6d324"/></dir><file name="Link.php" hash="49d00b249de30aefc978f4515f6dbdd7"/><dir name="Log"><file name="Collection.php" hash="54abd79af31a1a853bc08eeed75dc7d0"/></dir><file name="Log.php" hash="00edba4d934093236ac78b42f066ba73"/></dir><dir name="Sales"><dir name="Resource"><file name="Quote.php" hash="3b2f9f24a74a6ea3b6851d64bd6ae5ba"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AbandonedcartsController.php" hash="32a56a5033b64320879da37f8b2a88e8"/></dir><file name="IndexController.php" hash="5c06db338a20d3de9b19c3f606edbc9a"/></dir><dir name="data"><dir name="abandonedcarts_setup"><file name="data-upgrade-0.3.6-1.0.0.php" hash="a60f9bccf9e42a458f808bc697320bb0"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ce393eb00049f28ff92401be828cd613"/><file name="config.xml" hash="a37c17748aa0e9b3118c9cf51393f12a"/><file name="system.xml" hash="e6a53269f6223eb246c2495600eb307d"/></dir><dir name="sql"><dir name="abandonedcarts_setup"><file name="install-0.0.1.php" hash="851338e4a710b5d94fead688b065f4b5"/><file name="upgrade-0.0.1-0.0.2.php" hash="0227c009e49b97bcf3f34f84c49f0927"/><file name="upgrade-0.3.6-1.0.0.php" hash="1ac772ef331c8a2278e2c8df77aeb799"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DigitalPianism_Abandonedcarts.xml" hash="8a7657855486c68d548db4ba48e083d2"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="digitalpianism"><dir name="abandonedcarts"><file name="list.phtml" hash="6af16de73f1b0a3c580e65a95642722f"/></dir></dir></dir><dir name="layout"><dir name="digitalpianism"><file name="abandonedcarts.xml" hash="2f4ec5178aed1c84213605b5212d676e"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="digitalpianism"><dir name="abandonedcarts"><dir name="email"><file name="items.phtml" hash="1938d5ee30752918b1be76be845b9214"/><file name="sale_items.phtml" hash="7dfce25f17ba19532e68592772bf63ad"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="digitalpianism"><dir name="abandonedcarts"><file name="sales_abandonedcarts.html" hash="a35bd61e1f172b37ac4ed317e1ad44e9"/><file name="sales_abandonedcarts_sale.html" hash="4f437deca852efeacfec0fb3ba929971"/></dir></dir></dir></dir><file name="DigitalPianism_Abandonedcarts.csv" hash="bd3ed00291684eac5149305ed829a824"/></dir><dir name="fr_FR"><dir name="template"><dir name="email"><dir name="digitalpianism"><dir name="abandonedcarts"><file name="sales_abandonedcarts.html" hash="3ec93757d563ed926090a394577f1dbd"/><file name="sales_abandonedcarts_sale.html" hash="3586968516c8e8374cfa913a3eea7995"/></dir></dir></dir></dir><file name="DigitalPianism_Abandonedcarts.csv" hash="2a9c63b4d83cb922b3060a4735dabe38"/></dir></target></contents>
104
  <compatible/>
105
  <dependencies><required><php><min>4.1.0</min><max>6.0.0</max></php></required></dependencies>
106
  </package>