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 | |
/* | |
* https://www.zorem.com/hide-sales-data-from-the-woocommerce-shop-manager-role/ | |
* | |
* Remove WooCommerce Dashboard Status for shop manager | |
*/ | |
function remove_dashboard_widgets() { | |
if ( current_user_can( 'shop_manager' ) ) { | |
// remove WooCommerce Dashboard Status | |
remove_meta_box( 'woocommerce_dashboard_status', 'dashboard', 'normal' ); |
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( 'get_ast_provider_name', 'get_ast_provider_name_filter', 10, 2 ); | |
function get_ast_provider_name_filter( $tracking_provider, $results ) { | |
if ($tracking_provider == 'USPS' ) { | |
return "<span style='color:blue'>".$tracking_provider."</span>"; | |
} | |
return $tracking_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
/* | |
* Trackship.info | |
* tracking event description modify | |
*/ | |
add_filter( 'trackship_tracking_event_description', 'trackship_tracking_event_description', 10, 1 ); | |
function trackship_tracking_event_description( $message ){ | |
$search = array( | |
"China,", | |
"China", | |
"Rusia", |
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_email_order_items_args', 'ast_email_order_items_args_callback' ); | |
function ast_email_order_items_args_callback( $args ) { | |
$args['show_image'] = true; | |
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
add_filter('tracking_info_args','tracking_info_args_fun',10,2); | |
function tracking_info_args_fun($args,$order_id){ | |
if($args['tracking_provider'] == 'australia-post'){ | |
$args['tracking_number'] = '0003006985494006020994'; | |
} | |
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_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 ( !class_exists( 'WC_Advanced_Shipment_Tracking_Actions' ) ) { | |
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_filter( 'woocommerce_payment_complete_order_status', 'virtual_order_payment_complete_order_status', 10, 4 ); | |
/* | |
* move processing to completed | |
*/ | |
function virtual_order_payment_complete_order_status( $order_status, $order_id ) { | |
$order = wc_get_order( $order_id ); | |
if ( 'processing' == $order_status ) { | |
$virtual_order = null; |
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( 'bulk_actions-edit-shop_order', 'add_bulk_actions_change_order_status' , 50, 1 ); | |
function add_bulk_actions_change_order_status($bulk_actions){ | |
// Replace 'my-custom-status' with your custom order status slug | |
// Replace 'My Custom Status' with your custom order status name | |
$bulk_actions['mark_my-custom-status'] = __( 'Change status to My Custom Status', 'woocommerce' ); | |
return $bulk_actions; | |
} |
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
/** | |
* change message of remove cart item in woocommerce | |
**/ | |
function change_remove_cart_item_message($message,$product) { | |
return sprintf( __( '%s has been removed from your cart because it can no longer be purchased. Please contact us if you need assistance.', 'woocommerce' ), $product->get_name() ); | |
} | |
add_filter( 'cbr_cart_item_removed_message', 'change_remove_cart_item_message', 10, 2 ); |
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
/** | |
* redirect 404 error page. | |
*/ | |
function redirect_404_to_otherpage($url){ | |
return $url = get_permalink('page id'); | |
} | |
add_filter( 'cbr_redirect_page_dir', 'redirect_404_to_otherpage', 10, 1 ); |