Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Remove Shipping label on cart page for flat-priced shipping items WordPress

  • REFUNDED

Hi all,

I'd like to remove the label for flat priced shipping on my cart page, I've tried leaving the label for flat priced shipping blank on the woocommerce shipping settings page but that doesnt work.

I need the label for free shipping so that customers are aware that the shipping is free above £50.

Here's my code at the moment in theme-folder/woocommerce/cart/shipping-methods.php


// Prepare text labels with price for each shipping method
foreach ( $available_methods as $method ) {
$method->full_label = $method->label;

if ( $method->cost > 0 ) {
if ( $woocommerce->cart->tax_display_cart == 'excl' ) {
$method->full_label .= ': ' . woocommerce_price( $method->cost );
if ( $method->get_shipping_tax() > 0 && $woocommerce->cart->prices_include_tax ) {
$method->full_label .= ' <small>' . $woocommerce->countries->ex_tax_or_vat() . '</small>';
}
} else {
$method->full_label .= ': ' . woocommerce_price( $method->cost + $method->get_shipping_tax() );
if ( $method->get_shipping_tax() > 0 && ! $woocommerce->cart->prices_include_tax ) {
$method->full_label .= ' <small>' . $woocommerce->countries->inc_tax_or_vat() . '</small>';
}
}
} elseif ( $method->id !== 'free_shipping' ) {
$method->full_label .= ' (' . __( 'Free', 'woocommerce' ) . ')';
}

$method->full_label = apply_filters( 'woocommerce_cart_shipping_method_full_label', $method->full_label, $method );
}


Thanks

Answers (3)

2013-11-23

Navjot Singh answers:

Try this

https://gist.github.com/maxrice/3708681


willcm comments:

I've already implemented this - I want to hide the actual label