woocommerce_email_order_shipping_show_free_label
Filters whether a zero cost shipping row shows 'Free!' in place of the repeated method name.
Defaults to true only for Free Shipping. Other methods can cost nothing yet still use the name to tell the customer something, such as 'Shipping TBD'.
Usage
add_filter( 'woocommerce_email_order_shipping_show_free_label', 'wp_kama_woocommerce_email_order_shipping_show_free_label_filter', 10, 2 );
/**
* Function for `woocommerce_email_order_shipping_show_free_label` filter-hook.
*
* @param bool $show_free_label Whether to replace the value with 'Free!'.
* @param WC_Order $order The order being emailed.
*
* @return bool
*/
function wp_kama_woocommerce_email_order_shipping_show_free_label_filter( $show_free_label, $order ){
// filter...
return $show_free_label;
}
- $show_free_label(true|false)
- Whether to replace the value with 'Free!'.
- $order(WC_Order)
- The order being emailed.
Changelog
| Since 11.2.0 | Introduced. |
Where the hook is called
woocommerce_email_order_shipping_show_free_label
woocommerce/templates/emails/email-order-details.php 167
if ( (bool) apply_filters( 'woocommerce_email_order_shipping_show_free_label', $order->has_shipping_method( 'free_shipping' ), $order ) ) {
woocommerce/templates/emails/plain/email-order-details.php 79
if ( (bool) apply_filters( 'woocommerce_email_order_shipping_show_free_label', $order->has_shipping_method( 'free_shipping' ), $order ) ) {