Skip to content

Instantly share code, notes, and snippets.

@renjith-ph
Created March 5, 2019 17:07
Show Gist options
  • Save renjith-ph/2a6abf559b0694e23b7d7272afd5150d to your computer and use it in GitHub Desktop.
Save renjith-ph/2a6abf559b0694e23b7d7272afd5150d to your computer and use it in GitHub Desktop.
Template to attach shipment tracking number in WooCommerce Email Customizer with Drag and Drop Email Builder. WooCommerce Shipment Tracking Pro - https://www.pluginhive.com/product/woocommerce-shipment-tracking-pro/
<?php
/**
* Custom code shortcode
*
* This template can be overridden by copying it to yourtheme/woocommerce_email_cuztomizer_with_drag_and_drop_builder/woo_mail/custom_code.php.
* @var $order WooCommerce order
* @var $email_id WooCommerce email id (new_order, cancelled_order)
* @var $sent_to_admin WooCommerce email send to admin
* @var $plain_text WooCommerce email format
* @var $email WooCommerce email object
* @var $attr array custom code attributes
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// To include woocommerce shipment tracking details in email sent for order. Link -https://www.flycart.org/products/wordpress/woocommerce-email-customizer
// Shortcode [woo_mb_custom_code type="ph_fst"]
if(isset($attr['type']) && $attr['type'] == 'ph_fst'){
do_action( 'ph_fetch_shipment_tracking_details', $order );
}
@renjith-ph
Copy link
Author

Steps -

  1. Place the above code in yourtheme/woocommerce_email_cuztomizer_with_drag_and_drop_builder/woo_mail/custom_code.php
  2. Use [woo_mb_custom_code type="ph_fst"] as shortcode

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