How can we improve WooCommerce?

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.

0 votes
Vote
Sign in
(thinking…)
Password icon
Signed in as (Sign out)
You have left! (?) (thinking…)
AdminWooCommerce (Product Owner, WooCommerce) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...

WooCommerce: Extension - WooCommerce Shipping USPS

Feedback and Knowledge Base