vuffer
vuffer

Reputation: 166

How to change tax label in cart?

So I'm trying to change the tax name from 'tax' to 'calculating' in the cart based on whether the user is logged in or not.

I think I'm using the correct hook, but I'm unsure what object is referencing the label, tried looking at documentation but there's not much info on labels. Here's what I got so far, it's nothing really but it kind of illustrates what I had in mind.

I'm not that into Woocomerce, any help would be much appreciated.

Thanks

function check_text() {
  if (is_user_logged_in() === false) {
    echo "Calculating";
  }
}
add_filter('woocommerce_cart_totals_after_order_total', 'check_text');

Upvotes: 1

Views: 2906

Answers (1)

Niket Joshi
Niket Joshi

Reputation: 748

i think you have to add following to change tax label on cart to your custom label in your theme/function.php file.

 `add_filter( 'woocommerce_countries_inc_tax_or_vat', function () 
   {
      return __( '(calculating)', 'woocommerce' );
   });`

i hope that this work for you and for any probelm feel free to ask. Thank you

Upvotes: 2

Related Questions