Ecwid Ecommerce Shopping Cart - Version 0.9

Version Description

  • [+] The "Single Sign-on" feature has been added. This feature allows your customers to sign into your WordPress site and fully use your store without having to sign into Ecwid.
Download this release

Release Info

Developer Ecwid
Plugin Icon 128x128 Ecwid Ecommerce Shopping Cart
Version 0.9
Comparing to
See all releases

Code changes from version 0.8 to 0.9

ecwid-shopping-cart.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Ecwid Shopping Cart
4
  Plugin URI: http://www.ecwid.com/
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integreted with any Wordpress blog and takes less than 5 minutes to set up.
6
  Author: Ecwid Team
7
- Version: 0.8
8
  Author URI: http://www.ecwid.com/
9
  */
10
 
@@ -53,6 +53,7 @@ function ecwid_get_scriptjs_code() {
53
  $store_id = get_ecwid_store_id();
54
  $s = "<script type=\"text/javascript\" src=\"$ecwid_protocol://" . APP_ECWID_COM . "/script.js?$store_id\"></script>";
55
  define('ECWID_SCRIPTJS','Yep');
 
56
  return $s;
57
  } else {
58
  return;
@@ -206,6 +207,8 @@ EOT;
206
  add_option("ecwid_default_category_id", '', '', 'yes');
207
 
208
  add_option("ecwid_noscript_seo_catalog", '', '', 'yes');
 
 
209
 
210
  $id = get_option("ecwid_store_page_id");
211
  $_tmp_page = null;
@@ -281,7 +284,8 @@ function ecwid_settings_api_init() {
281
  register_setting('ecwid_options_page', 'ecwid_default_category_id');
282
 
283
  register_setting('ecwid_options_page', 'ecwid_noscript_seo_catalog');
284
-
 
285
  }
286
 
287
  function ecwid_options_add_page() {
@@ -307,7 +311,9 @@ function ecwid_options_do_page() {
307
  $ecwid_noscript_seo_catalog = get_option('ecwid_noscript_seo_catalog');
308
  $ecwid_enable_ssl = get_option('ecwid_enable_ssl');
309
  $ecwid_page_id = get_option("ecwid_store_page_id");
310
-
 
 
311
  $ecwid_noscript_seo_catalog_disabled = false;
312
  $ecwid_noscript_seo_catalog_message = '<a href="http://kb.ecwid.com/Inline-SEO-Catalog" target="_blank">How it works</a>';
313
  $ecwid_settings_message = false;
@@ -479,7 +485,25 @@ Full link to your mobile catalog</label>
479
  </td> </tr>
480
 
481
  <tr><th colspan="2" style="padding:0px;margin:0px;"><h3 style="padding:0px;margin:0px;">Advanced</h3></th></tr>
482
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
483
  <tr><th scope="row"><label for="ecwid_enable_ssl">
484
  Enable the following option, if you use Ecwid on a secure HTTPS page</label>
485
  </th>
@@ -803,6 +827,77 @@ function ecwid_sidebar_widgets_init() {
803
  register_widget('EcwidVCategoriesWidget');
804
  register_widget('EcwidMinicartMiniViewWidget');
805
  }
 
806
  add_action('widgets_init', 'ecwid_sidebar_widgets_init');
807
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
808
  ?>
4
  Plugin URI: http://www.ecwid.com/
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integreted with any Wordpress blog and takes less than 5 minutes to set up.
6
  Author: Ecwid Team
7
+ Version: 0.9
8
  Author URI: http://www.ecwid.com/
9
  */
10
 
53
  $store_id = get_ecwid_store_id();
54
  $s = "<script type=\"text/javascript\" src=\"$ecwid_protocol://" . APP_ECWID_COM . "/script.js?$store_id\"></script>";
55
  define('ECWID_SCRIPTJS','Yep');
56
+ $s = $s . ecwid_sso();
57
  return $s;
58
  } else {
59
  return;
207
  add_option("ecwid_default_category_id", '', '', 'yes');
208
 
209
  add_option("ecwid_noscript_seo_catalog", '', '', 'yes');
210
+
211
+ add_option("ecwid_sso_secret_key", '', '', 'yes');
212
 
213
  $id = get_option("ecwid_store_page_id");
214
  $_tmp_page = null;
284
  register_setting('ecwid_options_page', 'ecwid_default_category_id');
285
 
286
  register_setting('ecwid_options_page', 'ecwid_noscript_seo_catalog');
287
+
288
+ register_setting('ecwid_options_page', 'ecwid_sso_secret_key');
289
  }
290
 
291
  function ecwid_options_add_page() {
311
  $ecwid_noscript_seo_catalog = get_option('ecwid_noscript_seo_catalog');
312
  $ecwid_enable_ssl = get_option('ecwid_enable_ssl');
313
  $ecwid_page_id = get_option("ecwid_store_page_id");
314
+
315
+ $ecwid_sso_secret_key = get_option("ecwid_sso_secret_key");
316
+
317
  $ecwid_noscript_seo_catalog_disabled = false;
318
  $ecwid_noscript_seo_catalog_message = '<a href="http://kb.ecwid.com/Inline-SEO-Catalog" target="_blank">How it works</a>';
319
  $ecwid_settings_message = false;
485
  </td> </tr>
486
 
487
  <tr><th colspan="2" style="padding:0px;margin:0px;"><h3 style="padding:0px;margin:0px;">Advanced</h3></th></tr>
488
+
489
+ <tr><th scope="row"><label for="ecwid_enable_ssl">
490
+ Single Sign-on Secret Key: </label>
491
+ </th>
492
+ <td>
493
+ <table>
494
+ <tr>
495
+ <td style="padding-top:0;padding-left:0;vertical-align:top;">
496
+ <input id="ecwid_sso_secret_key" type="text" name="ecwid_sso_secret_key" value="<?php echo $ecwid_sso_secret_key; ?>" />
497
+ </td>
498
+ <td style="padding:0;vertical-align:top;">
499
+ <img src="//www.ecwid.com/wp-content/uploads/ecwid_wp_attention.gif" alt="">&nbsp;This feature allows your customers to sign into your WordPress site and fully use your store without having to sign into Ecwid. I.e. if a customer is logged in to your site, he/she is logged in to your store automatically, even if he/she didn't have an account in your store before. In order to enable this feature you should set the secret key that can be found on the "System Settings > API > Single Sign-on API" page in your Ecwid control panel. Please note that this API is available only to <a href="http://www.ecwid.com/compare-plans.html">paid users</a>.
500
+ </td>
501
+ </tr>
502
+ </table>
503
+
504
+ </td> </tr>
505
+
506
+
507
  <tr><th scope="row"><label for="ecwid_enable_ssl">
508
  Enable the following option, if you use Ecwid on a secure HTTPS page</label>
509
  </th>
827
  register_widget('EcwidVCategoriesWidget');
828
  register_widget('EcwidMinicartMiniViewWidget');
829
  }
830
+
831
  add_action('widgets_init', 'ecwid_sidebar_widgets_init');
832
 
833
+ function ecwid_encode_json($data) {
834
+ if(version_compare(PHP_VERSION,"5.2.0",">=")) {
835
+ return json_encode($data);
836
+ } else {
837
+ include_once(ABSPATH . 'wp-content/plugins/ecwid-shopping-cart/lib/JSON.php');
838
+ $json_parser = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
839
+ return $json_parser->encode($data);
840
+ }
841
+ }
842
+
843
+
844
+
845
+ function ecwid_sso() {
846
+ $key = get_option('ecwid_sso_secret_key');
847
+ if (empty($key)) {
848
+ return "";
849
+ }
850
+
851
+ global $current_user;
852
+ get_currentuserinfo();
853
+
854
+ if ($current_user->ID) {
855
+ $user_data = array(
856
+ 'appId' => "wp_" . get_ecwid_store_id(),
857
+ 'userId' => "{$current_user->ID}",
858
+ 'profile' => array(
859
+ 'email' => $current_user->user_email,
860
+ 'billingPerson' => array(
861
+ 'name' => $current_user->display_name
862
+ )
863
+ )
864
+ );
865
+ $user_data = base64_encode(ecwid_encode_json($user_data));
866
+ $time = time();
867
+ $hmac = ecwid_hmacsha1("$user_data $time", $key);
868
+ return "<script> var ecwid_sso_profile='$user_data $hmac $time' </script>";
869
+ }
870
+ else {
871
+ return "<script> var ecwid_sso_profile='' </script>";
872
+ }
873
+
874
+
875
+ }
876
+
877
+ // from: http://www.php.net/manual/en/function.sha1.php#39492
878
+
879
+ function ecwid_hmacsha1($data, $key) {
880
+ if (function_exists("hash_hmac")) {
881
+ return hash_hmac('sha1', $data, $key);
882
+ } else {
883
+ $blocksize=64;
884
+ $hashfunc='sha1';
885
+ if (strlen($key)>$blocksize)
886
+ $key=pack('H*', $hashfunc($key));
887
+ $key=str_pad($key,$blocksize,chr(0x00));
888
+ $ipad=str_repeat(chr(0x36),$blocksize);
889
+ $opad=str_repeat(chr(0x5c),$blocksize);
890
+ $hmac = pack(
891
+ 'H*',$hashfunc(
892
+ ($key^$opad).pack(
893
+ 'H*',$hashfunc(
894
+ ($key^$ipad).$data
895
+ )
896
+ )
897
+ )
898
+ );
899
+ return bin2hex($hmac);
900
+ }
901
+ }
902
+
903
  ?>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: Ecwid Team
3
  Tags: shopping cart, ecommerce, e-commerce, paypal, google checkout, 2checkout, store, shop, product catalog, inventory
4
  Requires at least: 2.8
5
- Tested up to: 3.2
6
- Stable tag: 0.8
7
 
8
  Ecwid is a free full-featured shopping cart that can easily be added to any blog
9
  and takes less than 5 minutes to set up.
@@ -36,12 +36,26 @@ Links
36
  2. Activate the plugin through the 'Plugins' menu in WordPress
37
  3. Setup the plugin on the 'Settings -> Ecwid shopping cart' page.
38
 
 
 
 
 
 
 
 
 
 
 
 
39
  == Frequently Asked Questions ==
40
 
41
  - FAQ: [http://www.ecwid.com/faq.html](http://www.ecwid.com/faq.html)
42
  - Knowledge Base: [http://kb.ecwid.com](http://kb.ecwid.com)
43
 
44
  == Changelog ==
 
 
 
45
  = 0.8 =
46
  - [+] New minicart widget: http://kb.ecwid.com/w/page/15853298/Minicart#Miniview
47
  - [+] Stores are loaded faster now, if some Ecwid sidebar widgets are enabled.
2
  Contributors: Ecwid Team
3
  Tags: shopping cart, ecommerce, e-commerce, paypal, google checkout, 2checkout, store, shop, product catalog, inventory
4
  Requires at least: 2.8
5
+ Tested up to: 3.3
6
+ Stable tag: 0.9
7
 
8
  Ecwid is a free full-featured shopping cart that can easily be added to any blog
9
  and takes less than 5 minutes to set up.
36
  2. Activate the plugin through the 'Plugins' menu in WordPress
37
  3. Setup the plugin on the 'Settings -> Ecwid shopping cart' page.
38
 
39
+ == Screenshots ==
40
+
41
+ 1. Store home page
42
+ 2. Category page
43
+ 3. Product details page
44
+ 4. Shopping bag
45
+ 5. Ecwid control panel
46
+ 6. Adding new product
47
+ 7. Shipping settings
48
+ 8. Translations
49
+
50
  == Frequently Asked Questions ==
51
 
52
  - FAQ: [http://www.ecwid.com/faq.html](http://www.ecwid.com/faq.html)
53
  - Knowledge Base: [http://kb.ecwid.com](http://kb.ecwid.com)
54
 
55
  == Changelog ==
56
+ = 0.9 =
57
+ - [+] The "Single Sign-on" feature has been added. This feature allows your customers to sign into your WordPress site and fully use your store without having to sign into Ecwid.
58
+
59
  = 0.8 =
60
  - [+] New minicart widget: http://kb.ecwid.com/w/page/15853298/Minicart#Miniview
61
  - [+] Stores are loaded faster now, if some Ecwid sidebar widgets are enabled.
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
screenshot-5.png ADDED
Binary file
screenshot-6.png ADDED
Binary file
screenshot-7.png ADDED
Binary file
screenshot-8.png ADDED
Binary file