USPS plugin quotes 2× actual rate - dimensional weight from per-unit dimensions?

  • Posts: 212
  • Thank you received: 7
  • Hikashop Business
2 weeks 2 days ago #371989

-- url of the page with the problem -- : pearblossomfarms.com/products
-- HikaShop version -- : 6.4.1
-- Joomla version -- : 4.4.14
-- PHP version -- : 8.2
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : n/a

I'm seeing a systematic overquoting problem where the USPS plugin quotes customers roughly 2× what the shipper actually pays via Click-N-Ship (Business Rate Card / Commercial pricing), for the same USPS Ground Advantage service.

USPS Plugin Setup:

  • Origin ZIP: 81326 (Durango, CO area)
  • Service selected in plugin: USPS Ground Advantage only
  • Price Type: Commercial
  • Group Packages: Yes
  • Packaging weight: 0 oz, Weight approximation: 0%
  • Product dimensions entered per unit (e.g., a single jar: 4" × 3" × 3", 1.02 lb)

The problem — likely dimensional weight:

Product dimensions are entered per individual unit in HikaShop. For a multi-unit order (e.g., 12 jars), I believe the plugin packs N items using those per-unit dimensions and selects the smallest box from the configured box list that fits them.

Our box sizes:
  • Small: 12" × 10" × 12" (1,440 ci) — used for orders under 11 lbs
  • Medium: 16" × 14" × 16" (3,584 ci) — used for orders 11–32 lbs

The USPS dimensional weight threshold is 1,728 cubic inches (volume ÷ 166 = billed weight). Our Small box (1,440 ci) stays under the threshold — no dimensional weight, billed at actual weight. Our Medium box (3,584 ci) is well above it — dimensional weight = 3,584 ÷ 166 = 21.6 lb billed weight, even if the actual package weighs only 8–9 lbs.

Cross-referenced with real shipment data:

I exported 60 days of Click-N-Ship history (37 labels, all USPS Ground Advantage). Comparing actual postage paid to the website quote:
CustomerWebsite quotesActual GA paidRatio
Lauterbach$20.28$12.391.64×
Drake$35.37$14.092.51×
Hummel$33.10$8.483.90×
Kolb$25.24$10.742.35×
Steakley$16.81$13.831.22×

The "close" orders (ratio ~1.2×) are recent ones where product dimensions may happen to fit the correct box. The large outliers suggest the plugin is selecting the Medium box (triggering dimensional weight) when the actual shipper uses the Small box.

My questions:
  1. How does the plugin calculate which box to select for a multi-unit order? Does it sum per-unit volumes and find the smallest fitting box, or use a different algorithm?
  2. Does the plugin compute and send a dimensional weight to the USPS API when the selected box exceeds 1,728 ci? Or does it always send actual weight?
  3. Is there a way to set a fixed box size per product (rather than having the plugin compute from per-unit dimensions) so it always requests the rate for the box the shipper actually uses?
  4. Is the plugin currently using the new USPS API? I saw a March 2025 forum thread where Nicolas mentioned a new plugin was being developed to replace the old Web Tools API (retired January 25, 2026). We're now in May 2026 — is there an updated plugin I should install?

Happy to enable Debug mode and share the XML being sent to USPS at checkout if that helps diagnose.

Thank you.

(Note on Hikashop version: I am actually running an older version of HikaShop. The previous update broke image links on every product, reset the currency from USD to EUR, deleted the default shipping address, and disrupted the CSS — on a live production site. I have not been able to safely update since. I am testing the 6.4.1 update on a cloned subdirectory before applying it to the live site. I listed 6.4.1 to avoid the forum blocking my post — I hope that context is understandable.)

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

  • Posts: 85712
  • Thank you received: 14048
  • MODERATOR
2 weeks 2 days ago #371990

Hello,

1.
Regarding the packing logic, where the 2x to 3.9x discrepancy almost certainly comes from, HikaShop does not have a "shipping box catalogue" concept. It does not know about your Small (1,440 cu in) or Medium (3,584 cu in) USPS boxes. What it does instead, for every quote request, is:
- Take each product's per-unit dimensions (length, width, height) and weight.
- For an order line of N units of one product, build a virtual package by stacking N units along the product's smallest dimension. So for example 6 units of a 4 x 6 x 10 in product become a single 24 x 6 x 10 in virtual package. The other two dimensions stay at the single-unit max.
- Split that into additional packages only when a hard USPS limit is reached (provided by the plugin): 70 lb total weight, or 130 in length + girth.

2.
HikaShop doesn't compute DIM weight on its side. It sends raw weight + length/width/height to USPS, and USPS applies its own DIM weight rule on their end.

3.
There is no built-in way to map "Product X => Small Box" or "Product Y => Medium Box". The dimensions sent to USPS come from the product record, not from a box library. The two workarounds we suggest to merchants in your situation are:
- Set each product's dimensions to the dimensions of the shipping box that will actually be used for one unit of that product (so a soap that goes in a 6 x 6 x 4 mailer should be configured as 6 x 6 x 4, not as the bar itself). HikaShop's stacking logic for multi-unit orders then approximates a stack of those boxes, which is usually closer to the truth than stacking the bare products.
- Use a "Group packages" toggle on the plugin (setting "Group packages") and the per-API "Packaging weight" settings (Letters / Flats / Packages) to add the empty-box weight on top, so the rated weight matches what you actually put on the scale.
The "Group packages" option is enabled by default; when disabled, each unit is rated as its own package, which would absolutely explain a 2x+ overquote on multi-unit orders. Worth a quick check that it is on for your configuration.

A few other usual suspects for 2x+ over-quotes on Ground Advantage:

- "Price type" in the plugin settings: should be Commercial in your case (you mentioned you use Click-N-Ship Commercial Plus). Retail would be substantially higher.
- "Weight approximation" and "Dimension approximation" inputs in the plugin: any non-zero value here is added on top of every package's weight / smallest-dim and can quietly inflate the rated package.
- "Has nonstandard characteristics" toggle: if on, USPS adds a nonstandard surcharge that you probably do not pay on your own labels.

To investigate your specific 2x to 3.9x gap, what would help us most is one concrete order from your data:
- The list of products in the cart, each with their HikaShop product dimensions (L x W x H, units) and weight (units) as stored in the backend, and the quantity ordered.
- The shipping destination ZIP code.
- The rate HikaShop quoted at checkout, and the rate Click-N-Ship actually charged you on the label.
- A screenshot of the USPS plugin's settings page, especially the Price type, Services, Group packages, the approximation fields, and the packaging weight fields.

4.
Yes, the plugin we released last year at www.hikashop.com/marketplace/product/290-usps.html uses the new API.

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

  • Posts: 212
  • Thank you received: 7
  • Hikashop Business
1 week 9 hours ago #372098

Thank you for the detailed explanation — very helpful. Here is the concrete example you asked for, plus a follow-up question about upgrading.

Concrete order: Kolb (Order E2D1K94, 2026-05-10)

Product in cart:

  • Name: Dad's Green Jalapeño Sauce Case - 12 bottles
  • SKU: PBFR-12-SAU-GRN-R
  • HikaShop stored dimensions: 16.000 × 12.000 × 9.000 in (volume = exactly 1,728 ci)
  • HikaShop stored weight: 8.640 lb
  • Quantity ordered: 1

Destination ZIP: 83702 (Boise, ID)
Origin ZIP: 81326 (Bayfield/Durango, CO)

HikaShop quote at checkout: $25.24 (USPS Ground Advantage)
Actual paid via Click-N-Ship Business Rate Card: $10.74 (USPS Ground Advantage)
Ratio: 2.35×

Plugin settings at time of order:
  • Price Type: Commercial
  • Group packages: Yes
  • Packaging weight: 0 oz
  • Weight approximation: 0%
  • Has nonstandard characteristics: OFF

The edge-case question:

The product dimensions (16 × 12 × 9) produce a volume of exactly 1,728 ci — the precise USPS DIM weight threshold. When the plugin sends these dimensions to the USPS API, does USPS apply dimensional weight at exactly 1,728 ci (i.e., does it use ≥ 1,728 or > 1,728)? If DIM weight is triggered: 1,728 ÷ 166 = 10.41 lb billed weight vs 8.64 lb actual. That alone is a modest ~20% difference and would not explain the 2.35× overquote. So something else is inflating the rate further — possibly a zone or price-type discrepancy in what the API returns. The Debug output would presumably show this — happy to provide it if that helps.

Note: these product dimensions are the actual case dimensions (the product is sold as a 12-bottle case), so the stored dimensions already reflect what goes on the scale. The stacking logic for quantity=1 is irrelevant here.

Edit: I should clarify the plugin setup. I have two USPS plugins installed: the original built-in one (element: usps, ID 10093 in my installation) which is disabled, and the new marketplace plugin (element: usps2, ID 10856) which is active — purchased in February 2026. All quotes, including the Kolb example above, are coming from the new marketplace plugin running on the current USPS API.

---

Second question: safe HikaShop upgrade

We are currently on HikaShop Business 6.1.0 / Joomla 4.4.14. When we last updated HikaShop (some time ago), the update caused: all product image links to break (images had to be remapped one by one), currency reset from USD to EUR, default shipping address deleted, and CSS disruption to the storefront. This was on a live production site and it was a significant amount of recovery work — which is why we have not updated since.

We are planning to test the 6.1.0 → 6.4.1 update on a cloned subdirectory before touching the live site. Two questions:
  1. Is this kind of breakage (image relinking, currency/address reset) a known issue with certain HikaShop version jumps, or is it likely something specific to our installation? Knowing this would help us anticipate what to expect on the clone.
  2. Is there a recommended pre-update export or backup procedure — beyond a full database dump — that protects image assignments and configuration values specifically? We are aware of the Products CSV export but are not sure if that fully captures image file references in a way that makes reimport reliable.

Thank you again.

Attachments:
Last edit: 1 week 9 hours ago by conticreative.

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

  • Posts: 85712
  • Thank you received: 14048
  • MODERATOR
1 week 23 minutes ago #372103

Thank you for the very detailed example. It actually points straight at the cause, and it is not the packing or dimensional weight.

On the dimensional weight edge case first, so it is out of the way: for Ground Advantage, USPS only applies dimensional weight to parcels that measure more than one cubic foot (more than 1,728 cubic inches), and only for zones 5 to 9. Your case is exactly 1,728 ci, which is the threshold, not above it, so dimensional weight does not trigger at all here. The package is rated on its actual 8.64 lb. So DIM weight is not what is inflating your quote.

The real cause is the price tier the plugin is asking USPS for. The new plugin has a "Price type" setting with three values: Retail, Commercial and Contract. You have it set to Commercial, so the USPS API returns the published Commercial Base price. The rate you actually pay through Click-N-Ship Business (your Business Rate Card) is not the published Commercial price, it is account specific negotiated pricing, which USPS exposes through the API only under the Contract price type, and only when you identify your account.

So the fix to try is:

- In the USPS plugin settings, set "Price type" to Contract.
- Fill in "Account type" with the type that matches your USPS account (EPS, PERMIT or METER, EPS being the usual one for a Click-N-Ship / online account).
- Fill in "Account number" with your USPS account number.

With those set, the plugin sends your account details to USPS and the API returns your account's contract pricing instead of the generic Commercial price. That is what should bring the quotes down to what you actually pay on the label. If your Business Rate Card is tied to that account, Contract is the price type that surfaces it.

To verify exactly what each price type returns for a given order, enable Debug mode in the plugin and place a test order through checkout. The payment log file in the HikaShop configuration page will show the request sent to USPS and the prices returned, so you can compare Commercial vs Contract side by side for the same parcel.

On your example numbers, a $25.24 Commercial quote versus $10.74 Business Rate Card is exactly the kind of gap you would expect between published Commercial and account contract pricing, so this is very likely the whole story.

On your second question about upgrading:

The breakage you described from the previous update (product images unlinking, currency reset from USD to EUR, default shipping address deleted) is not normal HikaShop update behaviour. A standard update does not touch your currency configuration, your stored product image assignments, or your addresses. There is no code in HikaShop's update mechanism (even updating from really old versions) in order to trigger what you describe. So it is most likely specific to how that one update ran on your server, not an expected behaviour of a given version jump. From what you're saying, I would say that the hikashop_config table in the database got emptied and default data got put in afterwards.

Your plan to test 6.1.0 to 6.4.1 on a cloned subdirectory first is exactly the right approach. A few points for the clone:

- A full file backup plus a full database dump is the authoritative backup. There is no separate export needed to protect image assignments or config values: the image assignments live in the database (the hikashop_file table) and the configuration lives in the hikashop_config table, so a complete database dump already captures both. The Products CSV export is not the right tool for that and is not needed for the backup.
- Run the update in one clean pass: put the site offline, make sure PHP max_execution_time and memory_limit are generous, and let the update finish without interruption.
- After updating the clone, check the configuration page (currency, default addresses) and a few products with images before touching the live site.

If the clone update completes cleanly and your config and images are intact, the live update should behave the same way.

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

  • Posts: 212
  • Thank you received: 7
  • Hikashop Business
4 days 9 hours ago #372123

I have edited the USPS plugin according to your guidelines. I am about to test it, but in the meantime I also tried a final upgrade of Hikashop pro on a clone of the website.

Update on the upgrade question:
I tested the 6.1.0 → 6.4.1 update on a cloned subdirectory with the following PHP settings (screenshot attached):

  • max_execution_time: 300
  • max_input_time: 300
  • memory_limit: 256M
  • PHP version: ea-php82
PHP Configuration


The installation wizard did not appear this time, which is progress (I attached the one that appeared the first time around for reference).


However, the same configuration fields were reset:
  • Currency: reverted to EUR (was USD)
  • Store address: cleared
  • Tax zone: reverted to Europe
  • Image thumbnail dimensions: reset to 100px (were 200px)
Image file links were preserved — products still show their images, which is an improvement over previous attempts.
Since the wizard did not run, the reset appears to be coming from the update process itself reinserting default values into the hikashop_config table, rather than from the wizard overwriting it. Is that correct? Is there a specific step or setting that controls whether the update rewrites config table defaults, and is there a way to prevent it?
Screenshots of before/after configuration attached.

Front End Comparison (Before > After)


Configuration Fields reset (before > After)

Attachments:

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

  • Posts: 85712
  • Thank you received: 14048
  • MODERATOR
4 days 1 hour ago #372125

Hi,

There is no such step or setting because this is not supposed to happen and it doesn't happen for anyone else when updating their HikaShop.
What's likely is that you have a problem with the hikashop_config table which leads to the update system behaving in an unexpected manner.
Try clicking on the "Check database" button on the configuration page of HikaShop. Does it says anything about the hikashop_config table ?

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

  • Posts: 212
  • Thank you received: 7
  • Hikashop Business
3 days 10 hours ago #372145

Indeed, when I checked the DB it gave me the following errors (I am pasting the entirety of the "check DB" results, Sorry if that's too much, as it's toward the bottom. I placed the error alone right under and the entire DB check after it.)

DB Error

Error Unknown column 'action_button_type' in 'WHERE'
Error hikashop_config: Duplicate entry 'cart_retaining_period_checked' for key 'PRIMARY'
Error
ALTER TABLE #__hikashop_config ADD PRIMARY KEY(config_namekey)
Info Missing core categories fixed

Full DB Check
OK Table "hikashop_address" checked
OK Table "hikashop_badge" checked
OK Table "hikashop_banner" checked
OK Table "hikashop_cart" checked
OK Table "hikashop_cart_product" checked
OK Table "hikashop_category" checked
OK Table "hikashop_characteristic" checked
OK Table "hikashop_click" checked
OK Table "hikashop_config" checked
OK Table "hikashop_currency" checked
OK Table "hikashop_discount" checked
OK Table "hikashop_download" checked
OK Table "hikashop_entry" checked
OK Table "hikashop_field" checked
OK Table "hikashop_file" checked
OK Table "hikashop_filter" checked
OK Table "hikashop_geolocation" checked
OK Table "hikashop_history" checked
OK Table "hikashop_limit" checked
OK Table "hikashop_massaction" checked
OK Table "hikashop_order" checked
OK Table "hikashop_orderstatus" checked
OK Table "hikashop_order_product" checked
OK Table "hikashop_payment" checked
OK Table "hikashop_price" checked
OK Table "hikashop_product" checked
OK Table "hikashop_product_category" checked
OK Table "hikashop_product_related" checked
OK Table "hikashop_plugin" checked
OK Table "hikashop_shipping" checked
OK Table "hikashop_shipping_price" checked
OK Table "hikashop_tax" checked
OK Table "hikashop_taxation" checked
OK Table "hikashop_user" checked
OK Table "hikashop_variant" checked
OK Table "hikashop_vote" checked
OK Table "hikashop_vote_user" checked
OK Table "hikashop_waitlist" checked
OK Table "hikashop_widget" checked
OK Table "hikashop_zone" checked
OK Table "hikashop_zone_link" checked
OK Table "hikashop_warehouse" checked
OK Table "hikashop_email_log" checked
Error Unknown column 'action_button_type' in 'WHERE'
Error hikashop_config: Duplicate entry 'cart_retaining_period_checked' for key 'PRIMARY'
Error
ALTER TABLE #__hikashop_config ADD PRIMARY KEY(config_namekey)
Info Missing core categories fixed
OK Product categories checked
OK Variants orphan links cleaned
OK Joomla users synchronized
OK User email addresses synchronized

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

  • Posts: 85712
  • Thank you received: 14048
  • MODERATOR
3 days 1 hour ago #372146

Hi,

The hikashop_config table is supposed to have a primary key on the config_namekey column, so there is only one entry per setting. The update system relies on that primary key: if an entry already exists for a setting it leaves it alone, otherwise it adds it. On your database that primary key is missing, so each update keeps adding a new (default) row for settings that already exist. When HikaShop reads the table, the last row returned by MySQL wins, which is the newly added default one, and your real settings look wiped out.

So the fix is to remove the duplicate rows (keeping one per setting) and let "Check database" put the primary key back. Rather than deleting them one namekey at a time, you can clean the whole table at once.

1. First make a backup: in phpMyAdmin, select the hikashop_config table and use Export, so you have a copy if anything goes wrong.

2. Then open the SQL tab and run this (replace PREFIX_ with your table prefix, the part before hikashop_config that you see in phpMyAdmin):

ALTER TABLE PREFIX_hikashop_config ADD COLUMN tmp_id INT AUTO_INCREMENT PRIMARY KEY;

DELETE c1 FROM PREFIX_hikashop_config c1
JOIN PREFIX_hikashop_config c2
ON c1.config_namekey = c2.config_namekey AND c1.tmp_id > c2.tmp_id;

ALTER TABLE PREFIX_hikashop_config DROP PRIMARY KEY, DROP COLUMN tmp_id;

What it does: it temporarily numbers the rows in the order they were added, deletes every duplicate while keeping the oldest one of each setting (your original value, not the default that was re-added), then removes that temporary column. It does this for every setting at once, not only cart_retaining_period_checked.

3. Click the "Check database" button again. With the duplicates gone, it will be able to add the missing primary key to hikashop_config, and the problem won't come back on the next updates.

4. Finally, go through your HikaShop configuration page settings and re-save anything that still looks wrong; now that there is a single entry per setting, the saved value sticks.

If "Check database" then reports the same kind of duplicate-key error on another table, the same approach works on that table by changing the table name (and the column it complains about).

The action_button_type error is probably linked to this and I hope the steps above will also take care of this.

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

Time to create page: 0.757 seconds
Powered by Kunena Forum