diff --git a/woocommerce/cart/cart-shipping.php b/woocommerce/cart/cart-shipping.php index 8470f8f4b34c84bf9fa86b3c7db8f1208398a7bf..2b0fa134eca7e3ff828287aaaa6f5c24197d1bc8 100644 --- a/woocommerce/cart/cart-shipping.php +++ b/woocommerce/cart/cart-shipping.php @@ -13,8 +13,8 @@ * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ - * @package WooCommerce/Templates - * @version 3.6.0 + * @package WooCommerce\Templates + * @version 7.3.0 */ defined( 'ABSPATH' ) || exit; @@ -49,7 +49,7 @@ $calculator_text = ''; if ( $formatted_destination ) { // Translators: $s shipping destination. printf( esc_html__( 'Shipping to %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' ); - $calculator_text = __( 'Change address', 'woocommerce' ); + $calculator_text = esc_html__( 'Change address', 'woocommerce' ); } else { echo wp_kses_post( apply_filters( 'woocommerce_shipping_estimate_html', __( 'Shipping options will be updated during checkout.', 'woocommerce' ) ) ); } @@ -58,13 +58,31 @@ $calculator_text = ''; <?php endif; ?> <?php elseif ( ! $has_calculated_shipping || ! $formatted_destination ) : - echo wp_kses_post( apply_filters( 'woocommerce_shipping_may_be_available_html', __( 'Enter your address to view shipping options.', 'woocommerce' ) ) ); + if ( is_cart() && 'no' === get_option( 'woocommerce_enable_shipping_calc' ) ) { + echo wp_kses_post( apply_filters( 'woocommerce_shipping_not_enabled_on_cart_html', __( 'Shipping costs are calculated during checkout.', 'woocommerce' ) ) ); + } else { + echo wp_kses_post( apply_filters( 'woocommerce_shipping_may_be_available_html', __( 'Enter your address to view shipping options.', 'woocommerce' ) ) ); + } elseif ( ! is_cart() ) : echo wp_kses_post( apply_filters( 'woocommerce_no_shipping_available_html', __( 'There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.', 'woocommerce' ) ) ); else : - // Translators: $s shipping destination. - echo wp_kses_post( apply_filters( 'woocommerce_cart_no_shipping_available_html', sprintf( esc_html__( 'No shipping options were found for %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' ) ) ); - $calculator_text = __( 'Enter a different address', 'woocommerce' ); + echo wp_kses_post( + /** + * Provides a means of overriding the default 'no shipping available' HTML string. + * + * @since 3.0.0 + * + * @param string $html HTML message. + * @param string $formatted_destination The formatted shipping destination. + */ + apply_filters( + 'woocommerce_cart_no_shipping_available_html', + // Translators: $s shipping destination. + sprintf( esc_html__( 'No shipping options were found for %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' ), + $formatted_destination + ) + ); + $calculator_text = esc_html__( 'Enter a different address', 'woocommerce' ); endif; ?>