-
Notifications
You must be signed in to change notification settings - Fork 461
Fix weight-based shipping rate breakpoints evaluation #2382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.x
Are you sure you want to change the base?
Fix weight-based shipping rate breakpoints evaluation #2382
Conversation
Sync 05.10.2025
Sync 14.12.2025
…convert cart lines weight to Kg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where weight-based shipping rate breakpoints were evaluated incorrectly due to inconsistent weight unit handling. The fix ensures cart weights and pricing tier thresholds are normalized to kilograms before comparison, allowing weight-based shipping tiers to apply correctly.
Key Changes:
- Normalized all weight calculations to kilograms using the Converter facade
- Removed incorrect scaling factor (×100) when saving and loading weight-based pricing breakpoints
- Added UI helper text and suffix to clarify that weight thresholds should be entered in kg
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/table-rate-shipping/src/Drivers/ShippingMethods/ShipBy.php | Converts product weights to kg before calculating total cart weight |
| packages/table-rate-shipping/src/Filament/Resources/ShippingZoneResource/Pages/ManageShippingRates.php | Removes ×100 scaling for weight values and adds kg suffix/helper text to form field |
| packages/table-rate-shipping/resources/lang/en/relationmanagers.php | Adds English helper text indicating weight should be entered in kg |
| packages/table-rate-shipping/resources/lang/ro/relationmanagers.php | Adds Romanian helper text indicating weight should be entered in kg |
| packages/table-rate-shipping/resources/lang/hu/relationmanagers.php | Adds Hungarian helper text indicating weight should be entered in kg |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/table-rate-shipping/src/Drivers/ShippingMethods/ShipBy.php
Outdated
Show resolved
Hide resolved
packages/table-rate-shipping/src/Drivers/ShippingMethods/ShipBy.php
Outdated
Show resolved
Hide resolved
...able-rate-shipping/src/Filament/Resources/ShippingZoneResource/Pages/ManageShippingRates.php
Outdated
Show resolved
Hide resolved
… min_quantity casting
Description
Related Issue
Type
What was changed
Expected Outcome
How to test