ShopLogin_ShopLogin - Version 1.4.0

Version Notes

Basis Extension for ShopLogin including the Plugins "Log in with ShopLogin" and "ShopLogin global Wish List".

Download this release

Release Info

Developer Shoplogin
Extension ShopLogin_ShopLogin
Version 1.4.0
Comparing to
See all releases


Code changes from version 0.9.4 to 1.4.0

Files changed (27) hide show
  1. app/code/community/ShopLogin/ShopLogin/Block/Adminhtml/Notifications.php +38 -0
  2. app/code/community/ShopLogin/ShopLogin/Block/Default.php +18 -9
  3. app/code/community/ShopLogin/ShopLogin/Helper/Data.php +60 -108
  4. app/code/community/ShopLogin/ShopLogin/Model/Shoplogin.php +24 -24
  5. app/code/community/ShopLogin/ShopLogin/controllers/CustomerController.php +78 -52
  6. app/code/community/ShopLogin/ShopLogin/etc/adminhtml.xml +1 -1
  7. app/code/community/ShopLogin/ShopLogin/etc/config.xml +39 -3
  8. app/code/community/ShopLogin/ShopLogin/etc/system.xml +79 -5
  9. app/code/community/ShopLogin/ShopLogin/sql/shoplogin_setup/{mysql4-install-0.9.4.php → mysql4-install-1.4.0.php} +1 -1
  10. app/design/adminhtml/default/default/layout/shoplogin.xml +15 -0
  11. app/design/adminhtml/default/default/template/shoplogin/notifications.phtml +6 -0
  12. app/design/frontend/base/default/layout/shoplogin.xml +32 -11
  13. app/design/frontend/base/default/template/shoplogin/add_wishlist_button.phtml +2 -2
  14. app/design/frontend/base/default/template/shoplogin/button.phtml +2 -2
  15. app/design/frontend/base/default/template/shoplogin/button_only.phtml +41 -0
  16. app/design/frontend/base/default/template/shoplogin/catalog/product/view/addto.phtml +43 -0
  17. app/design/frontend/base/default/template/shoplogin/checkout_button.phtml +6 -6
  18. app/design/frontend/base/default/template/shoplogin/checkout_success.phtml +48 -43
  19. app/design/frontend/base/default/template/shoplogin/footer.phtml +2 -1
  20. app/design/frontend/base/default/template/shoplogin/product_recommendation.phtml +6 -0
  21. app/design/frontend/base/default/template/shoplogin/recommendation_homepage.phtml +15 -0
  22. app/design/frontend/base/default/template/shoplogin/recommendation_rightbar.phtml +10 -0
  23. app/design/frontend/base/default/template/shoplogin/seal.phtml +7 -0
  24. app/etc/modules/ShopLogin_ShopLogin.xml +2 -2
  25. app/locale/de_DE/ShopLogin_ShopLogin.csv +19 -2
  26. package.xml +97 -6
  27. shoplogin.xml +2 -2
app/code/community/ShopLogin/ShopLogin/Block/Adminhtml/Notifications.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Shoplogin_Shoplogin_Block_Adminhtml_Notifications extends Mage_Adminhtml_Block_Template
3
+ {
4
+ /**
5
+ * (non-PHPdoc)
6
+ * @see Mage_Core_Block_Template::_construct()
7
+ */
8
+ protected function _construct()
9
+ {
10
+ $this->addData(
11
+ array(
12
+ 'cache_lifetime'=> null
13
+ )
14
+ );
15
+ }
16
+
17
+ public function isInitialized()
18
+ {
19
+ $clientId = Mage::getStoreConfig('shoplogin/settings/clientid');
20
+ if(empty($clientId)) {
21
+ return false;
22
+ }
23
+ return true;
24
+ }
25
+
26
+ public function getManageUrl()
27
+ {
28
+ return $this->getUrl('adminhtml/system_config/edit', array('section' => 'shoplogin'));
29
+ }
30
+
31
+ protected function _toHtml()
32
+ {
33
+ if (Mage::getSingleton('admin/session')->isAllowed('system/shoplogin')) {
34
+ return parent::_toHtml();
35
+ }
36
+ return '';
37
+ }
38
+ }
app/code/community/ShopLogin/ShopLogin/Block/Default.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Log in with ShopLogin for Magento
4
  * https://www.shoplogin.com/for-merchants/
5
- * v0.9.4 for Magento
6
  */
7
 
8
  class ShopLogin_ShopLogin_Block_Default extends Mage_Core_Block_Template {
@@ -19,22 +19,31 @@ class ShopLogin_ShopLogin_Block_Default extends Mage_Core_Block_Template {
19
  return $this->_getHelper()->isEnabled();
20
  }
21
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  public function getClientId()
23
  {
24
  return $this->_getHelper()->getClientId();
25
  }
26
 
27
- public function getClientSecret()
28
  {
29
- return $this->_getHelper()->getClientSecret();
30
- }
31
-
32
- public function AffiliateisEnabled() {
33
- return $this->_getHelper()->AffiliateisEnabled();
34
  }
35
 
36
- public function TrackingPlusisEnabled() {
37
- return $this->_getHelper()->TrackingPlusisEnabled();
 
38
  }
39
 
40
  public function getIsUserConnected()
2
  /*
3
  * Log in with ShopLogin for Magento
4
  * https://www.shoplogin.com/for-merchants/
5
+ * v1.4.0 for Magento
6
  */
7
 
8
  class ShopLogin_ShopLogin_Block_Default extends Mage_Core_Block_Template {
19
  return $this->_getHelper()->isEnabled();
20
  }
21
 
22
+ public function WishlistEnabled() {
23
+ return $this->_getHelper()->WishlistEnabled();
24
+ }
25
+
26
+ public function RecommendationEnabled() {
27
+ return $this->_getHelper()->RecommendationEnabled();
28
+ }
29
+
30
+ public function ShowSeal() {
31
+ return $this->_getHelper()->ShowSeal();
32
+ }
33
+
34
  public function getClientId()
35
  {
36
  return $this->_getHelper()->getClientId();
37
  }
38
 
39
+ public function getRecommendationLicenseKey()
40
  {
41
+ return $this->_getHelper()->getRecommendationLicenseKey();
 
 
 
 
42
  }
43
 
44
+ public function getClientSecret()
45
+ {
46
+ return $this->_getHelper()->getClientSecret();
47
  }
48
 
49
  public function getIsUserConnected()
app/code/community/ShopLogin/ShopLogin/Helper/Data.php CHANGED
@@ -2,16 +2,14 @@
2
  /*
3
  * Log in with ShopLogin for Magento
4
  * https://www.shoplogin.com/for-merchants/
5
- * v0.9.4 for Magento
6
  */
7
 
8
- class ShopLogin_ShopLogin_Helper_Data {
9
 
10
  protected $APP_ID;
11
  protected $APP_SECRET;
12
- protected $redirect_url_login;
13
- protected $redirect_url_logout;
14
- protected $data_url = 'https://data.shoplogin.com/v001/';
15
 
16
  public function isEnabled()
17
  {
@@ -22,18 +20,43 @@ class ShopLogin_ShopLogin_Helper_Data {
22
  return false;
23
  }
24
 
25
- public function AffiliateisEnabled()
26
  {
27
- if(Mage::getStoreConfig('shoplogin/settings_affiliate/enabled'))
28
  {
29
  return true;
30
  }
31
  return false;
32
  }
33
 
34
- public function TrackingPlusisEnabled()
35
  {
36
- if(Mage::getStoreConfig('shoplogin/settings_trackingplus/enabled'))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  {
38
  return true;
39
  }
@@ -45,6 +68,11 @@ class ShopLogin_ShopLogin_Helper_Data {
45
  return Mage::getStoreConfig('shoplogin/settings/clientid');
46
  }
47
 
 
 
 
 
 
48
  public function getClientSecret()
49
  {
50
  return Mage::getStoreConfig('shoplogin/settings/clientsecret');
@@ -52,12 +80,16 @@ class ShopLogin_ShopLogin_Helper_Data {
52
 
53
  public function getIsUserConnected()
54
  {
55
- // is the session-user connected with ShopLogin?
 
56
  if(Mage::getSingleton('customer/session')->isLoggedIn())
57
  {
 
58
  $customer = Mage::getSingleton('customer/session')->getCustomer();
59
  $read = Mage::getSingleton('core/resource')->getConnection('core_read');
60
- $results = $read->fetchAll() ->from(Mage::getSingleton('core/resource')->getTableName('shoplogin_customer')) ->where("customer_id='?'", $customer->getId());
 
 
61
  if (count($results) && isset($results[0]['shoplogin_id']))
62
  {
63
  return $results[0]['shoplogin_id'];
@@ -66,7 +98,7 @@ class ShopLogin_ShopLogin_Helper_Data {
66
  return false;
67
  }
68
 
69
- public function init($APP_ID = false, $APP_SECRET = false, $redirect_url_login = 'auto', $redirect_url_logout = 'auto')
70
  {
71
 
72
  if ( !function_exists('json_encode') ) {
@@ -82,14 +114,12 @@ class ShopLogin_ShopLogin_Helper_Data {
82
  }
83
  $this->appid = $APP_ID;
84
  $this->secret = $APP_SECRET;
85
- $this->redirect_url_login = $redirect_url_login;
86
- $this->redirect_url_logout = $redirect_url_logout;
87
-
88
- $this->auto_login_logout();
89
  }
90
 
91
  public function get_user_isauthorized($signed_request = false)
92
  {
 
 
93
  if(isset($_COOKIE['shoplogin_'.$this->appid]) && $_COOKIE['shoplogin_'.$this->appid])
94
  {
95
  $result = $this->parse_signed_request($_COOKIE['shoplogin_'.$this->appid], $this->secret);
@@ -111,6 +141,8 @@ class ShopLogin_ShopLogin_Helper_Data {
111
 
112
  public function get_address_fromuser($addon='')
113
  {
 
 
114
  $user = $this->get_user_isauthorized();
115
  if($user)
116
  {
@@ -123,6 +155,8 @@ class ShopLogin_ShopLogin_Helper_Data {
123
 
124
  public function get_address_fromtoken($data_token = '', $addon='')
125
  {
 
 
126
  if(strlen($data_token) != 74)
127
  {
128
  return json_decode(json_encode(array('authorized'=>false, 'error'=>'data_token_invalid')));
@@ -136,93 +170,11 @@ class ShopLogin_ShopLogin_Helper_Data {
136
  return $temp;
137
  }
138
 
139
- public function do_login($typ = 'address', $state = '', $redirect_url = 'auto')
140
- {
141
- header("LOCATION:".$this->get_login_url($typ, $state, $redirect_url));
142
- }
143
-
144
- public function do_logout($state = '', $redirect_url = 'auto')
145
- {
146
- header("LOCATION:".$this->get_logout_url($state, $redirect_url));
147
- }
148
-
149
- public function get_login_url($typ = 'address', $state = '', $redirect_url = 'auto')
150
- {
151
- if(!in_array($typ, array('address', 'login'))) { $typ = 'address'; }
152
- return 'https://www.shoplogin.com/account/?appid='.$this->appid.'&version=1&callback=redirect&method=connect&action='.$typ.'&redirect='.rawurlencode($redirect_url).'&state='.rawurlencode($state);
153
- }
154
-
155
- public function get_logout_url($state = '', $redirect_url = 'auto')
156
- {
157
- return 'https://www.shoplogin.com/account/?appid='.$this->appid.'&version=1&callback=redirect&method=connect&action=logout&redirect='.rawurlencode($redirect_url).'&state='.rawurlencode($state);
158
- }
159
-
160
- protected function auto_login_logout()
161
- {
162
- $domain = '';
163
- $accesscode = '';
164
- $authorized = '';
165
- $redirect = '';
166
-
167
- if(isset($_GET['sl_domain']))
168
- {
169
- $domain = $_GET['sl_domain'];
170
- }
171
- if(isset($_GET['sl_access']))
172
- {
173
- $accesscode = $_GET['sl_access'];
174
- }
175
- if(isset($_GET['sl_authorized']))
176
- {
177
- $authorized = $_GET['sl_authorized'];
178
- }
179
- if($authorized == 'false' || $authorized == 'true')
180
- {
181
- $redirect = $this->redirect_url_logout;
182
- setcookie('shoplogin_'.$this->appid, '', 0, '/', $domain);
183
- $_COOKIE['shoplogin_'.$this->appid] = '';
184
- }
185
- if($authorized == 'true' and $accesscode)
186
- {
187
- $redirect = $this->redirect_url_login;
188
- if($this->get_user_isauthorized($accesscode))
189
- {
190
- setcookie('shoplogin_'.$this->appid, $accesscode, 0, '/', $domain);
191
- $_COOKIE['shoplogin_'.$this->appid] = $accesscode;
192
- }
193
- }
194
-
195
- if($domain || $accesscode || $authorized)
196
- {
197
- if( ($authorized == 'true' && $this->redirect_url_login == 'auto') )
198
- {
199
- $redirect = $this->clean_url(getenv('REQUEST_URI'));
200
- }
201
- if( ($authorized == 'false' && $this->redirect_url_logout == 'auto') )
202
- {
203
- $redirect = $this->clean_url(getenv('REQUEST_URI'));
204
- }
205
- header('LOCATION:'.$redirect);
206
- }
207
- }
208
-
209
- protected function clean_url($url)
210
- {
211
- foreach(array('sl_access', 'sl_authorized', 'sl_domain') as $key)
212
- {
213
- if(isset($_GET[$key]))
214
- {
215
- $url = str_replace($key.'='.$_GET[$key], '', $url);
216
- $url = str_replace('&&', '&', $url);
217
- }
218
- }
219
- $url = str_replace('?&', '?', $url);
220
- if(substr($url, strlen($url)-1) =='?' || substr($url, strlen($url)-1) == '&') { $url = substr($url,0, strlen($url)-1); }
221
- return $url;
222
- }
223
-
224
  protected function do_curl($url)
225
  {
 
 
 
226
  $url = $url."&version=magento-".Mage::getConfig()->getModuleConfig("ShopLogin_ShopLogin")->version."&shop_system=magento-".Mage::getVersion();
227
  $url = $url.'&checksum='.md5($url.'#'.$this->secret);
228
  $ch = curl_init();
@@ -230,15 +182,17 @@ class ShopLogin_ShopLogin_Helper_Data {
230
  curl_setopt($ch, CURLOPT_URL, $url);
231
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 5);
232
  curl_setopt($ch, CURLOPT_TIMEOUT, 10);
233
- curl_setopt($ch, CURLOPT_USERAGENT, 'sl-php-001');
234
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 
235
 
236
  $result = curl_exec($ch);
237
  curl_close($ch);
238
  return $result;
239
  }
240
 
241
- protected function parse_signed_request($signed_request, $APP_SECRET) {
 
242
  $temp = explode('.', $signed_request);
243
  if(!is_array($temp) || count($temp) != 2)
244
  {
@@ -254,13 +208,11 @@ class ShopLogin_ShopLogin_Helper_Data {
254
  return null;
255
  }
256
 
257
- protected function base64_url_decode($input) {
 
258
  return base64_decode(strtr($input, '-_', '+/'));
259
  }
260
 
261
-
262
-
263
-
264
  }
265
 
266
- ?>
2
  /*
3
  * Log in with ShopLogin for Magento
4
  * https://www.shoplogin.com/for-merchants/
5
+ * v1.4.0 for Magento
6
  */
7
 
8
+ class ShopLogin_ShopLogin_Helper_Data extends Mage_Core_Helper_Abstract {
9
 
10
  protected $APP_ID;
11
  protected $APP_SECRET;
12
+ protected $data_url = 'https://data.shoplogin.com/v1/';
 
 
13
 
14
  public function isEnabled()
15
  {
20
  return false;
21
  }
22
 
23
+ public function WishlistEnabled()
24
  {
25
+ if(Mage::getStoreConfig('shoplogin/settings_wishlist/enabled'))
26
  {
27
  return true;
28
  }
29
  return false;
30
  }
31
 
32
+ public function ShowSeal()
33
  {
34
+ if(Mage::getStoreConfig('shoplogin/settings/show_seal'))
35
+ {
36
+ return true;
37
+ }
38
+ return false;
39
+ }
40
+
41
+ public function RecommendationEnabled($what = false)
42
+ {
43
+ if(!$what && Mage::getStoreConfig('shoplogin/settings_recommendation/enabled'))
44
+ {
45
+ return true;
46
+ }
47
+ if($what == "product_viewed" && Mage::getStoreConfig('shoplogin/settings_recommendation/product_viewed') && Mage::getStoreConfig('shoplogin/settings_recommendation/enabled'))
48
+ {
49
+ return true;
50
+ }
51
+ if($what == "rightbar_interesting" && Mage::getStoreConfig('shoplogin/settings_recommendation/rightbar_interesting') && Mage::getStoreConfig('shoplogin/settings_recommendation/enabled'))
52
+ {
53
+ return true;
54
+ }
55
+ if($what == "homepage_popular" && Mage::getStoreConfig('shoplogin/settings_recommendation/homepage_popular') && Mage::getStoreConfig('shoplogin/settings_recommendation/enabled'))
56
+ {
57
+ return true;
58
+ }
59
+ if($what == "homepage_interesting" && Mage::getStoreConfig('shoplogin/settings_recommendation/homepage_interesting') && Mage::getStoreConfig('shoplogin/settings_recommendation/enabled'))
60
  {
61
  return true;
62
  }
68
  return Mage::getStoreConfig('shoplogin/settings/clientid');
69
  }
70
 
71
+ public function getRecommendationLicenseKey()
72
+ {
73
+ return Mage::getStoreConfig('shoplogin/settings_recommendation/licensekey');
74
+ }
75
+
76
  public function getClientSecret()
77
  {
78
  return Mage::getStoreConfig('shoplogin/settings/clientsecret');
80
 
81
  public function getIsUserConnected()
82
  {
83
+ // hier wird abgefragt ob der aktuelle User bereits mit ShopLogin über die Tabelle verknüpft ist.
84
+
85
  if(Mage::getSingleton('customer/session')->isLoggedIn())
86
  {
87
+
88
  $customer = Mage::getSingleton('customer/session')->getCustomer();
89
  $read = Mage::getSingleton('core/resource')->getConnection('core_read');
90
+ $query = $read->select()->from(Mage::getSingleton('core/resource')->getTableName('shoplogin_customer')) ->where("customer_id=?", $customer->getId());
91
+ $results = $read->fetchAll($query);
92
+
93
  if (count($results) && isset($results[0]['shoplogin_id']))
94
  {
95
  return $results[0]['shoplogin_id'];
98
  return false;
99
  }
100
 
101
+ public function init($APP_ID = false, $APP_SECRET = false)
102
  {
103
 
104
  if ( !function_exists('json_encode') ) {
114
  }
115
  $this->appid = $APP_ID;
116
  $this->secret = $APP_SECRET;
 
 
 
 
117
  }
118
 
119
  public function get_user_isauthorized($signed_request = false)
120
  {
121
+ // hier werden die Basisdaten des Users (eMail, Vorname, Nachame, Token) mit Hilfe des AppSecret aus dem verschlüsselten Cookie herausgelesen
122
+
123
  if(isset($_COOKIE['shoplogin_'.$this->appid]) && $_COOKIE['shoplogin_'.$this->appid])
124
  {
125
  $result = $this->parse_signed_request($_COOKIE['shoplogin_'.$this->appid], $this->secret);
141
 
142
  public function get_address_fromuser($addon='')
143
  {
144
+ // Helper-Klasse, wenn User per Cookie authentifiziert, dann Adresse per API abfragen
145
+
146
  $user = $this->get_user_isauthorized();
147
  if($user)
148
  {
155
 
156
  public function get_address_fromtoken($data_token = '', $addon='')
157
  {
158
+ // hier wird die API mit dem Token aus dem Cookie abgefragt, bei Erfolg liefert diese die Adressdaten des Users zurück
159
+
160
  if(strlen($data_token) != 74)
161
  {
162
  return json_decode(json_encode(array('authorized'=>false, 'error'=>'data_token_invalid')));
170
  return $temp;
171
  }
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  protected function do_curl($url)
174
  {
175
+ // Abfrage der Api mit CURL mit einigen zusätzlichen Parametern wie Version etc.
176
+ // sowie einer Checksumme bestehend aus der "komplettenUrl#AppSecret"
177
+
178
  $url = $url."&version=magento-".Mage::getConfig()->getModuleConfig("ShopLogin_ShopLogin")->version."&shop_system=magento-".Mage::getVersion();
179
  $url = $url.'&checksum='.md5($url.'#'.$this->secret);
180
  $ch = curl_init();
182
  curl_setopt($ch, CURLOPT_URL, $url);
183
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 5);
184
  curl_setopt($ch, CURLOPT_TIMEOUT, 10);
185
+ curl_setopt($ch, CURLOPT_USERAGENT, 'sl-magento-1.4.0');
186
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
187
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
188
 
189
  $result = curl_exec($ch);
190
  curl_close($ch);
191
  return $result;
192
  }
193
 
194
+ protected function parse_signed_request($signed_request, $APP_SECRET)
195
+ {
196
  $temp = explode('.', $signed_request);
197
  if(!is_array($temp) || count($temp) != 2)
198
  {
208
  return null;
209
  }
210
 
211
+ protected function base64_url_decode($input)
212
+ {
213
  return base64_decode(strtr($input, '-_', '+/'));
214
  }
215
 
 
 
 
216
  }
217
 
218
+ ?>
app/code/community/ShopLogin/ShopLogin/Model/Shoplogin.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
- /*
3
- * Log in with ShopLogin for Magento
4
- * https://www.shoplogin.com/for-merchants/
5
- * v0.9.4 for Magento
6
- */
7
-
8
- class ShopLogin_ShopLogin_Model_Shoplogin extends Mage_Core_Model_Abstract
9
- {
10
- public function _construct()
11
- {
12
- parent::_construct();
13
- $this->_init('shoplogin/shoplogin');
14
- }
15
- }
16
-
17
- class ShopLogin_ShopLogin_Model_Resource_Shoplogin extends Mage_Core_Model_Mysql4_Abstract
18
- {
19
- public function _construct()
20
- {
21
- $this->_init('shoplogin/shoplogin', 'id');
22
- }
23
- }
24
-
25
  ?>
1
+ <?php
2
+ /*
3
+ * Log in with ShopLogin for Magento
4
+ * https://www.shoplogin.com/for-merchants/
5
+ * v1.4.0 for Magento
6
+ */
7
+
8
+ class ShopLogin_ShopLogin_Model_Shoplogin extends Mage_Core_Model_Abstract
9
+ {
10
+ public function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->_init('shoplogin/shoplogin');
14
+ }
15
+ }
16
+
17
+ class ShopLogin_ShopLogin_Model_Resource_Shoplogin extends Mage_Core_Model_Mysql4_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('shoplogin/shoplogin', 'id');
22
+ }
23
+ }
24
+
25
  ?>
app/code/community/ShopLogin/ShopLogin/controllers/CustomerController.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Log in with ShopLogin for Magento
4
  * https://www.shoplogin.com/for-merchants/
5
- * v0.9.4 for Magento
6
  */
7
 
8
  class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_Action
@@ -19,12 +19,16 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
19
 
20
  public function LoginAction()
21
  {
 
 
 
22
  $this->helper = Mage::helper('shoplogin');
23
  if(! ($this->helper->isEnabled() && $this->helper->getClientId() && $this->helper->getClientSecret()) )
24
  {
25
  $this->user_redirect(); return;
26
  }
27
 
 
28
  $attributes = Mage::getModel('customer/entity_address_attribute_collection');
29
  foreach ($attributes as $attribute)
30
  {
@@ -34,15 +38,24 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
34
  }
35
  }
36
 
 
37
  $this->helper->init($this->helper->getClientId(),$this->helper->getClientSecret());
 
 
38
  $this->user_basic = $this->helper->get_user_isauthorized();
 
 
39
  if(!$this->user_basic)
40
  {
41
  $message = $this->__('Error: Please verify the ShopLogin configuration settings of this store.');
42
  Mage::getSingleton('core/session')->addError($message);
43
  $this->user_redirect(); return;
44
  }
 
 
45
  $this->user_address = $this->helper->get_address_fromuser("&required_fields=".implode(",", $this->required));
 
 
46
  if(!$this->user_address->authorized)
47
  {
48
  $message = $this->__('Error: You could not be logged in with ShopLogin, please try again.');
@@ -51,34 +64,38 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
51
  }
52
  $this->shoplogin_id = $this->user_basic->uid;
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
- if($this->user_already_registered_with_shoplogin())
56
- {
57
- $this->user_update_connect_with_shoplogin();
58
- $this->user_do_login();
59
- $this->user_insert_address();
60
- $this->user_redirect(); return;
61
- }
62
-
63
- if($this->user_already_registered_with_email())
64
- {
65
- if($this->user_address->details_history->email_confirmed)
66
- {
67
- $this->user_connect_with_shoplogin();
68
- $this->user_do_login();
69
- $this->user_insert_address();
70
- }else
71
- {
72
- $message = $this->__('Error: You could not be logged in with ShopLogin, because your ShopLogin account is not confirmed. ShopLogin sent you an activiation link to your email address. Please click on the included link to activate your account.');
73
- $message .= "&nbsp; <font style='cursor:pointer; text-decoration:underline;' onclick='shoplogin.resend_activation()'>".$this->__('Resend&nbsp;Activation&nbsp;Email')."</font>";
74
- Mage::getSingleton('core/session')->addError($message);
75
- $this->user_redirect(); return;
76
- die("ShopLogin-eMail not confirmed - User with address already exists");
77
- }
78
- $this->user_redirect(); return;
79
- }
80
-
81
- // Register new User
82
  if($this->user_create_account())
83
  {
84
  $this->user_connect_with_shoplogin();
@@ -91,29 +108,29 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
91
 
92
  private function user_create_account()
93
  {
94
- $temp = Mage::getModel('customer/customer');
95
- $temp->setFirstname($this->user_basic->first_name);
96
- $temp->setLastname($this->user_basic->last_name);
97
- $temp->setEmail($this->user_basic->email);
98
- $temp->setPassword(md5(microtime().'#'.$this->user_basic->data_token));
99
- $temp->setIsActive(1);
100
- $temp->setWebsiteId(Mage::app()->getWebsite()->getId());
101
- $temp->setConfirmation(null);
102
- $temp->save();
103
- if($temp->getId())
104
- {
105
- $this->customer = $temp;
106
- $this->customer_id = $temp->getId();
107
- return true;
108
- }
109
- return false;
 
 
110
  }
111
 
112
  private function user_insert_address()
113
  {
114
- // todo
115
- // check ob aktuelle adresse eine andere?
116
- // wenn ja, dann adresse eingeben und als neue Standardadressen eingeben
117
 
118
  if($this->user_address->details_history->billing_same_as_shipping)
119
  {
@@ -128,6 +145,7 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
128
 
129
  private function user_add_address($address, $shipping, $billing)
130
  {
 
131
 
132
  $addr = array (
133
  'firstname' => $address->first_name,
@@ -186,6 +204,7 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
186
 
187
  private function address_already_exists($addr)
188
  {
 
189
  $tempaddr = Mage::getSingleton('customer/session')->getCustomer();
190
  foreach ($tempaddr->getAddresses() as $a)
191
  {
@@ -222,18 +241,21 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
222
 
223
  private function user_connect_with_shoplogin()
224
  {
225
- $write = Mage::getSingleton('core/resource')->getConnection('core_write');
226
- $write->insert(Mage::getSingleton('core/resource')->getTableName('shoplogin_customer'), array("customer_id" => (int)$this->customer_id, "shoplogin_id" => (int)$this->shoplogin_id, "data_token" => $this->user_basic->data_token));
 
227
  }
228
 
229
  private function user_update_connect_with_shoplogin()
230
  {
231
- $write = Mage::getSingleton('core/resource')->getConnection('core_write');
232
- $write->update(Mage::getSingleton('core/resource')->getTableName('shoplogin_customer'), array("customer_id" => (int)$this->customer_id, "shoplogin_id" => (int)$this->shoplogin_id, "data_token" => $this->user_basic->data_token), "customer_id='".(int)$this->customer_id."' and shoplogin_id='".(int)$this->shoplogin_id."'");
 
233
  }
234
 
235
  private function user_already_registered_with_email()
236
  {
 
237
  if($temp = Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getWebsite()->getId())->loadByEmail($this->user_basic->email))
238
  {
239
  if($temp->getId())
@@ -248,6 +270,7 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
248
 
249
  public function user_already_registered_with_shoplogin()
250
  {
 
251
  if($temp = Mage::getModel('shoplogin/shoplogin')->load($this->shoplogin_id, 'shoplogin_id'))
252
  {
253
  if($temp->getCustomerId())
@@ -260,7 +283,9 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
260
  return false;
261
  }
262
 
263
- private function user_do_login() {
 
 
264
  $session = Mage::getSingleton('customer/session');
265
  $temp = Mage::getModel('customer/customer')->load($this->customer_id);
266
  if($temp->getId())
@@ -271,6 +296,7 @@ class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_
271
 
272
  private function user_redirect()
273
  {
 
274
  $session = Mage::getSingleton('customer/session');
275
 
276
  if (isset($_GET['redirect'])) {
2
  /*
3
  * Log in with ShopLogin for Magento
4
  * https://www.shoplogin.com/for-merchants/
5
+ * v1.4.0 for Magento
6
  */
7
 
8
  class ShopLogin_ShopLogin_CustomerController extends Mage_Core_Controller_Front_Action
19
 
20
  public function LoginAction()
21
  {
22
+ // Hauptklasse, diese wird beim Aufrufen des ShopLogin-Logins aufgerufen und übernimmt die Steuerung
23
+
24
+ // wenn ShopLogin nicht aktiviert oder nicht die AppID und AppSecret in den Einstellungen eingegeben wurde, dann den User sofort weiterleiten
25
  $this->helper = Mage::helper('shoplogin');
26
  if(! ($this->helper->isEnabled() && $this->helper->getClientId() && $this->helper->getClientSecret()) )
27
  {
28
  $this->user_redirect(); return;
29
  }
30
 
31
+ // (optional) die vom Shopsystem erforderlichen Adress-Datenfelder heraussuchen, diese werden der ShopLogin-Api übergeben, damit diese die notwendigen Felder zurückgeben kann
32
  $attributes = Mage::getModel('customer/entity_address_attribute_collection');
33
  foreach ($attributes as $attribute)
34
  {
38
  }
39
  }
40
 
41
+ // ShopLogin-Klasse initieren (findet sich hier in Magento unter Helper/Data.php)
42
  $this->helper->init($this->helper->getClientId(),$this->helper->getClientSecret());
43
+
44
+ // Basisdaten des User abfragen (eMail, Vorname, Nachname, Token)
45
  $this->user_basic = $this->helper->get_user_isauthorized();
46
+
47
+ // wenn die Basisdaten nicht abgefragt werden konnten, User zurückleiten und Fehlermeldung (Fehler ist höchstwahrscheinlich inkorrekte AppID und AppSecret in den Shop-Einstellungen)
48
  if(!$this->user_basic)
49
  {
50
  $message = $this->__('Error: Please verify the ShopLogin configuration settings of this store.');
51
  Mage::getSingleton('core/session')->addError($message);
52
  $this->user_redirect(); return;
53
  }
54
+
55
+ // Adressdaten des Users abfragen
56
  $this->user_address = $this->helper->get_address_fromuser("&required_fields=".implode(",", $this->required));
57
+
58
+ // wenn keine Adressdaten übermittel, User zurückleiten und Fehlermeldung
59
  if(!$this->user_address->authorized)
60
  {
61
  $message = $this->__('Error: You could not be logged in with ShopLogin, please try again.');
64
  }
65
  $this->shoplogin_id = $this->user_basic->uid;
66
 
67
+ // wenn User bereits angemeldet mit ShopLogin, dann einloggen, Adressen etc. updaten und weiterleiten
68
+ if($this->user_already_registered_with_shoplogin())
69
+ {
70
+ $this->user_update_connect_with_shoplogin();
71
+ $this->user_do_login();
72
+ $this->user_insert_address();
73
+ $this->user_redirect(); return;
74
+ }
75
+
76
+ // wenn es bereits einen User im Shop mit der angegeben eMail-Adresse gibt
77
+ if($this->user_already_registered_with_email())
78
+ {
79
+ // wenn von der ShopLogin-Api das Flag email_confirmed auf true steht, hat der User seine eMail bereits bestätigt und kann verknüpft und eingeloggt werden, vorher Adresse etc. updaten
80
+ if($this->user_address->details_history->email_confirmed)
81
+ {
82
+ $this->user_connect_with_shoplogin();
83
+ $this->user_do_login();
84
+ $this->user_insert_address();
85
+ }else
86
+ {
87
+ // wenn der User seine eMail-Adresse bei ShopLogin nicht bestätigt hat, aber im Shop bereits vorhanden ist,
88
+ // darf der User nicht eingeloggt werden, sondern es soll ein Hinweis kommen, dass er bitte seine eMailadresse bei ShopLogin bestätigen soll ums ich anmelden zu können
89
+ $message = $this->__('Error: You could not be logged in with ShopLogin, because your ShopLogin account is not confirmed. ShopLogin sent you an activiation link to your email address. Please click on the included link to activate your account.');
90
+ $message .= "&nbsp; <font style='cursor:pointer; text-decoration:underline;' onclick='shoplogin.resend_activation()'>".$this->__('Resend&nbsp;Activation&nbsp;Email')."</font>";
91
+ Mage::getSingleton('core/session')->addError($message);
92
+ $this->user_redirect(); return;
93
+ die("ShopLogin-eMail not confirmed - User with address already exists");
94
+ }
95
+ $this->user_redirect(); return;
96
+ }
97
 
98
+ // Neuen User-Account anlegen, mit ShopLogin verknüpfen, Adressen einfügen etc. und dann weiterleiten
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  if($this->user_create_account())
100
  {
101
  $this->user_connect_with_shoplogin();
108
 
109
  private function user_create_account()
110
  {
111
+ // Anlegen des User-Accounts mit zufälligem Passwort
112
+
113
+ $temp = Mage::getModel('customer/customer');
114
+ $temp->setFirstname($this->user_basic->first_name);
115
+ $temp->setLastname($this->user_basic->last_name);
116
+ $temp->setEmail($this->user_basic->email);
117
+ $temp->setPassword(md5(microtime().'#'.$this->user_basic->data_token));
118
+ $temp->setIsActive(1);
119
+ $temp->setWebsiteId(Mage::app()->getWebsite()->getId());
120
+ $temp->setConfirmation(null);
121
+ $temp->save();
122
+ if($temp->getId())
123
+ {
124
+ $this->customer = $temp;
125
+ $this->customer_id = $temp->getId();
126
+ return true;
127
+ }
128
+ return false;
129
  }
130
 
131
  private function user_insert_address()
132
  {
133
+ // Helper-Klasse zum Adresse hinzufügen, wenn der Flag billing_same_as_shipping gesetzt ist von ShopLogin, ist Liefer- und Rechnungsadresse die selbe und soll bei beidem als neuer Standardwert gelten
 
 
134
 
135
  if($this->user_address->details_history->billing_same_as_shipping)
136
  {
145
 
146
  private function user_add_address($address, $shipping, $billing)
147
  {
148
+ // Hier wird eine neue Adresse dem Userkonto hinzugefügt und optional als Standardwert für Liefer- oder Rechnungsadresse gesetzt
149
 
150
  $addr = array (
151
  'firstname' => $address->first_name,
204
 
205
  private function address_already_exists($addr)
206
  {
207
+ // Hier wird geprüft ob eine bestimmte von ShopLogin übermittelte Adresse bereits vorhanden ist im Userkonto
208
  $tempaddr = Mage::getSingleton('customer/session')->getCustomer();
209
  foreach ($tempaddr->getAddresses() as $a)
210
  {
241
 
242
  private function user_connect_with_shoplogin()
243
  {
244
+ // Hier wird in die ShopLogin-Tabelle die interne UserID sowie die ShopLogin-UserID und der Token geschrieben und somit verknüpft
245
+ $write = Mage::getSingleton('core/resource')->getConnection('core_write');
246
+ $write->insert(Mage::getSingleton('core/resource')->getTableName('shoplogin_customer'), array("customer_id" => (int)$this->customer_id, "shoplogin_id" => (int)$this->shoplogin_id, "data_token" => $this->user_basic->data_token));
247
  }
248
 
249
  private function user_update_connect_with_shoplogin()
250
  {
251
+ // Hier wird in die ShopLogin-Tabelle im Grunde nur der Token upgedatet
252
+ $write = Mage::getSingleton('core/resource')->getConnection('core_write');
253
+ $write->update(Mage::getSingleton('core/resource')->getTableName('shoplogin_customer'), array("customer_id" => (int)$this->customer_id, "shoplogin_id" => (int)$this->shoplogin_id, "data_token" => $this->user_basic->data_token), "customer_id='".(int)$this->customer_id."' and shoplogin_id='".(int)$this->shoplogin_id."'");
254
  }
255
 
256
  private function user_already_registered_with_email()
257
  {
258
+ // Hier wird abgefragt ob bereits ein Kunde mit der bei ShopLogin angegeben eMail-Adresse im Shop existiert
259
  if($temp = Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getWebsite()->getId())->loadByEmail($this->user_basic->email))
260
  {
261
  if($temp->getId())
270
 
271
  public function user_already_registered_with_shoplogin()
272
  {
273
+ // Hier wird abgefragt ob sich in der ShopLogin-Tabelle bereits ein Eintrag mit der ShopLogin-ID befindet und der User sich somit schonmal über ShopLogin im Shop angemeldet hat
274
  if($temp = Mage::getModel('shoplogin/shoplogin')->load($this->shoplogin_id, 'shoplogin_id'))
275
  {
276
  if($temp->getCustomerId())
283
  return false;
284
  }
285
 
286
+ private function user_do_login()
287
+ {
288
+ // Hier wird der User eingeloggt in den Shop
289
  $session = Mage::getSingleton('customer/session');
290
  $temp = Mage::getModel('customer/customer')->load($this->customer_id);
291
  if($temp->getId())
296
 
297
  private function user_redirect()
298
  {
299
+ // Hier wird der User weitergeleitet an seine ursprüngliche URL (die URL wurde GET Get-Parameter verschlüsselt an die ShopLogin-Login-Url mitübergeben). Fall keine URL mitübergeben wurde, wird er einfach zu seiner Kundenkonto-Startseite weitergeleitet.
300
  $session = Mage::getSingleton('customer/session');
301
 
302
  if (isset($_GET['redirect'])) {
app/code/community/ShopLogin/ShopLogin/etc/adminhtml.xml CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
- * v0.9.4 for Magento
7
  */
8
  -->
9
  <config>
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
+ * v1.4.0 for Magento
7
  */
8
  -->
9
  <config>
app/code/community/ShopLogin/ShopLogin/etc/config.xml CHANGED
@@ -3,13 +3,13 @@
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
- * v0.9.4 for Magento
7
  */
8
  -->
9
  <config>
10
  <modules>
11
  <ShopLogin_ShopLogin>
12
- <version>0.9.4</version>
13
  </ShopLogin_ShopLogin>
14
  </modules>
15
 
@@ -93,11 +93,47 @@
93
  </layout>
94
  </frontend>
95
 
 
 
 
 
 
 
 
 
 
 
96
  <default>
97
  <shoplogin>
98
  <settings>
99
- <enabled>0</enabled>
 
100
  </settings>
101
  </shoplogin>
102
  </default>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  </config>
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
+ * v1.4.0 for Magento
7
  */
8
  -->
9
  <config>
10
  <modules>
11
  <ShopLogin_ShopLogin>
12
+ <version>1.4.0</version>
13
  </ShopLogin_ShopLogin>
14
  </modules>
15
 
93
  </layout>
94
  </frontend>
95
 
96
+ <adminhtml>
97
+ <layout>
98
+ <updates>
99
+ <shoplogin>
100
+ <file>shoplogin.xml</file>
101
+ </shoplogin>
102
+ </updates>
103
+ </layout>
104
+ </adminhtml>
105
+
106
  <default>
107
  <shoplogin>
108
  <settings>
109
+ <enabled>1</enabled>
110
+ <show_seal>1</show_seal>
111
  </settings>
112
  </shoplogin>
113
  </default>
114
+ <default>
115
+ <shoplogin>
116
+ <settings_loginwith>
117
+ <enabled>1</enabled>
118
+ </settings_loginwith>
119
+ </shoplogin>
120
+ </default>
121
+ <default>
122
+ <shoplogin>
123
+ <settings_wishlist>
124
+ <enabled>1</enabled>
125
+ </settings_wishlist>
126
+ </shoplogin>
127
+ </default>
128
+ <default>
129
+ <shoplogin>
130
+ <settings_recommendation>
131
+ <enabled>1</enabled>
132
+ <homepage_interesting>1</homepage_interesting>
133
+ <homepage_popular>1</homepage_popular>
134
+ <rightbar_interesting>1</rightbar_interesting>
135
+ <product_viewed>1</product_viewed>
136
+ </settings_recommendation>
137
+ </shoplogin>
138
+ </default>
139
  </config>
app/code/community/ShopLogin/ShopLogin/etc/system.xml CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
- * v0.9.4 for Magento
7
  */
8
  -->
9
  <config>
@@ -24,7 +24,7 @@
24
  <show_in_default>1</show_in_default>
25
  <show_in_website>1</show_in_website>
26
  <show_in_store>1</show_in_store>
27
- <comment>
28
  </comment>
29
  <fields>
30
  <clientid translate="label">
@@ -36,13 +36,22 @@
36
  <show_in_store>1</show_in_store>
37
  </clientid>
38
  <clientsecret translate="label">
39
- <label>Client Secret</label>
40
  <frontend_type>text</frontend_type>
41
  <sort_order>30</sort_order>
42
  <show_in_default>1</show_in_default>
43
  <show_in_website>1</show_in_website>
44
  <show_in_store>1</show_in_store>
45
  </clientsecret>
 
 
 
 
 
 
 
 
 
46
  </fields>
47
  </settings>
48
  <settings_loginwith translate="label">
@@ -56,7 +65,7 @@
56
  </comment>
57
  <fields>
58
  <enabled translate="label">
59
- <label>Enabled</label>
60
  <frontend_type>select</frontend_type>
61
  <source_model>adminhtml/system_config_source_enabledisable</source_model>
62
  <sort_order>10</sort_order>
@@ -77,7 +86,7 @@
77
  </comment>
78
  <fields>
79
  <enabled translate="label">
80
- <label>Enabled</label>
81
  <frontend_type>select</frontend_type>
82
  <source_model>adminhtml/system_config_source_enabledisable</source_model>
83
  <sort_order>10</sort_order>
@@ -87,6 +96,71 @@
87
  </enabled>
88
  </fields>
89
  </settings_wishlist>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  </groups>
91
  </shoplogin>
92
  </sections>
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
+ * v1.4.0 for Magento
7
  */
8
  -->
9
  <config>
24
  <show_in_default>1</show_in_default>
25
  <show_in_website>1</show_in_website>
26
  <show_in_store>1</show_in_store>
27
+ <comment><![CDATA[Register your Online Store free of charge in the ShopLogin.com Merchant area (<a href="https://www.shoplogin.com/account/merchant/" target="_blank">Log in</a> or <a href="https://www.shoplogin.com/register/?goto=merchant" target="_blank">Register</a>) and insert your App ID and App Secret here. For more information about the correct integration please visit <a href="https://www.shoplogin.com/integration/" target="_blank">https://www.shoplogin.com/integration/</a> for more details. <iframe src="https://www.shoplogin.com/moduladmin/?pluginref=magentoconnect&version=magento-1.4.0" frameborder=0 width=1 height=1></iframe>]]>
28
  </comment>
29
  <fields>
30
  <clientid translate="label">
36
  <show_in_store>1</show_in_store>
37
  </clientid>
38
  <clientsecret translate="label">
39
+ <label>App Secret</label>
40
  <frontend_type>text</frontend_type>
41
  <sort_order>30</sort_order>
42
  <show_in_default>1</show_in_default>
43
  <show_in_website>1</show_in_website>
44
  <show_in_store>1</show_in_store>
45
  </clientsecret>
46
+ <show_seal translate="label">
47
+ <label>Show ShopLogin Seal</label>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
50
+ <sort_order>40</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ </show_seal>
55
  </fields>
56
  </settings>
57
  <settings_loginwith translate="label">
65
  </comment>
66
  <fields>
67
  <enabled translate="label">
68
+ <label>Enable</label>
69
  <frontend_type>select</frontend_type>
70
  <source_model>adminhtml/system_config_source_enabledisable</source_model>
71
  <sort_order>10</sort_order>
86
  </comment>
87
  <fields>
88
  <enabled translate="label">
89
+ <label>Enable</label>
90
  <frontend_type>select</frontend_type>
91
  <source_model>adminhtml/system_config_source_enabledisable</source_model>
92
  <sort_order>10</sort_order>
96
  </enabled>
97
  </fields>
98
  </settings_wishlist>
99
+ <settings_recommendation translate="label">
100
+ <label>Product Recommendation</label>
101
+ <frontend_type>text</frontend_type>
102
+ <sort_order>103</sort_order>
103
+ <show_in_default>1</show_in_default>
104
+ <show_in_website>1</show_in_website>
105
+ <show_in_store>1</show_in_store>
106
+ <comment><![CDATA[For this functionality you need a seperate license key from ShopLogin which is available at the <a href="https://www.shoplogin.com/account/merchant/" target="_blank">ShopLogin Merchant Area</a>.]]>
107
+ </comment>
108
+ <fields>
109
+ <enabled translate="label">
110
+ <label>Enable</label>
111
+ <frontend_type>select</frontend_type>
112
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
113
+ <sort_order>10</sort_order>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>1</show_in_store>
117
+ </enabled>
118
+ <licensekey translate="label">
119
+ <label>License Key</label>
120
+ <frontend_type>text</frontend_type>
121
+ <sort_order>20</sort_order>
122
+ <show_in_default>1</show_in_default>
123
+ <show_in_website>1</show_in_website>
124
+ <show_in_store>1</show_in_store>
125
+ </licensekey>
126
+ <homepage_interesting translate="label">
127
+ <label>Homepage &quot;Interesting Products&quot;</label>
128
+ <frontend_type>select</frontend_type>
129
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
130
+ <sort_order>40</sort_order>
131
+ <show_in_default>1</show_in_default>
132
+ <show_in_website>1</show_in_website>
133
+ <show_in_store>1</show_in_store>
134
+ </homepage_interesting>
135
+ <homepage_popular translate="label">
136
+ <label>Homepage &quot;Popular Products&quot;</label>
137
+ <frontend_type>select</frontend_type>
138
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
139
+ <sort_order>50</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
+ </homepage_popular>
144
+ <rightbar_interesting translate="label">
145
+ <label>Right Bar &quot;Interesting Products&quot;</label>
146
+ <frontend_type>select</frontend_type>
147
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
148
+ <sort_order>60</sort_order>
149
+ <show_in_default>1</show_in_default>
150
+ <show_in_website>1</show_in_website>
151
+ <show_in_store>1</show_in_store>
152
+ </rightbar_interesting>
153
+ <product_viewed translate="label">
154
+ <label>Product Page &quot;Also viewed&quot;</label>
155
+ <frontend_type>select</frontend_type>
156
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
157
+ <sort_order>30</sort_order>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>1</show_in_website>
160
+ <show_in_store>1</show_in_store>
161
+ </product_viewed>
162
+ </fields>
163
+ </settings_recommendation>
164
  </groups>
165
  </shoplogin>
166
  </sections>
app/code/community/ShopLogin/ShopLogin/sql/shoplogin_setup/{mysql4-install-0.9.4.php → mysql4-install-1.4.0.php} RENAMED
@@ -2,7 +2,7 @@
2
  /*
3
  * Log in with ShopLogin for Magento
4
  * https://www.shoplogin.com/for-merchants/
5
- * v0.9.4 for Magento
6
  */
7
 
8
  $installer = $this;
2
  /*
3
  * Log in with ShopLogin for Magento
4
  * https://www.shoplogin.com/for-merchants/
5
+ * v1.4.0 for Magento
6
  */
7
 
8
  $installer = $this;
app/design/adminhtml/default/default/layout/shoplogin.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /*
4
+ * Log in with ShopLogin for Magento
5
+ * https://www.shoplogin.com/for-merchants/
6
+ * v1.4.0 for Magento
7
+ */
8
+ -->
9
+ <layout version="0.1.0">
10
+ <default>
11
+ <reference name="notifications">
12
+ <block type="shoplogin/adminhtml_notifications" name="shoplogin_notifications" template="shoplogin/notifications.phtml" before="-"></block>
13
+ </reference>
14
+ </default>
15
+ </layout>
app/design/adminhtml/default/default/template/shoplogin/notifications.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php if (!$this->isInitialized()): ?>
2
+ <div class="notification-global">
3
+ <strong><?php echo $this->helper('shoplogin')->__('Shoplogin has been installed.') ?></strong>
4
+ <?php echo $this->helper('shoplogin')->__('Please click <a href="%s">here</a> to add your application id.', $this->getManageUrl()) ?>
5
+ </div>
6
+ <?php endif ?>
app/design/frontend/base/default/layout/shoplogin.xml CHANGED
@@ -3,10 +3,24 @@
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
- * v0.9.4 for Magento
7
  */
8
  -->
9
- <layout version="0.9.4">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  <customer_account_login translate="label">
11
  <reference name="content">
12
  <block type="core/template" name="shoplogin.login.button" template="shoplogin/button.phtml" after="customer_form_login" />
@@ -21,21 +35,28 @@
21
  </reference>
22
  </checkout_onepage_index>
23
 
24
- <default translate="label">
25
- <reference name="before_body_end">
26
- <block type="shoplogin/default" after="-" name="shoplogin.footer" template="shoplogin/footer.phtml" />
27
  </reference>
28
- <reference name="head">
29
- <block type="shoplogin/default" name="shoplogin.header" template="shoplogin/header.phtml" />
 
 
 
30
  </reference>
31
- </default>
32
 
33
  <catalog_product_view translate="label">
 
 
 
 
34
  <reference name="head">
35
  <block type="shoplogin/default" after="shoplogin.header" name="shoplogin.product_header" template="shoplogin/product_header.phtml" />
36
  </reference>
37
- <reference name="product.info.addtocart">
38
- <block type="shoplogin/default" name="shoplogin.add_wishlist_button" template="shoplogin/add_wishlist_button.phtml" />
39
  </reference>
40
  </catalog_product_view>
41
 
@@ -45,4 +66,4 @@
45
  </reference>
46
  </checkout_onepage_success>
47
 
48
- </layout>
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
+ * v1.4.0 for Magento
7
  */
8
  -->
9
+ <layout version="1.0.6">
10
+
11
+ <default translate="label">
12
+ <reference name="before_body_end">
13
+ <block type="shoplogin/default" after="-" name="shoplogin.footer" template="shoplogin/footer.phtml" />
14
+ </reference>
15
+ <reference name="head">
16
+ <block type="shoplogin/default" name="shoplogin.header" template="shoplogin/header.phtml" />
17
+ </reference>
18
+ <reference name="right">
19
+ <block type="shoplogin/default" name="shoplogin.recommendation_rightbar" template="shoplogin/recommendation_rightbar.phtml" />
20
+ <block type="shoplogin/default" name="shoplogin.seal" template="shoplogin/seal.phtml" />
21
+ </reference>
22
+ </default>
23
+
24
  <customer_account_login translate="label">
25
  <reference name="content">
26
  <block type="core/template" name="shoplogin.login.button" template="shoplogin/button.phtml" after="customer_form_login" />
35
  </reference>
36
  </checkout_onepage_index>
37
 
38
+ <customer_account_create>
39
+ <reference name="content">
40
+ <block type="core/template" name="shoplogin.login.button" template="shoplogin/button_only.phtml" />
41
  </reference>
42
+ </customer_account_create>
43
+
44
+ <cms_index_index translate="label">
45
+ <reference name="content">
46
+ <block type="shoplogin/default" name="shoplogin.recommendation_homepage" template="shoplogin/recommendation_homepage.phtml" />
47
  </reference>
48
+ </cms_index_index>
49
 
50
  <catalog_product_view translate="label">
51
+ <reference name="product.info.addto">
52
+ <action method="setTemplate"><template>shoplogin/catalog/product/view/addto.phtml</template></action>
53
+ <block type="shoplogin/default" name="shoplogin.wishlist_button" as="shoplogin_wishlist" template="shoplogin/add_wishlist_button.phtml" />
54
+ </reference>
55
  <reference name="head">
56
  <block type="shoplogin/default" after="shoplogin.header" name="shoplogin.product_header" template="shoplogin/product_header.phtml" />
57
  </reference>
58
+ <reference name="product.info.additional">
59
+ <block type="shoplogin/default" name="shoplogin.product_recommendation" template="shoplogin/product_recommendation.phtml" />
60
  </reference>
61
  </catalog_product_view>
62
 
66
  </reference>
67
  </checkout_onepage_success>
68
 
69
+ </layout>
app/design/frontend/base/default/template/shoplogin/add_wishlist_button.phtml CHANGED
@@ -1,3 +1,3 @@
1
- <?php if(Mage::getStoreConfig('shoplogin/settings_wishlist/enabled') && Mage::registry('current_product')) : ?>
2
- <br><br><div class="shoplogin-wishlist" what-is="true" data-href="<?php echo str_replace('"', '&quot;', strip_tags( Mage::registry('current_product')->getProductUrl())); ?>"></div>
3
  <?php endif;?>
1
+ <?php if($this->WishlistEnabled() && Mage::registry('current_product')) : ?>
2
+ <br><br><div class="shoplogin-wishlist" data-href="<?php echo str_replace('"', '&quot;', strip_tags( Mage::registry('current_product')->getProductUrl())); ?>" style="float:left;"></div>
3
  <?php endif;?>
app/design/frontend/base/default/template/shoplogin/button.phtml CHANGED
@@ -1,5 +1,5 @@
1
  <?Php
2
- if(Mage::getStoreConfig('shoplogin/settings_loginwith/enabled') && Mage::getStoreConfig('shoplogin/settings/clientid') && Mage::getStoreConfig('shoplogin/settings/clientsecret'))
3
  {
4
  ?>
5
 
@@ -8,7 +8,7 @@ if(Mage::getStoreConfig('shoplogin/settings_loginwith/enabled') && Mage::getStor
8
  <div class="buttons-set">
9
 
10
  <div class="shoplogin-button" onclick="account_loginwithshoplogin()" what-is="true" style="float:right"></div>
11
- <div style="float:right; line-height:41px; font-weight:bold;"><?php echo $this->__('TIP: For easy Registration and Login we recommend:'); ?>&nbsp;&nbsp;&nbsp;</div>
12
 
13
  </div>
14
  </div>
1
  <?Php
2
+ if(Mage::getStoreConfig('shoplogin/settings_loginwith/enabled') && Mage::getStoreConfig('shoplogin/settings/clientid') && Mage::getStoreConfig('shoplogin/settings/clientsecret'))
3
  {
4
  ?>
5
 
8
  <div class="buttons-set">
9
 
10
  <div class="shoplogin-button" onclick="account_loginwithshoplogin()" what-is="true" style="float:right"></div>
11
+ <div style="float:right; line-height:24px; font-weight:bold;"><?php echo $this->__('For easy Sign up and Log in we recommend:'); ?>&nbsp;&nbsp;&nbsp;</div>
12
 
13
  </div>
14
  </div>
app/design/frontend/base/default/template/shoplogin/button_only.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?Php
2
+ if(Mage::getStoreConfig('shoplogin/settings_loginwith/enabled') && Mage::getStoreConfig('shoplogin/settings/clientid') && Mage::getStoreConfig('shoplogin/settings/clientsecret'))
3
+ {
4
+ ?>
5
+
6
+ <br>
7
+ <div class="col2-set account-login">
8
+ <div class="buttons-set">
9
+
10
+ <div class="shoplogin-button" onclick="account_loginwithshoplogin()" what-is="true" style="float:right"></div>
11
+
12
+ </div>
13
+ </div>
14
+
15
+ <script language="JavaScript" type="text/javascript">
16
+
17
+ function account_loginwithshoplogin()
18
+ {
19
+
20
+ shoplogin.dialog_login("login",
21
+ function(response)
22
+ {
23
+ if(response && response.authorized)
24
+ {
25
+
26
+
27
+ document.location.href="<?php echo $this->getUrl('shoplogin/customer/login')?>?redirect=<?php echo base64_encode($this->helper('core/url')->getCurrentUrl())?>";
28
+
29
+
30
+ }
31
+
32
+ }
33
+ );
34
+
35
+ }
36
+
37
+ </script>
38
+
39
+ <?php
40
+ }
41
+ ?>
app/design/frontend/base/default/template/shoplogin/catalog/product/view/addto.phtml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php $_product = $this->getProduct(); ?>
29
+ <?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?>
30
+
31
+ <ul class="add-to-links">
32
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
33
+ <li><a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
34
+ <?php endif; ?>
35
+ <?php
36
+ $_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
37
+ ?>
38
+ <?php if($_compareUrl) : ?>
39
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
40
+ <?php endif; ?>
41
+ </ul>
42
+
43
+ <?php echo $this->getChildHtml('shoplogin_wishlist');?>
app/design/frontend/base/default/template/shoplogin/checkout_button.phtml CHANGED
@@ -1,15 +1,15 @@
1
  <?Php
2
- if(Mage::getStoreConfig('shoplogin/settings_loginwith/enabled') && Mage::getStoreConfig('shoplogin/settings/clientid') && Mage::getStoreConfig('shoplogin/settings/clientsecret'))
3
  {
4
  ?>
5
 
6
- <br>
7
  <div class="col2-set">
8
- <div class="buttons-set">
9
 
10
- <div class="shoplogin-button" onclick="checkout_loginwithshoplogin()" what-is="true" style="float:right"></div>
11
- <div style="float:right; line-height:41px; font-weight:bold;"><?php echo $this->__('TIP: For easy Registration and Login we recommend:'); ?>&nbsp;&nbsp;&nbsp;</div>
12
-
13
  </div>
14
  </div>
15
 
1
  <?Php
2
+ if(Mage::getStoreConfig('shoplogin/settings_loginwith/enabled') && Mage::getStoreConfig('shoplogin/settings/clientid') && Mage::getStoreConfig('shoplogin/settings/clientsecret'))
3
  {
4
  ?>
5
 
6
+ <br><br>
7
  <div class="col2-set">
8
+ <div class="buttons-set;">
9
 
10
+ <div class="shoplogin-button" onclick="checkout_loginwithshoplogin()" what-is="true" style="float:right"></div>
11
+ <div style="float:right; line-height:24px;"><?php echo $this->__('For easy Sign up and Log in we recommend:'); ?>&nbsp;&nbsp;&nbsp;</div>
12
+
13
  </div>
14
  </div>
15
 
app/design/frontend/base/default/template/shoplogin/checkout_success.phtml CHANGED
@@ -1,62 +1,67 @@
1
  <?php
2
- $customerid = Mage::getSingleton('customer/session')->getCustomerId();
3
- $lastorderid = Mage::getSingleton('checkout/session')->getLastOrderId();
4
- $order = Mage::getSingleton('sales/order');
5
- $order->load($lastorderid);
6
-
7
- $ordernumber = $order->getIncrementId();
8
- $totalamount = $order->getGrandTotal();
9
- $subamount = $order->getSubtotal();
10
- $currency = Mage::app()->getStore()->getCurrentCurrencyCode();
11
- $shipping = $order->getShippingAmount();
12
- $tax = $order->getTaxAmount();
13
-
14
- $data_token = Mage::getModel('shoplogin/shoplogin')->load($customerid, 'customer_id');
15
- $data_token = $data_token->data_token;
 
 
16
  ?>
 
17
  <script>
18
  // minimum data
19
  shoplogin_submit_order = new Object();
20
  shoplogin_submit_order.order_number = '<?php echo $ordernumber; ?>';
 
 
 
 
 
 
 
 
 
 
 
21
  shoplogin_submit_order.data_token = '<?Php echo $data_token; ?>';
22
 
23
  // standard order data
24
- shoplogin_submit_order.amount_currency = '<?Php echo $currency; ?>';
25
  shoplogin_submit_order.amount_total = '<?php echo $totalamount; ?>';
26
  shoplogin_submit_order.amount_items = '<?php echo $subamount; ?>';
27
  shoplogin_submit_order.amount_shipping = '<?Php echo $shipping; ?>';
28
  shoplogin_submit_order.amount_tax = '<?Php echo $tax; ?>';
29
  shoplogin_submit_order.customer_id = '<?php echo $customerid; ?>';
30
 
31
- // affiliate, set to "true" if order is not eligible for ShopLogin-Affiliate
32
- // e.g. if you set up a tracking switch and the traffic came from a different affiliate network
33
- shoplogin_submit_order.affiliate_trackingswitch_noprovision = false;
34
-
35
  <?php
36
- // order data (submit only if user is logined or tracking-plus is activated)
37
- if($this->getIsUserConnected() || $this->TrackingPlusisEnabled)
38
- {
39
- ?>
40
- // order data
41
- shoplogin_submit_order.shoplogin_uid = '<?php echo $is_user_connected; ?>';
42
- shoplogin_submit_order.shopping_cart = new Array();
43
- <?php
44
- $z = 0;
45
- foreach($order->getAllItems() as $items)
46
- {
47
- $product = Mage::getModel('catalog/product')->load($items->getProductId());
48
- ?>
49
-
50
- shoplogin_submit_order.shopping_cart[<?php echo $z; ?>] = new Object();
51
- shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].url = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', $product->getProductUrl())))); ?>';
52
- shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].name = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', $items->getName())))); ?>';
53
- shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].product_id = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', $items->getProductId())))); ?>';
54
- shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].quantity = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', $items->getQtyToInvoice())))); ?>';
55
- shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].price = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', Mage::helper('core')->formatCurrency( $items->getPrice() ) )))); ?>';
56
- <?php
57
- $z++;
58
- }
59
- }
60
  ?>
61
  </script>
 
 
 
62
 
1
  <?php
2
+
3
+ $customerid = Mage::getSingleton('customer/session')->getCustomerId();
4
+ $lastorderid = Mage::getSingleton('checkout/session')->getLastOrderId();
5
+ $order = Mage::getSingleton('sales/order');
6
+ $order->load($lastorderid);
7
+
8
+ $ordernumber = $order->getIncrementId();
9
+ $totalamount = $order->getGrandTotal();
10
+ $subamount = $order->getSubtotal();
11
+ $currency = Mage::app()->getStore()->getCurrentCurrencyCode();
12
+ $shipping = $order->getShippingAmount();
13
+ $tax = $order->getTaxAmount();
14
+
15
+ $data_token = Mage::getModel('shoplogin/shoplogin')->load($customerid, 'customer_id');
16
+ $data_token = $data_token->data_token;
17
+
18
  ?>
19
+
20
  <script>
21
  // minimum data
22
  shoplogin_submit_order = new Object();
23
  shoplogin_submit_order.order_number = '<?php echo $ordernumber; ?>';
24
+ shoplogin_submit_order.eligible_aff = true;
25
+ shoplogin_submit_order.amount_aff = '<?php echo $subamount; ?>';
26
+ shoplogin_submit_order.amount_currency = '<?Php echo $currency; ?>';
27
+ </script>
28
+
29
+ <?php
30
+ if($this->getIsUserConnected() || ($this->RecommendationEnabled() && $this->getRecommendationLicenseKey()) )
31
+ {
32
+ ?>
33
+ <script>
34
+ // user token
35
  shoplogin_submit_order.data_token = '<?Php echo $data_token; ?>';
36
 
37
  // standard order data
 
38
  shoplogin_submit_order.amount_total = '<?php echo $totalamount; ?>';
39
  shoplogin_submit_order.amount_items = '<?php echo $subamount; ?>';
40
  shoplogin_submit_order.amount_shipping = '<?Php echo $shipping; ?>';
41
  shoplogin_submit_order.amount_tax = '<?Php echo $tax; ?>';
42
  shoplogin_submit_order.customer_id = '<?php echo $customerid; ?>';
43
 
44
+ // order details
45
+ shoplogin_submit_order.shoplogin_uid = '<?php echo $this->getIsUserConnected(); ?>';
46
+ shoplogin_submit_order.shopping_cart = new Array();
 
47
  <?php
48
+ $z = 0;
49
+ foreach($order->getAllItems() as $items)
50
+ {
51
+ $product = Mage::getModel('catalog/product')->load($items->getProductId());
52
+ ?>
53
+ shoplogin_submit_order.shopping_cart[<?php echo $z; ?>] = new Object();
54
+ shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].url = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', $product->getProductUrl())))); ?>';
55
+ shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].name = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', $items->getName())))); ?>';
56
+ shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].product_id = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', $items->getProductId())))); ?>';
57
+ shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].quantity = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', $items->getQtyToInvoice())))); ?>';
58
+ shoplogin_submit_order.shopping_cart[<?php echo $z; ?>].price = '<?php echo addslashes(strip_tags(str_replace('\r', '', str_replace('\n', '', Mage::helper('core')->formatCurrency( $items->getPrice() ) )))); ?>';
59
+ <?php
60
+ $z++;
61
+ }
 
 
 
 
 
 
 
 
 
 
62
  ?>
63
  </script>
64
+ <?php
65
+ }
66
+ ?>
67
 
app/design/frontend/base/default/template/shoplogin/footer.phtml CHANGED
@@ -4,7 +4,8 @@ window.shoploginasyncinit = function() {
4
  shoplogin.init({
5
  appid : '<?php echo $this->getClientId(); ?>',
6
  version : 'magento-<?php echo Mage::getConfig()->getModuleConfig("ShopLogin_ShopLogin")->version; ?>',
7
- language : '<?php echo Mage::app()->getLocale()->getDefaultLocale(); ?>'
 
8
  });
9
  };
10
 
4
  shoplogin.init({
5
  appid : '<?php echo $this->getClientId(); ?>',
6
  version : 'magento-<?php echo Mage::getConfig()->getModuleConfig("ShopLogin_ShopLogin")->version; ?>',
7
+ language : '<?php echo Mage::app()->getLocale()->getDefaultLocale(); ?>'<?php if($this->RecommendationEnabled() && $this->getRecommendationLicenseKey()) : ?>,
8
+ recommendation : '<?php echo $this->getRecommendationLicenseKey(); ?>'<?php endif;?>
9
  });
10
  };
11
 
app/design/frontend/base/default/template/shoplogin/product_recommendation.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php if($this->RecommendationEnabled('product_viewed') && $this->getRecommendationLicenseKey() && Mage::registry('current_product')) : ?>
2
+
3
+ <br><h2><?php echo $this->__('Customers who viewed this article also viewed:'); ?></h2>
4
+ <div class="shoplogin-recommendation" data-href="<?php echo str_replace('"', '&quot;', strip_tags( Mage::registry('current_product')->getProductUrl())); ?>" data-style="row" data-show="product"></div>
5
+
6
+ <?php endif;?>
app/design/frontend/base/default/template/shoplogin/recommendation_homepage.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if($this->RecommendationEnabled('homepage_interesting') && $this->getRecommendationLicenseKey()) : ?>
2
+
3
+ <h2><?php echo $this->__('You might like these products:'); ?></h2>
4
+ <div class="shoplogin-recommendation" data-style="row" data-show="recommend"></div>
5
+
6
+ <?php endif; ?>
7
+
8
+
9
+
10
+ <?php if($this->RecommendationEnabled('homepage_popular') && $this->getRecommendationLicenseKey() && $this->getClientId() && $this->getClientSecret()) : ?>
11
+
12
+ <h2><?php echo $this->__('Currently popular products:'); ?></h2>
13
+ <div class="shoplogin-recommendation" data-style="row" data-show="hot"></div>
14
+
15
+ <?php endif;?>
app/design/frontend/base/default/template/shoplogin/recommendation_rightbar.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php if($this->RecommendationEnabled('rightbar_interesting') && $this->getRecommendationLicenseKey()) : ?>
2
+
3
+ <div class="block">
4
+ <div class="block-title">
5
+ <strong><span><?php echo $this->__('Interesting products'); ?></span></strong>
6
+ </div>
7
+ <div class="shoplogin-recommendation" data-style="col" data-show="recommend"></div>
8
+ </div>
9
+
10
+ <?php endif;?>
app/design/frontend/base/default/template/shoplogin/seal.phtml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php if($this->ShowSeal() && $this->getClientId()) : ?>
2
+
3
+ <center>
4
+ <a href="https://www.shoplogin.com/" target="_blank" class="shoplogin-seal">Comfort by ShopLogin</a>
5
+ </center>
6
+
7
+ <?php endif;?>
app/etc/modules/ShopLogin_ShopLogin.xml CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
- * v0.9.4 for Magento
7
  */
8
  -->
9
  <config>
@@ -11,7 +11,7 @@
11
  <ShopLogin_ShopLogin>
12
  <active>true</active>
13
  <codePool>community</codePool>
14
- <version>0.9.4</version>
15
  </ShopLogin_ShopLogin>
16
  </modules>
17
  </config>
3
  /*
4
  * Log in with ShopLogin for Magento
5
  * https://www.shoplogin.com/for-merchants/
6
+ * v1.4.0 for Magento
7
  */
8
  -->
9
  <config>
11
  <ShopLogin_ShopLogin>
12
  <active>true</active>
13
  <codePool>community</codePool>
14
+ <version>1.4.0</version>
15
  </ShopLogin_ShopLogin>
16
  </modules>
17
  </config>
app/locale/de_DE/ShopLogin_ShopLogin.csv CHANGED
@@ -1,3 +1,20 @@
1
- "TIP: For easy Registration and Login we recommend:","TIPP: Verwenden Sie f&uuml;r bequemes Registrieren und Anmelden:"
2
  "Error: You could not be logged in with ShopLogin, because your ShopLogin account is not confirmed. ShopLogin sent you an activiation link to your email address. Please click on the included link to activate your account.", "Fehler: Sie konnten nicht mit ShopLogin angemeldet werden, da Ihr Shoplogin-Account nicht bestätigt wurde. ShopLogin hat Ihnen einen Aktivierungslink per E-Mail geschickt. Bitte klicken Sie auf den enthaltenen Link um Ihr Konto zu aktivieren."
3
- "Resend&nbsp;Activation&nbsp;Email", "Aktivierungs-eMail&nbsp;erneut&nbsp;senden"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "For easy Sign up and Log in we recommend:","Unsere Empfehlung f&uuml;r bequemes Registrieren und Anmelden:"
2
  "Error: You could not be logged in with ShopLogin, because your ShopLogin account is not confirmed. ShopLogin sent you an activiation link to your email address. Please click on the included link to activate your account.", "Fehler: Sie konnten nicht mit ShopLogin angemeldet werden, da Ihr Shoplogin-Account nicht bestätigt wurde. ShopLogin hat Ihnen einen Aktivierungslink per E-Mail geschickt. Bitte klicken Sie auf den enthaltenen Link um Ihr Konto zu aktivieren."
3
+ "Resend&nbsp;Activation&nbsp;Email", "Aktivierungs-eMail&nbsp;erneut&nbsp;senden"
4
+ "Customers who viewed this article also viewed:", "Kunden, die diesen Artikel angesehen haben, haben auch angesehen:"
5
+ "You might like these products:", "Diese Produkte k&ouml;nnten Sie interessieren:"
6
+ "Currently popular products:", "Zurzeit beliebte Produkte:"
7
+ "Interesting products", "Interessante Produkte"
8
+ "Show ShopLogin Seal", "ShopLogin-Siegel anzeigen"
9
+ "Product Page &quot;Also viewed&quot;", "Produktseite Produktseite &quot;Auch angesehen&quot;"
10
+ "Right Bar &quot;Interesting Products&quot;", "Rechte Spalte &quot;Interessante Produkte&quot;"
11
+ "Homepage &quot;Popular Products&quot;", "Startseite &quot;Beliebte Produkte&quot;"
12
+ "Homepage &quot;Interesting Products&quot;", "Startseite &quot;Interessante Produkte&quot;"
13
+ "Show ShopLogin Seal", "ShopLogin-Siegel anzeigen"
14
+ "Wishlist by ShopLogin", "Wunschzettel von ShopLogin"
15
+ "Product Recommendation", "Produktempfehlungen von ShopLogin"
16
+ "Login with ShopLogin", "Login mit ShopLogin"
17
+ "Product Page \"Also viewed\"", "Produktseite \"Auch angesehen\""
18
+ "Homepage \"Interesting Products\"", "Startseite \"Interessante Produkte\""
19
+ "Homepage \"Popular Products\"", "Startseite \"Beliebte Produkte\""
20
+ "Right Bar \"Interesting Products\"", "Seitenleiste \"Interessante Produkte\""
package.xml CHANGED
@@ -1,14 +1,14 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ShopLogin_ShopLogin</name>
4
- <version>0.9.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Basis Extension for ShopLogin including the Plugins "Log in with ShopLogin" and "ShopLogin global Wish List".</summary>
10
  <description>This Extension is the Basis Extension for ShopLogin.&#xD;
11
- It includes the Plugins "Log in with ShopLogin" and "ShopLogin global Wish List".&#xD;
12
  &#xD;
13
  More Comfort for your Customers.&#xD;
14
  Better Usability. Higher Conversion Rate.&amp;#xD;&#xD;
@@ -17,9 +17,100 @@ Visit https://www.shoplogin.com/for-merchants/ for more informations and technic
17
  Register your Online Store (https://www.shoplogin.com/en/account/merchant/) and insert your App-ID and App Secret in the "ShopLogin"-Tab in your Magento configuration panel. After that you can easily activate the ShopLogin-Features.</description>
18
  <notes>Basis Extension for ShopLogin including the Plugins "Log in with ShopLogin" and "ShopLogin global Wish List".</notes>
19
  <authors><author><name>Shoplogin</name><user>ShopLogin</user><email>developers@shoplogin.com</email></author></authors>
20
- <date>2014-08-04</date>
21
- <time>01:35:00</time>
22
- <contents><target name="magecommunity"><dir name="ShopLogin"><dir name="ShopLogin"><dir name="Block"><file name="Default.php" hash="aeb330326b940ae22216bca7bb523ebc"/></dir><dir name="controllers"><file name="CustomerController.php" hash="de602d16728b7ffa59e0ac122ebd220f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6c509d882d0e17084a1796d34e0e3f35"/><file name="config.xml" hash="a1f669649b5a973e7db0a5bea34281b0"/><file name="system.xml" hash="a452dea449525f4aea5898c9184d3ad0"/></dir><dir name="Helper"><file name="Data.php" hash="8ec899a6f392613ceef416be5cda1759"/></dir><dir name="Model"><file name="Shoplogin.php" hash="ca07181f612231d33e7e986678a3a460"/></dir><dir name="sql"><dir name="shoplogin_setup"><file name="mysql4-install-0.9.4.php" hash="a629494dfbe4a56189293c26ad39e117"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ShopLogin_ShopLogin.xml" hash="962ffd2bbf33a9a3ad86db93f3a5ce62"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="ShopLogin_ShopLogin.csv" hash="23ff0831c86652c987a1cabf8571376b"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shoplogin.xml" hash="08df1896255090d0394a4b98f5979dbd"/></dir><dir name="template"><dir name="shoplogin"><file name="add_wishlist_button.phtml" hash="0611c3d710fc785f33e02bf8fe014c14"/><file name="button.phtml" hash="6014e749e66dc0eddb17ff6be33c0ebf"/><file name="checkout_button.phtml" hash="5be2b6c9554ba6b7b31dc07ba54466d6"/><file name="checkout_login.phtml" hash="26ccf5a880642ba022aa996ef2279bac"/><file name="checkout_success.phtml" hash="25a9e74b116623cf9b3af5e63bd5e06d"/><file name="footer.phtml" hash="9d8823be096d8b13288e0be23c04b956"/><file name="header.phtml" hash="dbc5caf220c55aa6db217e0e5313103b"/><file name="product_header.phtml" hash="7e82d0c7c30fdcc4782317395782d251"/></dir></dir></dir></dir></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  <compatible/>
24
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0.0</min><max>1.9.0.1</max></package><extension><name>curl</name><min></min><max></max></extension></required></dependencies>
25
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ShopLogin_ShopLogin</name>
4
+ <version>1.4.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Basis Extension for ShopLogin including the Plugins "Log in with ShopLogin", "ShopLogin Wish List" and "ShopLogin Recommendation".</summary>
10
  <description>This Extension is the Basis Extension for ShopLogin.&#xD;
11
+ It includes the Plugins "Log in with ShopLogin", "ShopLogin Wish List" and "ShopLogin Recommendation".&#xD;
12
  &#xD;
13
  More Comfort for your Customers.&#xD;
14
  Better Usability. Higher Conversion Rate.&amp;#xD;&#xD;
17
  Register your Online Store (https://www.shoplogin.com/en/account/merchant/) and insert your App-ID and App Secret in the "ShopLogin"-Tab in your Magento configuration panel. After that you can easily activate the ShopLogin-Features.</description>
18
  <notes>Basis Extension for ShopLogin including the Plugins "Log in with ShopLogin" and "ShopLogin global Wish List".</notes>
19
  <authors><author><name>Shoplogin</name><user>ShopLogin</user><email>developers@shoplogin.com</email></author></authors>
20
+ <date>2014-12-19</date>
21
+ <time>12:00:00</time>
22
+ <contents>
23
+ <target name="magecommunity">
24
+ <dir name="ShopLogin">
25
+ <dir name="ShopLogin">
26
+ <dir name="Block">
27
+ <dir name="Adminhtml">
28
+ <file name="Notifications.php" hash=""/>
29
+ </dir>
30
+ <file name="Default.php" hash=""/>
31
+ </dir>
32
+ <dir name="Helper">
33
+ <file name="Data.php" hash=""/>
34
+ </dir>
35
+ <dir name="Model">
36
+ <file name="Shoplogin.php" hash=""/>
37
+ </dir>
38
+ <dir name="controllers">
39
+ <file name="CustomerController.php" hash=""/>
40
+ </dir>
41
+ <dir name="etc">
42
+ <file name="adminhtml.xml" hash=""/>
43
+ <file name="config.xml" hash=""/>
44
+ <file name="system.xml" hash=""/>
45
+ </dir>
46
+ <dir name="sql">
47
+ <dir name="shoplogin_setup">
48
+ <file name="mysql4-install-1.4.0.php" hash=""/>
49
+ </dir>
50
+ </dir>
51
+ </dir>
52
+ </dir>
53
+ </target>
54
+ <target name="mageetc">
55
+ <dir name="modules">
56
+ <file name="ShopLogin_ShopLogin.xml" hash=""/>
57
+ </dir>
58
+ </target>
59
+ <target name="magelocale">
60
+ <dir name="de_DE">
61
+ <file name="ShopLogin_ShopLogin.csv" hash=""/>
62
+ </dir>
63
+ </target>
64
+ <target name="magedesign">
65
+ <dir name="adminhtml">
66
+ <dir name="default">
67
+ <dir name="default">
68
+ <dir name="layout">
69
+ <file name="shoplogin.xml" hash=""/>
70
+ </dir>
71
+ <dir name="template">
72
+ <dir name="shoplogin">
73
+ <file name="notifications.phtml" hash=""/>
74
+ </dir>
75
+ </dir>
76
+ </dir>
77
+ </dir>
78
+ </dir>
79
+ <dir name="frontend">
80
+ <dir name="base">
81
+ <dir name="default">
82
+ <dir name="layout">
83
+ <file name="shoplogin.xml" hash=""/>
84
+ </dir>
85
+ <dir name="template">
86
+ <dir name="shoplogin">
87
+ <dir name="catalog">
88
+ <dir name="product">
89
+ <dir name="view">
90
+ <file name="addto.phtml" hash=""/>
91
+ </dir>
92
+ </dir>
93
+ </dir>
94
+ <file name="add_wishlist_button.phtml" hash=""/>
95
+ <file name="button.phtml" hash=""/>
96
+ <file name="button_only.phtml" hash=""/>
97
+ <file name="checkout_button.phtml" hash=""/>
98
+ <file name="checkout_login.phtml" hash=""/>
99
+ <file name="checkout_success.phtml" hash=""/>
100
+ <file name="footer.phtml" hash=""/>
101
+ <file name="header.phtml" hash=""/>
102
+ <file name="product_header.phtml" hash=""/>
103
+ <file name="product_recommendation.phtml" hash=""/>
104
+ <file name="recommendation_homepage.phtml" hash=""/>
105
+ <file name="recommendation_rightbar.phtml" hash=""/>
106
+ <file name="seal.phtml" hash=""/>
107
+ </dir>
108
+ </dir>
109
+ </dir>
110
+ </dir>
111
+ </dir>
112
+ </target>
113
+ </contents>
114
  <compatible/>
115
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0.0</min><max>1.9.0.1</max></package><extension><name>curl</name><min></min><max></max></extension></required></dependencies>
116
  </package>
shoplogin.xml CHANGED
@@ -1,5 +1,5 @@
1
  <_>
2
- <form_key>g3j5wUWYJ0qAmoKq</form_key>
3
  <name>ShopLogin_ShopLogin</name>
4
  <channel>community</channel>
5
  <version_ids>
@@ -16,7 +16,7 @@ Visit https://www.shoplogin.com/for-merchants/ for more informations and technic
16
  Register your Online Store (https://www.shoplogin.com/en/account/merchant/) and insert your App-ID and App Secret in the &quot;ShopLogin&quot;-Tab in your Magento configuration panel. After that you can easily activate the ShopLogin-Features.</description>
17
  <license>OSL v3.0</license>
18
  <license_uri>http://opensource.org/licenses/osl-3.0.php</license_uri>
19
- <version>0.9.4</version>
20
  <stability>stable</stability>
21
  <notes>Basis Extension for ShopLogin including the Plugins &quot;Log in with ShopLogin&quot; and &quot;ShopLogin global Wish List&quot;.</notes>
22
  <authors>
1
  <_>
2
+ <form_key>shoplogin</form_key>
3
  <name>ShopLogin_ShopLogin</name>
4
  <channel>community</channel>
5
  <version_ids>
16
  Register your Online Store (https://www.shoplogin.com/en/account/merchant/) and insert your App-ID and App Secret in the &quot;ShopLogin&quot;-Tab in your Magento configuration panel. After that you can easily activate the ShopLogin-Features.</description>
17
  <license>OSL v3.0</license>
18
  <license_uri>http://opensource.org/licenses/osl-3.0.php</license_uri>
19
+ <version>1.4.0</version>
20
  <stability>stable</stability>
21
  <notes>Basis Extension for ShopLogin including the Plugins &quot;Log in with ShopLogin&quot; and &quot;ShopLogin global Wish List&quot;.</notes>
22
  <authors>