I try to do a quite simple thing but for me i don´t get it to work.
This is from the wc-cart-functions.php
if ( ! empty( $tax_string_array ) ) {
$taxable_address = WC()->customer->get_taxable_address();
$estimated_text = WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping()
? sprintf( ' ' . __( 'estimated for %s', 'woocommerce' ), WC()->countries->estimated_for_prefix( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ] )
: '';
$value .= '<small class="includes_tax">' . sprintf( __( '(includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) . $estimated_text ) . '</small>';
}
}
echo apply_filters( 'woocommerce_cart_totals_order_total_html', $value );
}
The $value should be different if any $fee
is applied.
But I only get 0.00 €
Value from $fee
Variable if I check for.
Could someone please help me with simply apply the Value of the FEE in a Variable and check in a simple if
clause like:
if fee is applied ---> 1
else ---> 2
How can I do it?
As you can see you can use the
woocommerce_cart_totals_order_total_html
filter hook located in thatwc-cart-functions.php
core code, to alter the output of grand cart total:Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested and works.
You will need to customize the code in the condition for
$value