Mailchimp Banner | Q2 2024

added by Latoya

Product Icon

USPS Shipping Method

by  Woo
Get shipping rates from the USPS API which handles both domestic and international parcels.

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


Last updated: February 3, 2017


Log in to comment on this feature request.