In the latest release of WooCommerce, there is a message being displayed in the cart stating the shipping cost is only an estimate.
This doesn't make any sense when someone is using flat rate shipping and does not calculate shipping at all. Note, I don't have calculated shipping activated either. I tried to hide the message with css, however it of course, does not have a class to target.
Does anyone know how to turn this off?
Now you can use woocommerce_shipping_estimate_html
filter.
Eg.:
function shipping_estimate_html()
{
return null;
}
add_filter('woocommerce_shipping_estimate_html', 'shipping_estimate_html');
This is something new since Woocommerce version 3.5: You will need to override via your theme (as explained on this link) the template file cart/cart-shipping.php
.
From line 46
to 58
, you will replace the following:
<?php if ( is_cart() ) : ?>
<p class="woocommerce-shipping-destination">
<?php
if ( $formatted_destination ) {
// Translators: $s shipping destination.
printf( esc_html__( 'Estimate for %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' );
$calculator_text = __( 'Change address', 'woocommerce' );
} else {
echo esc_html__( 'This is only an estimate. Prices will be updated during checkout.', 'woocommerce' );
}
?>
</p>
<?php endif; ?>
By this:
<?php if ( is_cart() ) : ?>
<p class="woocommerce-shipping-destination">
<?php
if ( $formatted_destination ) {
$calculator_text = __( 'Change address', 'woocommerce' );
}
?>
</p>
<?php endif; ?>
You are done… No more annoying notices.
In the event your Template doesn't have a cart-shipping.php file, this css modification worked for me:
.cart-totals-inner .woocommerce-shipping-destination {
display: none; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With