Created
November 29, 2018 16:49
-
-
Save acanza/ec54dbbf3ce90bd030f6a9fe80a4806a to your computer and use it in GitHub Desktop.
Te permite personalizar el mensaje cuando no hay envíos disponibles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Te permite personalizar el mensaje cuando no hay envíos disponibles | |
| if ( in_array( 'woocommerce/woocommerce.php', get_option( 'active_plugins' ) ) && version_compare( WC()->version , '3.0.0', '>' ) ){ | |
| add_filter( 'woocommerce_cart_no_shipping_available_html', 'custom_no_shipping_available_message', 99 ); | |
| add_filter( 'woocommerce_no_shipping_available_html', 'custom_no_shipping_available_message', 99 ); | |
| function custom_no_shipping_available_message( $message ){ | |
| $message_for_not_available_shipping_methods = 'Lo sentimos, pero no hacemos envío para tu zona. Sin embargo, <strong><a href="https://tudominio.com">puedes consultar aquí</a></strong> cuál es nuestro distribuidor oficial más cercano a ti.'; // Reemplaza el texto entre comillas por tu mensaje personalizado | |
| return !empty( $message_for_not_available_shipping_methods )? wpautop( $message_for_not_available_shipping_methods ) : $message; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment