Add classes to tax and shipping labels/notices

Closes #8189
This commit is contained in:
Mike Jolley 2015-05-27 16:17:33 +01:00
parent a1717372aa
commit 5920b88d5d
5 changed files with 9 additions and 9 deletions

View File

@ -1622,7 +1622,7 @@ abstract class WC_Abstract_Order {
$subtotal = wc_price( $subtotal, array('currency' => $this->get_order_currency()) );
if ( $tax_display == 'excl' && $this->prices_include_tax ) {
$subtotal .= ' <small>' . WC()->countries->ex_tax_or_vat() . '</small>';
$subtotal .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
} else {

View File

@ -1532,7 +1532,7 @@ class WC_Cart {
$return = wc_price( $this->shipping_total );
if ( $this->shipping_tax_total > 0 && $this->prices_include_tax ) {
$return .= ' <small>' . WC()->countries->ex_tax_or_vat() . '</small>';
$return .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
return $return;
@ -1542,7 +1542,7 @@ class WC_Cart {
$return = wc_price( $this->shipping_total + $this->shipping_tax_total );
if ( $this->shipping_tax_total > 0 && ! $this->prices_include_tax ) {
$return .= ' <small>' . WC()->countries->inc_tax_or_vat() . '</small>';
$return .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
}
return $return;
@ -2022,7 +2022,7 @@ class WC_Cart {
$cart_subtotal = wc_price( $this->subtotal_ex_tax );
if ( $this->tax_total > 0 && $this->prices_include_tax ) {
$cart_subtotal .= ' <small>' . WC()->countries->ex_tax_or_vat() . '</small>';
$cart_subtotal .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
} else {
@ -2030,7 +2030,7 @@ class WC_Cart {
$cart_subtotal = wc_price( $this->subtotal );
if ( $this->tax_total > 0 && !$this->prices_include_tax ) {
$cart_subtotal .= ' <small>' . WC()->countries->inc_tax_or_vat() . '</small>';
$cart_subtotal .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
}
}

View File

@ -280,12 +280,12 @@ function wc_cart_totals_shipping_method_label( $method ) {
if ( WC()->cart->tax_display_cart == 'excl' ) {
$label .= ': ' . wc_price( $method->cost );
if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax ) {
$label .= ' <small>' . WC()->countries->ex_tax_or_vat() . '</small>';
$label .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
} else {
$label .= ': ' . wc_price( $method->cost + $method->get_shipping_tax() );
if ( $method->get_shipping_tax() > 0 && ! WC()->cart->prices_include_tax ) {
$label .= ' <small>' . WC()->countries->inc_tax_or_vat() . '</small>';
$label .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
}
}
} elseif ( $method->id !== 'free_shipping' ) {

View File

@ -385,7 +385,7 @@ function wc_price( $price, $args = array() ) {
$return = '<span class="amount">' . $formatted_price . '</span>';
if ( $ex_tax_label && wc_tax_enabled() ) {
$return .= ' <small>' . WC()->countries->ex_tax_or_vat() . '</small>';
$return .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
return apply_filters( 'wc_price', $return, $price, $args );

View File

@ -84,7 +84,7 @@ if ( ! defined( 'ABSPATH' ) ) {
</table>
<?php if ( WC()->cart->get_cart_tax() ) : ?>
<p><small><?php
<p class="wc-cart-shipping-notice"><small><?php
$estimated_text = WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping()
? sprintf( ' ' . __( ' (taxes estimated for %s)', 'woocommerce' ), WC()->countries->estimated_for_prefix() . __( WC()->countries->countries[ WC()->countries->get_base_country() ], 'woocommerce' ) )