Developer Documentation

Simple Sales Tax offers several filters to allow developers to extend its functionality. Each of these filters is described below.

wootax_origin_address

Since: Simple Sales Tax 3.8
Description: Allows developers to modify the Shipping Origin Address used for a product. By default, Simple Sales Tax will use the first business address it finds in the state where the customer resides. An array of all addresses registered with Simple Sales Tax can be retrieved using the function fetch_business_addresses().
Parameters: $address_key (int) – the key of the current Shipping Origin Address in the Simple Sales Tax addresses array; $customer_state (string) – two-character abbreviation of state where customer lives; $object (WC_Simple Sales Tax_Checkout or WC_Simple Sales Tax_Order object)
Return Value: (int) index of shipping origin address to be used
Example Usage:

wootax_local_pickup_methods

Since: Simple Sales Tax 4.3
Description: Simple Sales Tax needs a way to distinguish pickup orders up from those shipped to the customer. By default, it recognizes the local_pickup shipping method. If you plan on using another shipping method for pickups, you must register it with Simple Sales Tax using this filter.
Parameters: $methods (array) – an array of shipping method names
Return Value: Modified $methods array
Example Usage:

wootax_pickup_address

Since: Simple Sales Tax 4.4
Description: When Simple Sales Tax detects a pickup order, it automatically substitutes the customer’s address with the business’s default address. This filter allows developers to use an address other than the business default for local pickups.
Parameters: $address_index (int) – the index of the address being used (by default, this matches the “Default Address” setting); $addresses (array) – Simple Sales Tax addresses array; $order_id (int) – contains the order ID on the “Edit Order” screen, or -1 during checkout.
Return Value: (int) index of origin address to be used
Example Usage:

wootax_local_delivery_methods

Since: Simple Sales Tax 4.4
Description: Simple Sales Tax needs a way to distinguish local deliveries from orders that are to be picked up or shipped to the customer. By default, it recognizes the local_delivery shipping method. If you plan on using another shipping method for deliveries, you must register it with Simple Sales Tax using this filter.
Parameters: $methods (array) – an array of shipping method names
Return Value: (array) Modified $methods array
Example Usage:

wootax_shipping_tic

Since: Simple Sales Tax 4.4
Description: Taxability Information Codes, or TICs, are used by TaxCloud to distinguish shipping charges from other classes of items. By default, Simple Sales Tax uses the TIC 11010 to identify shipping items. If you would like to use an alternate TIC, you can override the default using this filter.
Parameters: $tic (int) – the Simple Sales Tax shipping TIC (11010 by default)
Return Value: (int) A new shipping TIC
Example Usage:

wootax_fee_tic

Since: Simple Sales Tax 4.4
Description: Taxability Information Codes, or TICs, are used by TaxCloud to distinguish fees from other classes of items. By default, Simple Sales Tax uses the TIC 10010 to identify fees. If you would like to use an alternate TIC, you can override the default using this filter.
Parameters: $tic (int) – the Simple Sales Tax fee TIC (10010 by default)
Return Value: (int) A new fee TIC
Example Usage:

wootax_rate_code

Since: Simple Sales Tax 4.4
Description: By default, the Simple Sales Tax tax rate is identified by the rate code WOOTAX-RATE-DO-NOT-REMOVE. You can use this filter to change this to a different value.
Parameters: (String) $rate_code – Simple Sales Tax rate code
Return Value: (String) a new rate code for Simple Sales Tax to use
Example Usage:

wootax_rate_label

Since: Simple Sales Tax 4.5
Description: By default, the Simple Sales Tax tax rate is identified by the label “Sales Tax”. You can use this filter to change this to a different value.
Parameters: (String) $rate_label – Simple Sales Tax rate label
Return Value: (String) a new rate label for Simple Sales Tax to use
Example Usage:

wootax_taxable_price

Since: Simple Sales Tax 4.4
Description: Developers can use this filter to change the taxable price of an item.
Parameters: (double) $price – taxable price of item; (boolean) $is_checkout – true if Simple Sales Tax is performing a tax lookup on the checkout page, otherwise false; (int) $item_id – WooCommerce product ID during checkout, or an order item ID on the “Edit Order” screen
Return Value: (double) new taxable price for item
Example Usage: