Created
January 3, 2023 08:07
-
-
Save theRealRizeo/9ff6a9c9a3711002773110db7966e790 to your computer and use it in GitHub Desktop.
MCF Amazon change shipping method title
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_shipping_method_title', 'change_mcf_shipping_method_title', 10, 2 ); | |
/** | |
* Modify the method shipping title. | |
* This will affect both the title and the method title. | |
* | |
* @param string $method_title The method title. | |
* @param WC_Shipping_Method $shipping_class The shipping method. | |
* | |
* @return string | |
*/ | |
function change_mcf_shipping_method_title( $method_title, $shipping_class ) { | |
if ( 'WC_Shipping_Amazon' === $shipping_class->id ) { | |
return 'Amazon Shipping'; // Set your custom title here. | |
} | |
return $method_title; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment