WooCommerce - Adds a custom message about how long will take to delivery.
This file contains 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
<?php | |
/** | |
* Adds a custom message about how long will take to delivery. | |
*/ | |
function my_wc_custom_cart_shipping_notice() { | |
echo '<tr class="shipping-notice"><td colspan="2"><small>'; | |
_e( '<strong>Atenção:</strong> O prazo de entrega começa a contar a partir da aprovação do pagamento.', 'my-text-domain' ); | |
echo '</small></td></tr>'; | |
} | |
add_action( 'woocommerce_cart_totals_after_shipping', 'my_wc_custom_cart_shipping_notice' ); | |
add_action( 'woocommerce_review_order_after_shipping', 'my_wc_custom_cart_shipping_notice' ); | |
/** | |
* Adds a custom message about how long will take to delivery in emails. | |
* | |
* @param WC_Order $order Order data. | |
* @param bool $sent_to_admin True if is an admin email. | |
*/ | |
function my_wc_custom_email_shipping_notice( $order, $sent_to_admin ) { | |
if ( $sent_to_admin ) { | |
return; | |
} | |
_e( '<strong>Atenção:</strong> O prazo de entrega começa a contar a partir da aprovação do pagamento.', 'my-text-domain' ); | |
} | |
add_action( 'woocommerce_email_after_order_table', 'my_wc_custom_email_shipping_notice', 100, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Olá, tudo bem? Onde eu adiciono esse código?