This file contains 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 | |
// Checkout Validation exclude country | |
add_filter('checkout_validation_exclude_country', 'checkout_validation_exclude_country'); | |
function checkout_validation_exclude_country(){ | |
return array('US'); | |
} |
This file contains 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 this code to your theme functions.php file or a custom plugin | |
function ast_api_create_item_arg_filter( $args ) { | |
$args['status_shipped'] = 1; | |
return $args; | |
} | |
add_filter( 'ast_api_create_item_arg', 'ast_api_create_item_arg_filter', 10, 1 ); |
This file contains 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 | |
// Send sms when pending payment after 1 hour of create order. | |
add_action('woocommerce_new_order', function ($order_id) { | |
// You can change trigger time of Pending payment notifications SMS | |
// if you want send notifications after 2 hour you should use 2 hour multiply by 3600 | |
as_schedule_single_action( time() + 7200, 'send_pending_payment_sms', array( $order_id ) ); // You need to change only time instead of 7200 if you want to change instead of 2 hour. | |
}, 10, 1); | |
add_action( 'init', 'send_pending_notifications', 1, 1 ); | |
function send_pending_notifications() { |
This file contains 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 | |
// Checkout Validation allowed country | |
add_filter('checkout_validation_allowed_country', 'checkout_validation_allowed_country'); | |
function checkout_validation_allowed_country(){ | |
return array('AU'); | |
} |
This file contains 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( 'smswoo_additional_charsets', 'additional_charsets_for_vonage' ); | |
function additional_charsets_for_vonage() { | |
return 'unicode'; | |
} |
This file contains 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 AST tracking info in customer SMS using Twilio SMS Notifications plugin */ | |
add_filter( 'wc_twilio_sms_customer_sms_before_variable_replace', 'ast_pro_wc_twilio_sms_message_replacement', 10, 2 ); | |
if ( !function_exists( 'ast_pro_wc_twilio_sms_message_replacement' ) ) { | |
function ast_pro_wc_twilio_sms_message_replacement( $message, $order ) { | |
if ( !function_exists( 'ast_get_tracking_items' ) ) { | |
return; | |
} | |
This file contains 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( 'apg_sms_message', 'ast_pro_apg_sms_message_fun', 10, 2 ); | |
/** | |
* Add tracking info in SMS when order status is completed | |
* Compatibility with - WC – APG SMS Notifications | |
* | |
*/ | |
if ( !function_exists( 'ast_pro_apg_sms_message_fun' ) ) { | |
function ast_pro_apg_sms_message_fun( $message , $order_id ) { | |
This file contains 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 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']; |
This file contains 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
/* | |
* Remove est delivery date from shipment status email and tracking page widget | |
*/ | |
add_filter( 'show_est_delivery_date', 'est_delivery_date_in_email', 10, 2 ); | |
function est_delivery_date_in_email( $bool, $provider ) { | |
if ( 'USPS' == $provider ) { | |
$bool = false; | |
} | |
return $bool; | |
} |
NewerOlder