Exemple #1
0
            if ($display_th) {
                $display_th = false;
                ?>
							<th><?php 
                echo esc_html(WC()->countries->tax_or_vat());
                ?>
</th>
						<?php 
            } else {
                ?>
							<th></th>
						<?php 
            }
            ?>
						<td><?php 
            echo wp_kses_post(wcs_cart_price_string($recurring_cart->get_taxes_total(), $recurring_cart));
            ?>
</td>
					</tr>
				<?php 
        }
        ?>
				<?php 
        $display_th = true;
        ?>
			<?php 
    }
    ?>
		<?php 
}
?>
/**
 * Get recurring total html including inc tax if needed
 *
 * @access public
 * @return void
 */
function wcs_cart_totals_order_total_html($cart)
{
    $value = '<strong>' . $cart->get_total() . '</strong> ';
    // If prices are tax inclusive, show taxes here
    if (wc_tax_enabled() && $cart->tax_display_cart == 'incl') {
        $tax_string_array = array();
        if (get_option('woocommerce_tax_total_display') == 'itemized') {
            foreach ($cart->get_tax_totals() as $code => $tax) {
                $tax_string_array[] = sprintf('%s %s', $tax->formatted_amount, $tax->label);
            }
        } else {
            $tax_string_array[] = sprintf('%s %s', wc_price($cart->get_taxes_total(true, true)), WC()->countries->tax_or_vat());
        }
        if (!empty($tax_string_array)) {
            // translators: placeholder is price string, denotes tax included in cart/order total
            $value .= '<small class="includes_tax">' . sprintf(_x('(Includes %s)', 'includes tax', 'woocommerce-subscriptions'), implode(', ', $tax_string_array)) . '</small>';
        }
    }
    // Apply WooCommerce core filter
    $value = apply_filters('woocommerce_cart_totals_order_total_html', $value);
    echo wp_kses_post(apply_filters('wcs_cart_totals_order_total_html', wcs_cart_price_string($value, $cart), $cart));
}