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
<?php | |
/** | |
* Completed Order sent to Customer | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
echo "= " . $email_heading . " =\n\n"; |
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
<?php | |
/** | |
* Completed Order sent to Customer. | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** |
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
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
if ( ! class_exists( 'WC_Email' ) ) { | |
return; | |
} | |
/** |
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
<?php | |
/** | |
* Class My_Custom_Status_WC_Email | |
*/ | |
class Delivered_WC_Email { | |
/** | |
* Delivered_WC_Email constructor. | |
*/ | |
public function __construct() { |
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
<?php | |
add_filter('woocommerce_order_is_paid_statuses', 'custom_status_woocommerce_order_is_paid_statuses'); | |
function custom_status_woocommerce_order_is_paid_statuses($statuses) | |
{ | |
$statuses[] = 'my-custom-status'; | |
return $statuses; | |
} |
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
<?php | |
add_filter('woocommerce_reports_order_statuses', 'include_custom_order_status_to_reports', 20, 1); | |
function include_custom_order_status_to_reports($statuses) | |
{ | |
// Replace 'my-custom-status' with your custom order status slug | |
if ($statuses) | |
$statuses[] = 'my-custom-status'; | |
return $statuses; | |
} |
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
<?php | |
add_filter('wc_order_statuses', 'add_custom_status_to_order_statuses'); | |
function add_custom_status_to_order_statuses($order_statuses) | |
{ | |
// Replace 'my-custom-status' with your custom order status slug | |
// Replace 'My Custom Status' with your custom order status name | |
$new_order_statuses = array(); | |
foreach ($order_statuses as $key => $status) { | |
$new_order_statuses[$key] = $status; | |
if ('wc-completed' === $key) { |
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
<?php | |
/* | |
* This function is registering our custom status as a post status in WordPress. | |
*/ | |
add_action('init', 'register_custom_order_status'); | |
function register_custom_order_status() | |
{ | |
register_post_status('wc-my-custom-status', array( // Replace 'my-custom-status' with your custom order status slug | |
'label' => __('My Custom Status', 'text-domain'), // Replace 'My Custom Status' with your custom order status name | |
'public' => true, |
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
<?php | |
add_filter( 'wc_order_statuses', 'wc_renaming_order_status' ); | |
/* | |
* Rename WooCommerce Order Status | |
*/ | |
function wc_renaming_order_status( $order_statuses ) { | |
foreach ( $order_statuses as $key => $status ) { | |
$new_order_statuses[ $key ] = $status; |
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
<?php | |
// Check if function exist | |
if ( function_exists( 'ast_get_tracking_items' ) ) { | |
$order_id = 123; // Replace with your order_id | |
$tracking_items = ast_get_tracking_items($order_id); | |
foreach($tracking_items as $tracking_item){ | |
$tracking_number = $tracking_item['tracking_number']; |