Changeset 541155
- Timestamp:
- 05/08/2012 04:37:40 AM (14 years ago)
- Location:
- e-commerce-multi-currency-support
- Files:
-
- 3 edited
- 6 copied
-
tags/0.6.2 (copied) (copied from e-commerce-multi-currency-support/trunk)
-
tags/0.6.2/config.php (copied) (copied from e-commerce-multi-currency-support/trunk/config.php)
-
tags/0.6.2/config_admin.php (copied) (copied from e-commerce-multi-currency-support/trunk/config_admin.php)
-
tags/0.6.2/readme.txt (copied) (copied from e-commerce-multi-currency-support/trunk/readme.txt) (2 diffs)
-
tags/0.6.2/widgets/currency_chooser_widget.php (copied) (copied from e-commerce-multi-currency-support/trunk/widgets/currency_chooser_widget.php) (3 diffs)
-
tags/0.6.2/wpsc-currency-changer.php (copied) (copied from e-commerce-multi-currency-support/trunk/wpsc-currency-changer.php) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/widgets/currency_chooser_widget.php (modified) (3 diffs)
-
trunk/wpsc-currency-changer.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
e-commerce-multi-currency-support/tags/0.6.2/readme.txt
r540820 r541155 4 4 Requires at least: 2.9 5 5 Tested up to: 3.1.1 6 Stable tag: 0.6. 16 Stable tag: 0.6.2 7 7 8 8 … … 17 17 18 18 == Changelog == 19 = 0.6.2 = 20 - fixed defaulting to incorrect country in drop-down list. 19 21 = 0.6.1 = 20 22 - fixed issue with source price bigger than 1000 -
e-commerce-multi-currency-support/tags/0.6.2/widgets/currency_chooser_widget.php
r525847 r541155 24 24 //Display Currency Info: 25 25 $sql ="SELECT * FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `visible`='1' ORDER BY `country` ASC"; 26 //echo $_SESSION['wpsc_base_currency_ code'];26 //echo $_SESSION['wpsc_base_currency_isocode']; 27 27 $countries = $wpdb->get_results($sql, ARRAY_A); 28 28 $output .= '<form method="post" action="" id="wpsc-mcs-widget-form">'; … … 30 30 if (!isset($_SESSION['wpsc_base_currency_code'])) 31 31 { 32 $currency_code = $wpdb->get_results("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A);32 $currency_code = $wpdb->get_results("SELECT `code`,`isocode` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A); 33 33 $local_currency_code = $currency_code[0]['code']; 34 $local_currency_isocode = $currency_code[0]['isocode']; 34 35 }else{ 35 36 $local_currency_code=$_SESSION['wpsc_base_currency_code']; … … 39 40 if ($instance['show_code'] == 1) $country_code =" (".$country['code'].")"; 40 41 $selected_code = ''; 41 if($_SESSION['wpsc_ currency_code'] == $country['id']){42 if($_SESSION['wpsc_base_currency_isocode'] == $country['isocode']){ 42 43 $selected_code = "selected='selected'"; 43 44 44 45 }else { 45 if ( !isset($_SESSION['wpsc_ currency_code']) && $local_currency_code == $country['code'])46 if ( !isset($_SESSION['wpsc_base_currency_isocode']) && $local_currency_isocode == $country['isocode']) 46 47 $selected_code = "selected='selected'"; 47 48 } -
e-commerce-multi-currency-support/tags/0.6.2/wpsc-currency-changer.php
r540820 r541155 4 4 Plugin URI: http://misha.beshkin.lv 5 5 Description: A plugin that provides a currency converter tool integrated into the WordPress Shopping Cart. This is trunk from wp-e-commerce-multi-currency-magic plugin. 6 Version: 0.6. 16 Version: 0.6.2 7 7 Author: Misha Beshkin 8 8 Author URI: http://misha.beshkin.lv … … 30 30 31 31 // Get currency settings 32 $currency_code = $wpdb->get_results("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A);32 $currency_code = $wpdb->get_results("SELECT `code`,`isocode` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A); 33 33 34 34 $local_currency_code = $currency_code[0]['code']; 35 $local_currency_isocode = $currency_code[0]['isocode']; 35 36 $_SESSION['wpsc_base_currency_code'] = $local_currency_code; 37 $_SESSION['wpsc_base_currency_isocode'] = $local_currency_isocode; 36 38 if(!isset($_POST['reset'])){ 37 $foreign_currency_code = $wpdb->get_var("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".$_POST['currency_option']."' LIMIT 1"); 38 $_SESSION['wpsc_currency_code'] =$_POST['currency_option']; 39 $wpsc_cart->selected_currency_code = $foreign_currency_code; 39 $currency_code = $wpdb->get_results("SELECT `code`,`isocode` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".$_POST['currency_option']."' LIMIT 1",ARRAY_A); 40 //$foreign_currency_code = $wpdb->get_var("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".$_POST['currency_option']."' LIMIT 1"); 41 $foreign_currency_code = $currency_code[0]['code']; 42 $foreign_currency_isocode = $currency_code[0]['isocode']; 43 $wpsc_cart->selected_currency_code = $foreign_currency_code; 44 $_SESSION['wpsc_base_currency_isocode'] = $foreign_currency_isocode; 45 $wpsc_cart->selected_currency_isocode = $foreign_currency_isocode; 40 46 }else{ 41 47 $_SESSION['wpsc_currency_code'] =get_option('currency_type'); 42 48 $wpsc_cart->selected_currency_code = $local_currency_code; 49 $_SESSION['wpsc_base_currency_isocode'] = $local_currency_isocode; 43 50 $foreign_currency_code = $local_currency_code; 44 51 } … … 136 143 */ 137 144 function wpsc_add_currency_code($total){ 138 global $wpsc_cart ;145 global $wpsc_cart, $wpdb, $wpsc_query; 139 146 if ($wpsc_cart->selected_currency_code != '') 140 147 { … … 147 154 $total1 = preg_replace('/\&\#(036|8364)\;/','',$total1); 148 155 } 156 149 157 $total_proto = trim(preg_replace("/([^0-9\\.,])/i", "",$total1)); 150 $totalpre1 = trim(preg_replace("/([^0-9\\.])/i", "",$total1)); 151 $totalpre = (float)$totalpre1; 152 153 $total_converted = number_format($totalpre * $wpsc_cart->currency_conversion, 2, '.', ''); 154 $total = preg_replace('/([A-Z]{3}|[$€£]|\&\#(036|8364)\;)/', $wpsc_cart->selected_currency_code, $total); 155 $total = str_replace($total_proto, $total_converted , $total); 156 //exit('<pre>'.$total.'</pre>'); 158 $totalpre1 = trim(preg_replace("/([^0-9\\.])/i", "",$total1)); 159 $totalpre = (float)$totalpre1; 160 161 $results = get_product_meta(get_the_ID(),'currency',true); 162 if ( count( $results ) > 0 ) { 163 foreach ( (array)$results as $isocode => $curr ) { 164 if ($isocode == $wpsc_cart->selected_currency_isocode) 165 { 166 //$totalpre = $curr; 167 break; 168 } 169 } 170 } 171 172 $total_converted = number_format($totalpre * $wpsc_cart->currency_conversion, 2, '.', ''); 173 $total = preg_replace('/([A-Z]{3}|[$€£]|\&\#(036|8364)\;)/', $wpsc_cart->selected_currency_code, $total); 174 $total = str_replace($total_proto, $total_converted , $total); 175 //exit('<pre>'.$totalpre.'</pre>'); 157 176 158 177 } -
e-commerce-multi-currency-support/trunk/readme.txt
r540820 r541155 4 4 Requires at least: 2.9 5 5 Tested up to: 3.1.1 6 Stable tag: 0.6. 16 Stable tag: 0.6.2 7 7 8 8 … … 17 17 18 18 == Changelog == 19 = 0.6.2 = 20 - fixed defaulting to incorrect country in drop-down list. 19 21 = 0.6.1 = 20 22 - fixed issue with source price bigger than 1000 -
e-commerce-multi-currency-support/trunk/widgets/currency_chooser_widget.php
r525847 r541155 24 24 //Display Currency Info: 25 25 $sql ="SELECT * FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `visible`='1' ORDER BY `country` ASC"; 26 //echo $_SESSION['wpsc_base_currency_ code'];26 //echo $_SESSION['wpsc_base_currency_isocode']; 27 27 $countries = $wpdb->get_results($sql, ARRAY_A); 28 28 $output .= '<form method="post" action="" id="wpsc-mcs-widget-form">'; … … 30 30 if (!isset($_SESSION['wpsc_base_currency_code'])) 31 31 { 32 $currency_code = $wpdb->get_results("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A);32 $currency_code = $wpdb->get_results("SELECT `code`,`isocode` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A); 33 33 $local_currency_code = $currency_code[0]['code']; 34 $local_currency_isocode = $currency_code[0]['isocode']; 34 35 }else{ 35 36 $local_currency_code=$_SESSION['wpsc_base_currency_code']; … … 39 40 if ($instance['show_code'] == 1) $country_code =" (".$country['code'].")"; 40 41 $selected_code = ''; 41 if($_SESSION['wpsc_ currency_code'] == $country['id']){42 if($_SESSION['wpsc_base_currency_isocode'] == $country['isocode']){ 42 43 $selected_code = "selected='selected'"; 43 44 44 45 }else { 45 if ( !isset($_SESSION['wpsc_ currency_code']) && $local_currency_code == $country['code'])46 if ( !isset($_SESSION['wpsc_base_currency_isocode']) && $local_currency_isocode == $country['isocode']) 46 47 $selected_code = "selected='selected'"; 47 48 } -
e-commerce-multi-currency-support/trunk/wpsc-currency-changer.php
r540820 r541155 4 4 Plugin URI: http://misha.beshkin.lv 5 5 Description: A plugin that provides a currency converter tool integrated into the WordPress Shopping Cart. This is trunk from wp-e-commerce-multi-currency-magic plugin. 6 Version: 0.6. 16 Version: 0.6.2 7 7 Author: Misha Beshkin 8 8 Author URI: http://misha.beshkin.lv … … 30 30 31 31 // Get currency settings 32 $currency_code = $wpdb->get_results("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A);32 $currency_code = $wpdb->get_results("SELECT `code`,`isocode` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A); 33 33 34 34 $local_currency_code = $currency_code[0]['code']; 35 $local_currency_isocode = $currency_code[0]['isocode']; 35 36 $_SESSION['wpsc_base_currency_code'] = $local_currency_code; 37 $_SESSION['wpsc_base_currency_isocode'] = $local_currency_isocode; 36 38 if(!isset($_POST['reset'])){ 37 $foreign_currency_code = $wpdb->get_var("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".$_POST['currency_option']."' LIMIT 1"); 38 $_SESSION['wpsc_currency_code'] =$_POST['currency_option']; 39 $wpsc_cart->selected_currency_code = $foreign_currency_code; 39 $currency_code = $wpdb->get_results("SELECT `code`,`isocode` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".$_POST['currency_option']."' LIMIT 1",ARRAY_A); 40 //$foreign_currency_code = $wpdb->get_var("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".$_POST['currency_option']."' LIMIT 1"); 41 $foreign_currency_code = $currency_code[0]['code']; 42 $foreign_currency_isocode = $currency_code[0]['isocode']; 43 $wpsc_cart->selected_currency_code = $foreign_currency_code; 44 $_SESSION['wpsc_base_currency_isocode'] = $foreign_currency_isocode; 45 $wpsc_cart->selected_currency_isocode = $foreign_currency_isocode; 40 46 }else{ 41 47 $_SESSION['wpsc_currency_code'] =get_option('currency_type'); 42 48 $wpsc_cart->selected_currency_code = $local_currency_code; 49 $_SESSION['wpsc_base_currency_isocode'] = $local_currency_isocode; 43 50 $foreign_currency_code = $local_currency_code; 44 51 } … … 136 143 */ 137 144 function wpsc_add_currency_code($total){ 138 global $wpsc_cart ;145 global $wpsc_cart, $wpdb, $wpsc_query; 139 146 if ($wpsc_cart->selected_currency_code != '') 140 147 { … … 147 154 $total1 = preg_replace('/\&\#(036|8364)\;/','',$total1); 148 155 } 156 149 157 $total_proto = trim(preg_replace("/([^0-9\\.,])/i", "",$total1)); 150 $totalpre1 = trim(preg_replace("/([^0-9\\.])/i", "",$total1)); 151 $totalpre = (float)$totalpre1; 152 153 $total_converted = number_format($totalpre * $wpsc_cart->currency_conversion, 2, '.', ''); 154 $total = preg_replace('/([A-Z]{3}|[$€£]|\&\#(036|8364)\;)/', $wpsc_cart->selected_currency_code, $total); 155 $total = str_replace($total_proto, $total_converted , $total); 156 //exit('<pre>'.$total.'</pre>'); 158 $totalpre1 = trim(preg_replace("/([^0-9\\.])/i", "",$total1)); 159 $totalpre = (float)$totalpre1; 160 161 $results = get_product_meta(get_the_ID(),'currency',true); 162 if ( count( $results ) > 0 ) { 163 foreach ( (array)$results as $isocode => $curr ) { 164 if ($isocode == $wpsc_cart->selected_currency_isocode) 165 { 166 //$totalpre = $curr; 167 break; 168 } 169 } 170 } 171 172 $total_converted = number_format($totalpre * $wpsc_cart->currency_conversion, 2, '.', ''); 173 $total = preg_replace('/([A-Z]{3}|[$€£]|\&\#(036|8364)\;)/', $wpsc_cart->selected_currency_code, $total); 174 $total = str_replace($total_proto, $total_converted , $total); 175 //exit('<pre>'.$totalpre.'</pre>'); 157 176 158 177 }
Note: See TracChangeset
for help on using the changeset viewer.