Bonusbox_Bonusbox - Version 1.0.120

Version Notes

Loyalty programme for success pages

Download this release

Release Info

Developer Magento Core Team
Extension Bonusbox_Bonusbox
Version 1.0.120
Comparing to
See all releases


Code changes from version 1.0.117 to 1.0.120

app/code/community/Bonusbox/Bonusbox/Block/Checkout/Success.php CHANGED
@@ -6,22 +6,29 @@ class Bonusbox_Bonusbox_Block_Checkout_Success extends Mage_Core_Block_Template
6
  protected function _beforeToHtml()
7
  {
8
  parent::_beforeToHtml();
9
- if (Mage::helper('bonusbox/successpage')->isOperational())
10
- {
11
- $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
12
- if ($orderId)
13
  {
 
14
  $order = Mage::getModel('sales/order')->load($orderId);
15
  if ($order->getId())
16
  {
17
  $response = Mage::getModel('bonusbox/client')->requestSuccessPage($order);
18
  $this->setSuccessPageUrl($response['success_page']['url']);
19
  }
 
 
 
 
 
 
20
  }
21
  }
22
- else {
23
- Mage::log('Bonusbox Success Page is missing config data.');
 
24
  }
 
25
  }
26
 
27
 
6
  protected function _beforeToHtml()
7
  {
8
  parent::_beforeToHtml();
9
+ try {
10
+ if (Mage::helper('bonusbox/successpage')->isOperational())
 
 
11
  {
12
+ $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
13
  $order = Mage::getModel('sales/order')->load($orderId);
14
  if ($order->getId())
15
  {
16
  $response = Mage::getModel('bonusbox/client')->requestSuccessPage($order);
17
  $this->setSuccessPageUrl($response['success_page']['url']);
18
  }
19
+ else {
20
+ throw new Exception('No Order found for success page.');
21
+ }
22
+ }
23
+ else {
24
+ Mage::log('Bonusbox Success Page is missing config data.');
25
  }
26
  }
27
+ catch (Exception $ex)
28
+ {
29
+ Mage::helper('bonusbox')->log($ex);
30
  }
31
+
32
  }
33
 
34
 
app/code/community/Bonusbox/Bonusbox/Helper/Data.php CHANGED
@@ -17,14 +17,21 @@ class Bonusbox_Bonusbox_Helper_Data extends Mage_Core_Helper_Data
17
  }
18
 
19
 
 
 
 
 
 
 
20
  public function isOperational()
21
  {
22
  return $this->isEnabled() && $this->getKey('public') && $this->getKey('secret');
23
  }
 
24
 
25
  public function getKey($secret)
26
  {
27
- $mode = $this->getConfig('live_mode') ? 'live' : 'test';
28
  $type = $secret ? 'secret' : 'public';
29
  return $this->getConfig($mode . '_' . $type . '_key');
30
  }
@@ -32,7 +39,7 @@ class Bonusbox_Bonusbox_Helper_Data extends Mage_Core_Helper_Data
32
 
33
  public function log($message)
34
  {
35
- if ($this->getConfig('live_mode'))
36
  {
37
  Mage::log((string)$message);
38
  try {
@@ -57,7 +64,7 @@ class Bonusbox_Bonusbox_Helper_Data extends Mage_Core_Helper_Data
57
  }
58
  else {
59
  throw new Mage_Core_Exception($message);
60
- }
61
  }
62
  }
63
  }
17
  }
18
 
19
 
20
+ public function isLive()
21
+ {
22
+ return $this->getConfig('live');
23
+ }
24
+
25
+
26
  public function isOperational()
27
  {
28
  return $this->isEnabled() && $this->getKey('public') && $this->getKey('secret');
29
  }
30
+
31
 
32
  public function getKey($secret)
33
  {
34
+ $mode = $this->isLive() ? 'live' : 'test';
35
  $type = $secret ? 'secret' : 'public';
36
  return $this->getConfig($mode . '_' . $type . '_key');
37
  }
39
 
40
  public function log($message)
41
  {
42
+ if ($this->isLive())
43
  {
44
  Mage::log((string)$message);
45
  try {
64
  }
65
  else {
66
  throw new Mage_Core_Exception($message);
67
+ }
68
  }
69
  }
70
  }
app/code/community/Bonusbox/Bonusbox/controllers/TestController.php CHANGED
@@ -15,13 +15,10 @@ class Bonusbox_Bonusbox_TestController extends Mage_Checkout_OnepageController
15
  {
16
  $order = $this->getOrder();
17
  $session = $this->getOnepage()->getCheckout();
18
- // $session->setLastSuccessQuoteId(1);
19
- // $session->setLastQuoteId(1);
20
  $session->setLastOrderId($order->getId());
21
 
22
  $this->loadLayout();
23
  $this->getLayout()->getBlock('content')->append($this->getLayout()->createBlock('bonusbox/checkout_success'));
24
  $this->renderLayout();
25
- // $this->_redirect('checkout/onepage/success');
26
  }
27
  }
15
  {
16
  $order = $this->getOrder();
17
  $session = $this->getOnepage()->getCheckout();
 
 
18
  $session->setLastOrderId($order->getId());
19
 
20
  $this->loadLayout();
21
  $this->getLayout()->getBlock('content')->append($this->getLayout()->createBlock('bonusbox/checkout_success'));
22
  $this->renderLayout();
 
23
  }
24
  }
app/code/community/Bonusbox/Bonusbox/etc/config.xml CHANGED
@@ -49,9 +49,9 @@
49
 
50
  <layout>
51
  <updates>
52
- <swedishsnus>
53
  <file>bonusbox.xml</file>
54
- </swedishsnus>
55
  </updates>
56
  </layout>
57
  </frontend>
@@ -102,18 +102,17 @@
102
  <general>
103
  <enabled>0</enabled>
104
  <live>0</live>
105
-
 
 
 
106
  <url><![CDATA[https://api.bonusbox.me/]]></url>
107
  <accept_header><![CDATA[application/json,application/vnd.api;ver=1]]></accept_header>
108
- <debug_email><![CDATA[dittmar@vivomedia.de]]></debug_email>
109
  </general>
110
  <success_page>
111
- <new_user_text>Sichere dir %{{CREDITS:ACHIEVED}}% Bonusbox-Punkte und einen Gutschein für deinen nächsten Einkauf!
112
-
113
- %{{FACEBOOK:LOGIN}}%</new_user_text>
114
- <bonusbox_user_text>Du hast für deinen Einkauf %{{CREDITS:ACHIEVED}}% Punkte bekommen. Die fehlen noch %{{CREDITS:LEVELUP}}% um den naechsten %{{BADGE:LEVELUP}}% zu erreichen.
115
-
116
- %{{BONUSBOX:APP:[$caption=Hier geht es zu deinen Bonusbox Rabatten]}}%</bonusbox_user_text>
117
  </success_page>
118
  </bonusbox>
119
  </default>
49
 
50
  <layout>
51
  <updates>
52
+ <bonusbox>
53
  <file>bonusbox.xml</file>
54
+ </bonusbox>
55
  </updates>
56
  </layout>
57
  </frontend>
102
  <general>
103
  <enabled>0</enabled>
104
  <live>0</live>
105
+ <live_public_key />
106
+ <live_secret_key />
107
+ <test_public_key />
108
+ <test_secret_key />
109
  <url><![CDATA[https://api.bonusbox.me/]]></url>
110
  <accept_header><![CDATA[application/json,application/vnd.api;ver=1]]></accept_header>
111
+ <debug_email><![CDATA[no-reply@bonusbox.me]]></debug_email>
112
  </general>
113
  <success_page>
114
+ <new_user_text>Sichere dir %{CREDITS:ACHIEVED} Bonusbox-Punkte und einen Gutschein für deinen nächsten Einkauf!</new_user_text>
115
+ <bonusbox_user_text>Du hast für deinen Einkauf %{CREDITS:ACHIEVED} Punkte bekommen. Die fehlen noch %{CREDITS:LEVELUP} um den naechsten %{BADGE:LEVELUP} zu erreichen.</bonusbox_user_text>
 
 
 
 
116
  </success_page>
117
  </bonusbox>
118
  </default>
app/design/frontend/default/default/template/bonusbox/bonusbox/checkout/success.phtml DELETED
@@ -1 +0,0 @@
1
- <iframe style="overflow: hidden;" src="<?php echo $this->getSuccessPageUrl() ?>" />
 
app/design/frontend/default/default/template/bonusbox/checkout/success.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <iframe style="overflow: hidden; border: 0; width: 100%;" src="<?php echo $this->getSuccessPageUrl() ?>" />
package.xml CHANGED
@@ -1,20 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bonusbox_Bonusbox</name>
4
- <version>1.0.117</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MIT License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Set up your loyalty program in Facebook, reward referrals and win new customers!</summary>
10
- <description>Bonusbox enables merchants to win and retain customers in Facebook. Reward customers with bonusbox credits for referrals, comments and for repeat purchases!&#xD;
11
- &#xD;
12
  For further information, check out our homepage www.bonusbox.me.</description>
13
  <notes>Loyalty programme for success pages</notes>
14
- <authors><author><name>Christian Dittmar</name><user>vivomedia</user><email>dittmar@vivomedia.de</email></author><author><name>Jan Riethmayer</name><user>jan_bonusbox</user><email>jan@bonusbox.me</email></author></authors>
15
  <date>2011-11-22</date>
16
- <time>00:39:05</time>
17
- <contents><target name="magecommunity"><dir name="Bonusbox"><dir name="Bonusbox"><dir name="Block"><dir name="Checkout"><file name="Success.php" hash="365c37f569de06a2a74f867e38bc8083"/></dir></dir><dir name="Helper"><file name="Data.php" hash="aefdfc22f6ef7caf36f5b6ce811465f1"/><file name="Successpage.php" hash="c9713b9155ad608a95ddac2bf5e55b06"/></dir><dir name="Model"><file name="Client.php" hash="eb6e8e450d538cf541fc00f891284671"/></dir><dir name="controllers"><file name="TestController.php" hash="2f04ad79caa8b3a12236bb47dcf7de47"/></dir><dir name="etc"><file name="config.xml" hash="1b7e755712f4b0f64b9b5a65db1d9995"/><file name="system.xml" hash="8d2efc676d7937656781001e7002899c"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="bonusbox"><dir name="bonusbox"><dir name="checkout"><file name="success.phtml" hash="17b048cef04daa63fce29e60ec42ac18"/></dir></dir></dir></dir><dir name="layout"><file name="bonusbox.xml" hash="f54448012a1ded76fba3e17626fe36da"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bonusbox_Bonusbox.xml" hash="924b6d17825c821f6d4e5846eba164c5"/></dir></target></contents>
18
  <compatible/>
19
- <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bonusbox_Bonusbox</name>
4
+ <version>1.0.120</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MIT License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Set up your loyalty program in Facebook, reward referrals and win new customers!</summary>
10
+ <description>Bonusbox enables merchants to win and retain customers in Facebook. Reward customers with bonusbox credits for referrals, comments and for repeat purchases!
11
+
12
  For further information, check out our homepage www.bonusbox.me.</description>
13
  <notes>Loyalty programme for success pages</notes>
14
+ <authors><author><name>Jan Riethmayer</name><user>auto-converted</user><email>jan@bonusbox.me</email></author></authors>
15
  <date>2011-11-22</date>
16
+ <time>00:57:37</time>
17
+ <contents><target name="magecommunity"><dir name="Bonusbox"><dir name="Bonusbox"><dir name="Block"><dir name="Checkout"><file name="Success.php" hash="d7612dcbdd975b6bca3c5cc1454ae161"/></dir></dir><dir name="controllers"><file name="TestController.php" hash="76ab46446b6f9755a31d5a808ae0d0d7"/></dir><dir name="etc"><file name="config.xml" hash="93d25c0bdce345f6ddcd2bd3cda4f1e2"/><file name="system.xml" hash="8d2efc676d7937656781001e7002899c"/></dir><dir name="Helper"><file name="Data.php" hash="2b91b32a971fc0a72c37860728b8dc4a"/><file name="Successpage.php" hash="c9713b9155ad608a95ddac2bf5e55b06"/></dir><dir name="Model"><file name="Client.php" hash="eb6e8e450d538cf541fc00f891284671"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="bonusbox.xml" hash="f54448012a1ded76fba3e17626fe36da"/></dir><dir name="template"><dir name="bonusbox"><dir name="checkout"><file name="success.phtml" hash="2db7c3f9ba5bc1ba70332550c9def603"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bonusbox_Bonusbox.xml" hash="924b6d17825c821f6d4e5846eba164c5"/></dir></target></contents>
18
  <compatible/>
19
+ <dependencies/>
20
  </package>