This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set shipping TIC to 90022 | |
*/ | |
function wootax_change_shipping_tic( $tic ) { | |
return 90022; | |
} | |
add_filter( 'wootax_shipping_tic', 'wootax_change_shipping_tic' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hide_cart_taxes( $enabled ) { | |
if ( is_checkout() ) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
add_filter( 'wc_tax_enabled', 'hide_cart_taxes' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change the WooTax rate label to "Tax" | |
*/ | |
function change_wootax_rate_label( $rate_label ) { | |
return "Tax"; | |
} | |
add_filter( 'wootax_rate_label', 'change_wootax_rate_label', 10, 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change the taxable amount for product with ID 25 to 5 dollars | |
*/ | |
function change_wootax_taxable_price( $price, $is_checkout, $item_id ) { | |
if ( $is_checkout && $item_id == 25 ) { | |
return 5; | |
} else { | |
return $price; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Substitute WooTax rate code with SALES-TAX | |
*/ | |
function change_wootax_rate_code( $rate_code ) { | |
return "SALES-TAX"; | |
} | |
add_filter( 'wootax_rate_code', 'change_wootax_rate_code' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change WooTax fee TIC to 11000 | |
*/ | |
function wootax_change_fee_tic( $tic ) { | |
return 11000; | |
} | |
add_filter( 'wootax_fee_tic', 'wootax_change_fee_tic' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Register the Custom Local Delivery method with WooTax | |
*/ | |
function wootax_add_local_delivery_method( $methods ) { | |
$methods[] = 'custom_local_delivery'; // Detected on frontend | |
$methods[] = 'Custom Local Delivery'; // Detected on backend | |
return $methods; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Determine which address to use as the "destination address" based on the customer's Local Pickup selection | |
*/ | |
function wootax_maybe_swap_dest_address( $address_index, $addresses, $order_id ) { | |
global $woocommerce, $wpdb; | |
$local_pickup_locations = get_option( 'woocommerce_pickup_locations' ); | |
$location_id = -1; // Local Pickup Plus location ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Searches for a business address in NV and returns its key | |
*/ | |
function wootax_use_nv_address( $address_key, $customer_state, $object ) { | |
$all_addresses = fetch_business_addresses(); | |
foreach ( $all_addresses as $key => $address ) { | |
if ( $address['state'] = 'NV' ) | |
return $key; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Register the Local Pickup Plus method with WooTax | |
*/ | |
function wootax_add_local_pickup_method( $methods ) { | |
$methods[] = 'local_pickup_plus'; // Detected on frontend | |
$methods[] = 'Local Pickup Plus'; // Detected on backend | |
return $methods; | |
} |
OlderNewer