Provide a filter for the returned rate name. Include the quoted name as a param.

I’m a developer working for a client who needs rate names to be explicit to the returned rate, rather than the generic fallback provided on the settings page (i.e. rather than “Priority Mail”, they’d like “Priority Mail 2-Day”, for example).

I modified class-wc-shipping-usps.php with two lines of code to accomplish this, and I was hoping you guys could include the changes in a future update. The code in question is:

> line 618: $quoted_rate_name = strip_tags( htmlspecialchars_decode( (string) $quote->{‘MailService’} ) );

> line 797: $rate_name = apply_filters( ‘woocommmerce_usps_rate_name’, $rate_name, $quoted_rate_name );

With this code in place, I’m able to reference the filter in a separate plugin and set $rate_name = $quoted_rate_name. I think this would be helpful for others in similar situations.

Current Status

Open

Last updated: February 3, 2017

0 comments

Log in to comment on this feature request.

WooCommerce

The most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment