Skip to content

Instantly share code, notes, and snippets.

@rwkyyy
Created January 13, 2022 21:03
Show Gist options
  • Save rwkyyy/2c60bd8d7b4e0a4400b3c5f8971c76a1 to your computer and use it in GitHub Desktop.
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
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 );
@rwkyyy
Copy link
Author

rwkyyy commented Aug 31, 2022

@Valentinws

  1. folosește un sistem de nomenclator al localităților precum wc city select
  2. dacă nu greșesc are deja opțiune în integrarea sameday, dar asta dacă ai parametrul de greutate trecut la fiecare produs (verifică documentația lor, cel mai sigur)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment