Media Mail Shows Free Shipping

  • Posts: 713
  • Thank you received: 37
  • Hikashop Business
1 year 2 months ago #348553

-- url of the page with the problem -- : www.ariesgamesandminis.com
-- HikaShop version -- : 4.7.0
-- Joomla version -- : 3.10.11

For years, my Media Mail option has been working just fine...this morning however, suddenly Media Mail comes up as Free Shipping, so now I just lost all profit on an item and it's costing me to ship this piece. I have not changed anything in Hikashop at all for about 2 months now

Can anyone tell me why this may be happening? I just logged into my test site, tested several other books, and all are coming up as Free Shipping when using Media Mail...so something has definitely happened.

I double checked with the US Postal Service, and they still show Media Mail as being active, even though there has been many price changes that went into effect as of today, January 23rd 2023.

Images attached are of the order in the backend, then on the site as a customer, and then from USPS for the actual charge it should have been.

Thank you

Attachments:
Last edit: 1 year 2 months ago by Dragon41673.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
1 year 2 months ago #348555

Hi,

This means that the USPS API provided a Media service without a "Rate" value.
It could be a bug in the USPS API following the changes they made.

To prevent that, what you can do is to add the code:

if(isset($rates[$mode]) && $rates[$mode]->shipping_price < 0.01) unset($rates[$mode]);
after the line:
$this->addRate($rates, $mode, $parcels, $rate, $currency, false);
(2 places) in the file plugins/hikashopshipping/usps/usps.php
It will prevent displaying any free shipping USPS shipping method on the checkout.

Please Log in or Create an account to join the conversation.

  • Posts: 713
  • Thank you received: 37
  • Hikashop Business
1 year 2 months ago #348582

nicolas wrote: Hi,

This means that the USPS API provided a Media service without a "Rate" value.
It could be a bug in the USPS API following the changes they made.

To prevent that, what you can do is to add the code:

if(isset($rates[$mode]) && $rates[$mode]->shipping_price < 0.01) unset($rates[$mode]);
after the line:
$this->addRate($rates, $mode, $parcels, $rate, $currency, false);
(2 places) in the file plugins/hikashopshipping/usps/usps.php
It will prevent displaying any free shipping USPS shipping method on the checkout.


Will this effect the free shipping via USPS I offer from time to time during a sale? Sounds like it would...which I cannot block.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
1 year 2 months ago #348587

Hi,

How do you offer free shipping via USPS ?
If it is with a coupon, then it won't change anything. This extra check I'm proposing is just after retrieving the rates from USPS, before the coupon(s) in the cart are calculated.

Please Log in or Create an account to join the conversation.

  • Posts: 713
  • Thank you received: 37
  • Hikashop Business
1 year 2 months ago #348624

Nope you're right, I wasn't thinking, that's setup as a manual shipping option on the shipping selections. Sorry. I'll try editing this code today and get that updated. Any issues I'll reply again.

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 713
  • Thank you received: 37
  • Hikashop Business
1 year 2 months ago #348626

Ok...I added the lines, and now Media Mail doesn't come up at all.

I offer Media Mail on books, I can't have it blocked, I really need it fixed. I called the US Postal Service and they still offer Media Mail, so an update to the API needs to be done so this returns proper shipping rates for Media Mail.

As such, I put the original file back into place for testing.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
1 year 2 months ago #348628

Hi,

I can have a look. Please provide a backend and a FTP access and instructions to reproduce the issue via our contact form:
www.hikashop.com/support/contact-us.html

Please Log in or Create an account to join the conversation.

  • Posts: 713
  • Thank you received: 37
  • Hikashop Business
1 year 2 months ago #348642

Nicolas it's the same access info you were using on the Multi Coupon problem...but I will send it again.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
1 year 2 months ago #348681

Hi,

While you had indeed provided a backend access for that other issue, please understand we have hundred of emails every week and we can't keep track of everyone's accesses. Plus, you might want to provide access to another website, so to be safe, I prefer asking again anyways. Also, I also needed a FTP access and instructions to reproduce the issue.
So I was able to reproduce the issue on the website thanks to your instructions and access your backend to check your settings, but you forgot to provide a FTP access. Just to be sure, I tried an old one you provided for that same website, but it didn't work anymore. I tried to do some debugging by uploading the package of the USPS plugin via the Joomla installer, but after several tries, I'm not able to do it.
I really need the FTP access to be able to debug the issue.

Please Log in or Create an account to join the conversation.

  • Posts: 713
  • Thank you received: 37
  • Hikashop Business
1 year 2 months ago #348682

Sorry...I completely missed the FTP access part. I'm sending that over right now via the contact form...hopefully this can get resolved asap as I have a batch of new books showing up today and people are going to be upset about Media Mail not being available.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
1 year 2 months ago #348687

Hi,

Thanks. So looking into it, I found that USPS indeed send the "Rate" with a 0 value. However, It also sends a "CommercialRate" with the shipping fee. I looked online for more information about this, and it seems that merchants can negotiate with USPS to get lower fees which are labeled as "Commercial Rates" and that's apparently what this is.
The USPS plugin so far was only taking into account the "Rate" value. So, I've made a patch to be able to use the rate based on what USPS provides and it seems to be working fine on your website.
I suppose you must have recently talked to USPS to lower your shipping fees and that's why you got that issue as the plugin never supported this, and it's kind of strange to send 0 for the Rate when there is a commercial rate instead of just providing the smaller fee directly in the same variable of the API.
Anyways, the patch is included on our end. So you can download the install package of the latest version of HikaShop on our website and install it on yours to get it for your live website.

Please Log in or Create an account to join the conversation.

  • Posts: 713
  • Thank you received: 37
  • Hikashop Business
1 year 2 months ago #348692

Hello,

Nope...only thing I contacted them on was if Media Mail was gone from the service, that was it...so it's definitely a change on their end not mine. I'll get the new package downloaded & going, thank you!

Please Log in or Create an account to join the conversation.

  • Posts: 106
  • Thank you received: 5
1 year 2 months ago #348693

This issue is affecting my First Class Mail rates, but strangely not Priority or Express. Is there a place we can download just the updated USPS plugin, or do we need to download the entire installer?

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
1 year 2 months ago #348701

Hi,

Download the entire HikaShop package, extract it on your local computer, and zip the files in the back/extensions/plg_hikashopshipping/usps folder and you'll get yourself an install package for the plugin only.

The following user(s) said Thank You: gpraceman

Please Log in or Create an account to join the conversation.

  • Posts: 106
  • Thank you received: 5
1 year 2 months ago #348703

Thanks. Got it applied and that resolved the issue.

Please Log in or Create an account to join the conversation.

Time to create page: 0.099 seconds
Powered by Kunena Forum