Plugin Directory

Changeset 3050918


Ignore:
Timestamp:
03/14/2024 09:24:58 AM (2 years ago)
Author:
litexten
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • litcommerce/trunk/litcommerce.php

    r3041796 r3050918  
    33Plugin Name: LitCommerce
    44Description: Helps you easily integrate your WooCommerce store with LitCommerce.
    5 Version: 1.1.3
     5Version: 1.1.4
    66Author: LitCommerce
    77Author URI: https://litcommerce.com
     
    393393function litc_woocommerce_hidden_order_itemmeta($arr) {
    394394    $arr[] = '_litc_item_tax';
     395    $arr[] = '_litc_order_id';
    395396    return $arr;
    396397}
    397398
    398399add_filter('woocommerce_hidden_order_itemmeta', 'litc_woocommerce_hidden_order_itemmeta', 10, 1);
     400function litc_woocommerce_find_rates( $matched_tax_rates, $args ) {
     401    if(@$_GET['from_litc'] == 1 && @$_GET['litc_custom_tax_rate']){
     402        return [
     403            0 => ['rate'     => $_GET['litc_custom_tax_rate'],
     404                'label'    => @$_GET['litc_custom_tax_label']?$_GET['litc_custom_tax_label']:'Tax1',
     405                'shipping' => 'yes',
     406                'compound' => 'no' ,]
     407        ];
     408    }
     409    return $matched_tax_rates;
     410
     411
     412}
     413
     414add_filter('woocommerce_find_rates', 'litc_woocommerce_find_rates', 10, 3);
     415function litc_woocommerce_rate_label( $rate_name, $key ) {
     416    if(@$_GET['litc_custom_tax_label']){
     417        return @$_GET['litc_custom_tax_label'];
     418    }
     419    return $rate_name;
     420
     421
     422}
     423
     424add_filter('woocommerce_rate_label', 'litc_woocommerce_rate_label', 10, 3);
Note: See TracChangeset for help on using the changeset viewer.