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
//With this endpoint you can add new tracking info to orders: | |
POST /wp-json/wc-ast-pro/v3/orders/<order_id>/shipment-trackings/ | |
curl -X POST https://your-domain.com/wp-json/wc-ast-pro/v3/orders/<order_id>/shipment-trackings | |
-u consumer_key:consumer_secret | |
-H "Content-Type: application/json" | |
-d '{ | |
"tracking_provider": "USPS", | |
"tracking_number": "123456", |
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 this code to your theme functions.php file or a custom plugin | |
add_action('init', 'register_order_status'); | |
//add status after completed | |
add_filter('wc_order_statuses', 'add_custom_status_to_order_statuses'); | |
//Custom Statuses in admin reports | |
add_filter('woocommerce_reports_order_statuses', 'include_custom_order_status_to_reports', 20, 1); | |
// for automate woo to check order is paid | |
add_filter('woocommerce_order_is_paid_statuses', 'custom_status_woocommerce_order_is_paid_statuses'); | |
/*** Register new status : Delivered |
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
/* | |
* status_shipped - (0=no,1=shipped,2=partial shipped(if partial shipped order status is enabled)) | |
*/ | |
public function update_label_order_meta_data( $order_id, $new_label_data ) { | |
$result = $new_label_data; | |
$labels_data = $this->get_label_order_meta_data( $order_id ); | |
foreach( $labels_data as $index => $label_data ) { | |
if ( $label_data['label_id'] === $new_label_data->label_id ) { | |
$result = array_merge( $label_data, (array) $new_label_data ); | |
$labels_data[ $index ] = $result; |
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 ( class_exists( 'WC_Advanced_Shipment_Tracking_Actions' ) ) { | |
$order_id = 123; | |
$wc_ast_unclude_tracking_info = get_option('wc_ast_unclude_tracking_info'); | |
$order = wc_get_order( $order_id ); | |
$order_status = $order->get_status(); | |
if ( is_a( $email, 'WC_Email_Customer_Invoice' ) && isset($wc_ast_unclude_tracking_info['show_in_customer_invoice']) && $wc_ast_unclude_tracking_info['show_in_customer_invoice'] == 0){ |
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_action( 'ast_trigger_ts_status_change', 'ast_send_status_change_sms_twillio', 10, 3 ); | |
function ast_send_status_change_sms_twillio($order_id, $old_status, $new_status){ | |
$wc_ast_api_key = get_option('wc_ast_api_key'); | |
$blog_title = get_bloginfo(); | |
if ( !is_plugin_active( 'woo-advanced-shipment-tracking/woocommerce-advanced-shipment-tracking.php' ) ) { | |
return; | |
} | |
if( !$wc_ast_api_key ){ | |
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 | |
// Add this code to your theme functions.php file or a custom plugin | |
add_action('init', 'register_partial_shipped_order_status'); | |
//add status after completed | |
add_filter('wc_order_statuses', 'add_partial_shipped_to_order_statuses'); | |
//Custom Statuses in admin reports | |
add_filter('woocommerce_reports_order_statuses', 'include_partial_shipped_order_status_to_reports', 20, 1); | |
// for automate woo to check order is paid | |
add_filter('woocommerce_order_is_paid_statuses', 'partial_shipped_woocommerce_order_is_paid_statuses'); | |
/*** Register new status : Delivered |
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 AST PRO plugin is Installed | |
if ( class_exists( 'AST_Pro_Actions' ) ) { | |
$order_id = '123'; //Replace with your order id | |
$tracking_provider = 'USPS'; //Replace with your shipping provider | |
$tracking_number = '123123'; //Replace with your tracking number | |
$date_shipped = '2020-06-22'; ////Replace with your shipped date | |
$status_shipped = 1; // 0=no,1=shipped,2=partial shipped(if partial shipped order status is enabled) | |
$sku = 't-shirt,blue-jeans'; //the line item (product) SKU |
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( 'ast_provider_title', 'ast_provider_title_fun' ); | |
function ast_provider_title_fun($provider){ | |
if($provider == 'UPS')$provider = 'Updated UPS'; | |
return $provider; | |
} | |
?> |
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 | |
// Filter for change description before tracking form | |
// Default text - To track your order please enter your Order ID in the box below and press the "Track" button. This was given to you on your receipt and in the confirmation email you should have received. | |
add_filter( 'ast_tracking_page_front_text', 'ast_tracking_page_front_text_fun' ); | |
function ast_tracking_page_front_text_fun($string){ | |
$string = 'Updated Text'; | |
return $string; | |
} | |
// Filter for change text of order label in form |
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP:Authorization} ^(.*) | |
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1] | |
</IfModule> |