- Issue created by @karlshea
- 🇺🇸United States jsimonis
We're having the same issue. Other rates are coming through, but media mail is $0.
- 🇺🇸United States karlshea Minneapolis 🇺🇸
I may have some time in the next week or two to get a proper patch ready for 7.x, but in the meantime this is the quick fix that I used.
In includes/commerce_usps.xml.inc, function commerce_usps_rate_v4_request:
// Make sure that the package service is registered. if (!empty($usps_service['machine_name'])) { $rate = $package->Postage->Rate; $commercial_rate = $package->Postage->CommercialRate; $rate = floatval($rate) ? $rate : $commercial_rate; $rates[$usps_service['machine_name']] = array( 'amount' => commerce_currency_decimal_to_amount((string) $rate, commerce_default_currency()), 'currency_code' => commerce_default_currency(), 'data' => array(), ); }
You can see how 8.x is handling this here: https://git.drupalcode.org/project/commerce_usps/-/blob/8.x-1.x/src/USPS...
I'm guessing a patch for 7.x would need to add a
rate_class
key to the services in commerce_usps_service_list, and do something similar when handling the response. - Status changed to Closed: duplicate
10 months ago 9:51am 29 February 2024