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 | |
function ast_api_create_item_arg_filter( $args ) { | |
if( $args['tracking_provider'] == 'dhlglobalmail' ){ | |
$args['tracking_provider'] = 'dhl-express'; | |
} | |
return $args; | |
} |
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 | |
if ( class_exists( 'zorem_woocommerce_advanced_shipment_tracking' ) ) { | |
add_action( 'wp_wc_invoice_pdf_start_template', function() { | |
$tracking_actions = $GLOBALS[ 'WC_advanced_Shipment_Tracking' ]; | |
remove_action( 'woocommerce_email_before_order_table', array( $tracking_actions, 'email_display' ), 0, 4 ); | |
}); | |
add_action( 'wp_wc_invoice_pdf_end_template', function() { | |
$tracking_actions = $GLOBALS[ 'WC_advanced_Shipment_Tracking' ]; |
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_delivered_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', 'delivered_woocommerce_order_is_paid_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
//With this endpoint you can add new tracking info to orders: | |
POST /wp-json/wc-ast/v3/orders/<order_id>/shipment-trackings/ | |
curl -X POST https://your-domain.com/wp-json/wc-ast/v3/orders/<order_id>/shipment-trackings | |
-u consumer_key:consumer_secret | |
-H "Content-Type: application/json" | |
-d '{ | |
"tracking_provider": "Fedex", | |
"tracking_number": "12345678", |
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
GET /wp-json/wc-ast/v3/orders/<order_id>/shipment-trackings/ | |
curl -X GET https://your-domain.com/wp-json/wc-ast/v3/orders/<order_id>/shipment-trackings | |
-u consumer_key:consumer_secret | |
//JSON response: | |
{ | |
"tracking_id": "feb9bde4475fda92cc9408607b7ecb66", | |
"tracking_provider": "Fedex", |
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
DELETE /wp-json/wc-ast/v3/orders/<order_id>/shipment-trackings/ | |
curl -X DELETE https://your-domain.com/wp-json/wc-ast/v3/orders/<order_id>/shipment-trackings/fa61d174a05d2f34323b51d92823947d | |
-u consumer_key:consumer_secret | |
//response example: | |
"Tracking ID: fa61d174a05d2f34323b51d92823947d" |
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( "wcalr_login_redirect", "wcalr_login_redirect_link", 10, 1); | |
function wcalr_login_redirect_link($link){ | |
$link = get_home_url(); | |
return $link; | |
} |
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( "wcalr_register_redirect", "wcalr_register_redirect_link", 10, 1); | |
function wcalr_register_redirect_link($link){ | |
$link = get_home_url(); | |
return $link; | |
} |
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
add_action( "wcalr_after_login", 'wcalr_after_login_func', 10, 1 ); | |
function wcalr_after_login_func($user_signon){ | |
wp_set_current_user($user_signon->ID); | |
wp_set_auth_cookie($user_signon->ID); | |
} |
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> |
OlderNewer