Skip to content

Instantly share code, notes, and snippets.

@jmarreros
Created December 16, 2019 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmarreros/5fb43b6d920a62cda14a56ea56e516c0 to your computer and use it in GitHub Desktop.
Save jmarreros/5fb43b6d920a62cda14a56ea56e516c0 to your computer and use it in GitHub Desktop.
<?php //no copiar esta línea
add_action( 'woocommerce_cart_totals_after_shipping' , 'mostrar_mensaje_tipo_envio' );
add_action( 'woocommerce_review_order_after_shipping' , 'mostrar_mensaje_tipo_envio' );
function mostrar_mensaje_tipo_envio() {
$chosen_method = WC()->session->get( 'chosen_shipping_methods' );
$chosen_method = explode(':', reset($chosen_method) );
if ( $chosen_method[0] == 'local_pickup' ){
echo '<tr class="msg-shipping">
<td colspan="2" style="text-align:center;background:lightyellow;">
<strong>Horario de atención de 8:00am - 12:00m</strong>
</td>
</tr>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment