Changeset 3152095
- Timestamp:
- 09/15/2024 03:42:32 AM (18 months ago)
- File:
-
- 1 edited
-
litcommerce/trunk/litcommerce.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
litcommerce/trunk/litcommerce.php
r3135220 r3152095 3 3 Plugin Name: LitCommerce 4 4 Description: Helps you easily integrate your WooCommerce store with LitCommerce. 5 Version: 1.1. 85 Version: 1.1.9 6 6 Author: LitCommerce 7 7 Author URI: https://litcommerce.com … … 62 62 function renderPage() { 63 63 echo '<h1>LitCommerce Integration</h1>'; 64 $is_reconnect = @$_GET['reconnect']== 1;64 $is_reconnect = get_litc_params('reconnect') == 1; 65 65 if (!empty(get_option('woocommerce_litcommerce_consumer_key'))) { 66 66 $is_connected = true; … … 118 118 </p> 119 119 </div> 120 <?php if ( @$_GET['reconnect']== 1) { ?>120 <?php if (get_litc_params('reconnect') == 1) { ?> 121 121 <script> 122 122 var link = document.getElementById('btn-submit'); … … 414 414 415 415 } 416 function get_litc_params($key) 417 { 418 if(isset($_GET[$key])) { 419 return $_GET[$key]; 420 } 421 return null; 422 } 416 423 417 424 function litc_woocommerce_hidden_order_itemmeta( $arr ) { … … 423 430 add_filter('woocommerce_hidden_order_itemmeta', 'litc_woocommerce_hidden_order_itemmeta', 10, 1); 424 431 function litc_woocommerce_find_rates( $matched_tax_rates ) { 425 if ( @$_GET['from_litc'] == 1 && @$_GET['litc_custom_tax_rate']) {432 if (get_litc_params('from_litc') == 1 && get_litc_params('litc_custom_tax_rate')) { 426 433 return [ 427 434 0 => [ 428 435 'rate' => $_GET['litc_custom_tax_rate'], 429 'label' => @$_GET['litc_custom_tax_label'] ? $_GET['litc_custom_tax_label']: 'Tax',430 'shipping' => @$_GET['litc_custom_shipping_tax']== 1 ? 'yes' : 'no',436 'label' => get_litc_params('litc_custom_tax_label') ? get_litc_params('litc_custom_tax_label') : 'Tax', 437 'shipping' => get_litc_params('litc_custom_shipping_tax') == 1 ? 'yes' : 'no', 431 438 'compound' => 'no' 432 439 ] … … 438 445 } 439 446 447 448 449 450 440 451 add_filter('woocommerce_find_rates', 'litc_woocommerce_find_rates', 10, 3); 441 452 function litc_woocommerce_rate_label( $rate_name ) { 442 if ( @$_GET['litc_custom_tax_label']) {443 return @$_GET['litc_custom_tax_label'];453 if ($litc_custom_tax_label = get_litc_params('litc_custom_tax_label')) { 454 return $litc_custom_tax_label; 444 455 } 445 456 return $rate_name; … … 450 461 add_filter('woocommerce_rate_label', 'litc_woocommerce_rate_label', 10, 3); 451 462 function litc_woocommerce_rest_pre_insert_shop_order_object( $order ) { 452 if( @$_GET['from_litc']== 1 && class_exists('WC_Seq_Order_Number')){463 if(get_litc_params('from_litc') == 1 && class_exists('WC_Seq_Order_Number')){ 453 464 global $wpdb; 454 465 $using_hpos = class_exists( \Automattic\WooCommerce\Utilities\OrderUtil::class ) && \Automattic\WooCommerce\Utilities\OrderUtil::custom_orders_table_usage_is_enabled();
Note: See TracChangeset
for help on using the changeset viewer.