Plugin Directory

Changeset 3152095


Ignore:
Timestamp:
09/15/2024 03:42:32 AM (18 months ago)
Author:
litexten
Message:

bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • litcommerce/trunk/litcommerce.php

    r3135220 r3152095  
    33Plugin Name: LitCommerce
    44Description: Helps you easily integrate your WooCommerce store with LitCommerce.
    5 Version: 1.1.8
     5Version: 1.1.9
    66Author: LitCommerce
    77Author URI: https://litcommerce.com
     
    6262    function renderPage() {
    6363        echo '<h1>LitCommerce Integration</h1>';
    64         $is_reconnect = @$_GET['reconnect'] == 1;
     64        $is_reconnect = get_litc_params('reconnect') == 1;
    6565        if (!empty(get_option('woocommerce_litcommerce_consumer_key'))) {
    6666            $is_connected = true;
     
    118118                </p>
    119119            </div>
    120             <?php if (@$_GET['reconnect'] == 1) { ?>
     120            <?php if (get_litc_params('reconnect') == 1) { ?>
    121121                <script>
    122122                    var link = document.getElementById('btn-submit');
     
    414414
    415415}
     416function get_litc_params($key)
     417{
     418    if(isset($_GET[$key])) {
     419        return $_GET[$key];
     420    }
     421    return null;
     422}
    416423
    417424function litc_woocommerce_hidden_order_itemmeta( $arr ) {
     
    423430add_filter('woocommerce_hidden_order_itemmeta', 'litc_woocommerce_hidden_order_itemmeta', 10, 1);
    424431function 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')) {
    426433        return [
    427434            0 => [
    428435                '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',
    431438                'compound' => 'no'
    432439            ]
     
    438445}
    439446
     447
     448
     449
     450
    440451add_filter('woocommerce_find_rates', 'litc_woocommerce_find_rates', 10, 3);
    441452function 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;
    444455    }
    445456    return $rate_name;
     
    450461add_filter('woocommerce_rate_label', 'litc_woocommerce_rate_label', 10, 3);
    451462function 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')){
    453464        global $wpdb;
    454465        $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.