Created
January 13, 2022 21:03
-
-
Save rwkyyy/2c60bd8d7b4e0a4400b3c5f8971c76a1 to your computer and use it in GitHub Desktop.
afișare număr awb și buton în mail-urile de WC - Sameday România
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
| function rwky_display_awb_mail( $order, $sent_to_admin, $plain_text ) { | |
| // global $wpdb; | |
| $awb = SamedayCourierQueryDb::getAwbForOrderId( sanitize_key( $order->get_id() ) ); | |
| $awbNumber = $awb->awb_number; | |
| if ( $awbNumber ) { | |
| echo 'Poți urmări expediția aici:<br><a href="https://sameday.ro/#awb=' . $awbNumber . '" class="button" >AWB: ' . $awbNumber . '</a></br></br>'; | |
| } else { | |
| echo ''; | |
| } | |
| } | |
| add_action( 'woocommerce_email_before_order_table', 'rwky_display_awb_mail', 30, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Valentinws