Skip to content

Instantly share code, notes, and snippets.

@theRealRizeo
Created January 3, 2023 08:07
Show Gist options
  • Save theRealRizeo/9ff6a9c9a3711002773110db7966e790 to your computer and use it in GitHub Desktop.
Save theRealRizeo/9ff6a9c9a3711002773110db7966e790 to your computer and use it in GitHub Desktop.
MCF Amazon change shipping method title
<?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