Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- round( reset( WC_Tax::get_rates() )['rate'] )
- // Function to add shortcode to display tax rates
- function woocommerce_template_display_tax() {
- global $product;
- $tax_rates = WC_Tax::get_rates( $product->get_tax_class() );
- if (!empty($tax_rates)) {
- $tax_rate = reset($tax_rates);
- echo sprintf(_x('Price without %.2f %% tax', 'Text for tax rate. %.2f =
- tax rate', 'wptheme.foundation'), $tax_rate['rate']);
- }
- }
- add_shortcode('display_tax', 'woocommerce_template_display_tax');
Add Comment
Please, Sign In to add comment