shopp_cart_taxrate_settings

filters the current tax setting.

add_filter( 'shopp_cart_taxrate_settings', [callback] )

@param array $taxsetting the current taxrate settings array

Description

filters the current tax setting.

The returned rate is one of the elements of the array returned by shopp_setting(‘taxrates’). You should use both shopp_cart_taxrate and shopp_cart_taxrate_settings together.

This filter is applied after the cart taxrate has already been determined.

Example

// register filter callback
add_filter('shopp_cart_taxrate_settings', 'tax_rate_setting_filter');

// create filter function
function tax_rate_setting_filter( $setting ) {
    // define a base rate of 15% + local jurisdiction rates when testing a product tagged mytag
    $setting = array(
        'rate' => '15.0%',
        'country' => 'US',
        'zone' => 'OH',
        'logic' => 'all', // optional: 'all' conditional tax rules must apply, or 'any' rule can apply
        'rules' => array( // optional: the conditional tax rules
                    array('p' => 'product-tags', // product-name, product-tags, product-category, customer-type
                    'v' => 'mytag' // the value of above
                    )
                    )
        'haslocals' => true, // true if the rate setting has local tax jurisdictions, false otherwise
        'locals' => array (  // if haslocals is true, defines the local tax jurisdictions
            'Kent' => 1, // Additional 1 percent for Kent
            'New Castle' => 0.25,
            'Sussex' => 1.4
            )
    );
    return $setting;
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar