Product Icon

USPS Shipping Method for WooCommerce

Trending
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.

Author

Current Status

Open

Last updated: February 3, 2017

0 comments

Log in to comment on this feature request.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.