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 | |
// Register the custom order status | |
add_action('init', 'register_updated_tracking_status'); | |
// Add the new status after 'completed' | |
add_filter('wc_order_statuses', 'add_updated_tracking_to_order_statuses'); | |
// Include the new status in WooCommerce reports | |
add_filter('woocommerce_reports_order_statuses', 'include_updated_tracking_status_to_reports'); |
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_shipped_order_status'); | |
// Add status after completed | |
add_filter('wc_order_statuses', 'add_shipped_to_order_statuses'); | |
// Custom Statuses in admin reports | |
add_filter('woocommerce_reports_order_statuses', 'include_shipped_order_status_to_reports', 20, 1); | |
// For automate woo to check order is paid | |
add_filter('woocommerce_order_is_paid_statuses', 'shipped_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
function ast_ali2woo_shipping_provider_callback( $shipping_provider ) { | |
return 'Cainiao'; | |
} | |
add_filter( 'ast_ali2woo_shipping_provider', 'ast_ali2woo_shipping_provider_callback' ); |
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
function ast_ali2woo_shipping_provider_callback( $shipping_provider ) { | |
return 'Cainiao'; | |
} | |
add_filter( 'ast_ali2woo_shipping_provider', 'ast_ali2woo_shipping_provider_callback' ); |
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_filter( 'ast_formated_order_id', 'ast_formated_order_id', 10, 2 ); | |
function ast_formated_order_id( $order_id , $original_order_id ) { | |
if ( class_exists( 'S2W_IMPORT_SHOPIFY_TO_WOOCOMMERCE' ) ) { | |
$query_args = array( | |
'numberposts' => 1, | |
'meta_key' => '_s2w_shopify_order_number', | |
'meta_value' => $order_id, | |
'post_type' => 'shop_order', | |
'post_status' => 'any', |
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
/*Theme Name: Child Theme twentyeleven (required) | |
Theme URI: http: //example.com/ (optional) | |
Description: Child theme for the Twenty Eleven theme (optional) | |
Author: Your name here (optional) | |
Author URI: http: //example.com/about/ (optional) | |
Template: twentyeleven (required)Version: 0.1.0 (optional) |
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
function wpr_snap($atts, $content = null) { | |
extract(shortcode_atts(array( | |
"snap" => 'http://s.wordpress.com/mshots/v1/', | |
"url" => 'http://www.internoetics.com', | |
"alt" => 'Image text', | |
"w" => '400', // width | |
"h" => '300' // height | |
), $atts)); | |
$img = '<img src="' . $snap . '' . urlencode($url) . '?w=' . $w . '&h=' . $h . '" alt="' . $alt . '">'; |
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
//assign user in guest order | |
add_action( 'woocommerce_new_order', 'action_woocommerce_new_order', 10, 1 ); | |
function action_woocommerce_new_order( $order_id ) { | |
$order = new WC_Order($order_id); | |
$user = $order->get_user(); | |
if( !$user ){ | |
//guest order | |
$userdata = get_user_by( 'email', $order->get_billing_email() ); | |
if(isset( $userdata->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
<?php | |
// Add this code to your theme functions.php file or a custom plugin | |
add_filter( 'ast_api_create_item_arg', 'ast_api_create_item_arg_filter', 10, 1 ); | |
function ast_api_create_item_arg_filter( $args ) { | |
if( is_numeric( $args['tracking_number'] ) && $args['tracking_provider'] == 'ups' ){ | |
$args['tracking_provider'] = 'usps'; | |
} | |
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' ]; |
NewerOlder