Ha a WooCommerce kosár oldalon kiíratjuk a végösszegnél, hogy x forintnyi adót tartalmaz, akkor alapból ÁFA-t tartalmaz jelenik meg, ami nem túl elegáns.

A sablon function.php-be kell beírni a következő kódot:


// define the woocommerce_cart_totals_order_total_html callback
function pp_filter_woocommerce_cart_totals_order_total_html( $value ) {
   $value = str_replace("ÁFA-t tartalmaz","ÁFÁ-t tartalmaz",$value);
   return $value;
}; 

// add the filter
add_filter( 'woocommerce_cart_totals_order_total_html', 'pp_filter_woocommerce_cart_totals_order_total_html', 10, 1 );

// define the woocommerce_get_formatted_order_total callback
function pp_filter_woocommerce_get_formatted_order_total( $formatted_total, $instance ) {
   $formatted_total= str_replace("ÁFA-t tartalmaz","ÁFÁ-t tartalmaz",$formatted_total);
   return $formatted_total;
};

// add the filter
add_filter( 'woocommerce_get_formatted_order_total', 'pp_filter_woocommerce_get_formatted_order_total', 10, 2 );

A második filter a Rendelés részletei-nél cseréli ki a szöveget.