Created
November 14, 2020 05:49
-
-
Save praveencs87/c23b68855a7f94a1ed4b81b64ed84a7a to your computer and use it in GitHub Desktop.
Yith Delivery Date Filed Label Change based on Shipping Method - webinwordpress.com
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 | |
//Chnage based on Shipping | |
if(!function_exists( 'ywcdd_change_label_datefield' ) ) { | |
add_filter( 'ywcdd_change_datepicker_label', 'ywcdd_change_label_datefield', 10 ); | |
function ywcdd_change_label_datefield() { | |
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); | |
if(isset($chosen_methods)) { | |
$chosen_shipping = $chosen_methods[0]; | |
if ($chosen_shipping == 'local_pickup') { | |
return __( 'Local Pickup Date', 'yith-woocommerce-delivery-date' ); | |
} | |
else { | |
return __( 'Delivery date', 'yith-woocommerce-delivery-date' ); | |
} | |
} else { | |
return __( 'Delivery Date', 'yith-woocommerce-delivery-date' ); | |
} | |
} | |
} | |
// Change Email Labels | |
add_filter( 'ywcdd_show_date_shipping_details', '__return_false' ); | |
if( !function_exists( 'ywcdd_change_date_label')) { | |
add_filter( 'ywcdd_change_delivery_date_label', 'ywcdd_change_date_label' ); | |
function ywcdd_change_date_label() { | |
return __( 'Delivery/Pickup Date', 'yith-woocommerce-delivery-date' ); | |
} | |
} | |
//Yith Delivery Date Filed Label Change based on Shipping Method - webinwordpress.com | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment