freento / dimensional-shipping

freento/dimensional-shipping

Dimensional Shipping module with REST API integration

magento2-module Compatibility: Not compatible Code Quality: Fail Tests: N/A Security: Pass Open

Freento_DimensionalShipping

A Magento 2 module for calculating shipping costs based on product dimensions using 3D bin packing via REST API.

Features

  • 3D Bin Packing: Calculates optimal packing of items into shipping boxes via external REST API
  • Product Dimensions: Custom product attributes for length, width, height, and shipping constraints
  • Multiple Product Types Support:
    • Simple products
    • Configurable products
    • Bundle products
    • Grouped products
  • Shipping Carrier Integration: Works with FedEx, UPS, and USPS carriers
  • Package Box Management: Configure multiple box sizes with dimensions and weight limits
  • Smart Caching: Stores packing results to avoid redundant calculations
  • Ships Separately Option: Mark products that must ship in their own box
  • Rotation Control: Prevent specific items from being rotated during packing
  • Admin UI:
    • Manage package boxes
    • Import/export product dimensions via CSV
    • View packing results for orders
  • REST API Integration: Uses external packing service for calculations

Requirements

  • Magento 2.4.7 or higher
  • PHP 8.1 or higher
  • External Dimensional Shipping REST API service (see API Requirements below)

Installation

1. Add Module Files

composer require freento/module-dimensional-shipping

Or copy the module to your Magento installation:

cp -r app/code/Freento/DimensionalShipping /path/to/magento/app/code/Freento/

2. Enable the Module

bin/magento module:enable Freento_DimensionalShipping
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Configuration

1. Module Settings

Navigate to: Stores → Configuration → General → Dimensional Shipping

Configure the following:

  • Enable Dimensional Shipping: Yes/No
  • API Key: Your API key for authenticating with the dimensional shipping REST API service
  • Dimension Unit: Select unit for dimensions (inches, cm)

Note: Weight unit is taken from the global Magento setting: Stores → Configuration → General → General → Locale Options → Weight Unit

2. Carrier Configuration

Navigate to: Stores → Configuration → Sales → Shipping Methods

For each carrier (FedEx, UPS, USPS):

  • Use Package Dimensions: Enable to use dimensional shipping with this carrier

These options will only appear when Dimensional Shipping is enabled.

3. Configure Package Boxes

Navigate to: Dimensional Shipping → Package Boxes

Add boxes with:

  • Name
  • Length, Width, Height (in your configured dimension unit)
  • Maximum weight (in your configured weight unit)
  • Enabled status

Example boxes (in inches):

Small Box:  12" × 10" × 8", max 20 lbs
Medium Box: 18" × 14" × 12", max 50 lbs
Large Box:  24" × 18" × 16", max 70 lbs

Product Configuration

Adding Dimensions to Products

For each product, configure the following attributes:

Required Attributes:

  • Package Length (dimensional_shipping_package_length)
  • Package Width (dimensional_shipping_package_width)
  • Package Height (dimensional_shipping_package_height)
  • Weight (standard Magento attribute)

Optional Attributes:

  • No Rotation Allowed (dimensional_shipping_no_rotation_allowed): Prevent item rotation during packing (useful for fragile items)
  • Ships Separately (dimensional_shipping_ships_separately): Item must ship in its own box

Product Types

Simple Products

Set dimensions directly on the product.

Configurable Products

Set dimensions on the child simple products (selected variant).

Bundle Products

Set dimensions on the component simple products.

Grouped Products

Set dimensions on the child simple products. The grouped product parent does not need dimensions.

How It Works

1. Customer Adds Products to Cart

Products with configured dimensions are added to the shopping cart.

2. Shipping Calculation Triggered

When the customer views shipping methods, the module:

  1. Collects all cart items and their dimensions
  2. Loads configured package boxes
  3. Sends data to REST API for optimal packing calculation (authenticated with API key)
  4. Receives packed box configurations
  5. Caches results to database

3. Packing Results Used

The calculated box dimensions and weights are passed to shipping carriers (FedEx, UPS, USPS) for rate calculation.

4. Smart Caching

The module caches packing results and checks timestamps to determine if recalculation is needed:

  • Quote items changed
  • Products updated
  • Package boxes modified

Import/Export Product Dimensions

Export Dimensions to CSV

Navigate to: Dimensional Shipping → Package Dimensions

Click Export to download CSV with all product dimensions.

Import Dimensions from CSV

Navigate to: Dimensional Shipping → Package Dimensions

  1. Click Import
  2. Upload CSV file with columns:
    • sku
    • length
    • width
    • height
    • no_rotation_allowed (0/1)
    • ships_separately (0/1)
  3. Click Import

Admin Features

View Order Packing Details

Navigate to: Sales → Orders → View Order

Under the Packaging tab, you can see:

  • Which boxes were used
  • Item placement within each box
  • 3D positions of each item
  • Items that couldn't be packed

Troubleshooting

No Shipping Rates Displayed

Check:

  1. Module is enabled in configuration
  2. API Key is correctly configured
  3. API service is running and accessible
  4. Products have dimension attributes set
  5. At least one package box is configured and enabled
  6. Carrier's "Use Package Dimensions" option is enabled

View Logs:

tail -f var/log/system.log | grep -i "dimensional"

API Connection Errors

Common Issues:

  • No API key provided: Set API Key in admin configuration
  • Incorrect API key validation result: Verify the API key is correct? is not expired and does not exceed usage limit

Items Not Packing

Possible Causes:

  1. Missing dimensions: Products must have length, width, and height
  2. Items too large: No box is big enough to fit the items
  3. Weight exceeded: Items exceed maximum box weight
  4. Wrong units: Verify dimension and weight units match your configuration

Debug:
Enable developer mode and check var/log/system.log for detailed error messages.

Grouped Products Not Working

Solution:

  • Ensure child simple products (not the grouped parent) have dimension attributes
  • Check logs for "No children found for grouped product"
  • Verify grouped product has children in the cart
  • Confirm each child product has valid dimensions

Support

For issues, feature requests, or questions:

  1. Check TROUBLESHOOTING section
  2. Review logs: var/log/system.log
  3. Check module configuration
  4. Verify API service is running and API key is valid

License

Proprietary

Credits

Developed by Freento

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
1.0.0 stable Fail Not compatible Details 2025-12-08 14:12:50

Requires 1

Package Constraint
magento/framework *

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Fail di error Fail di error
2.4.8 Fail di error Fail di error
2.4.9 Fail di error Fail di error

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Fail 49 12 errors, 37 warnings (ruleset: Magento2), 12 auto-fixable with phpcbf
PHPMD Warning 36 36 rule violations (UndefinedVariable:8, CyclomaticComplexity:7, NPathComplexity:5, ExcessiveParameterList:4, ExcessiveClassComplexity:3)
Cpd Pass 0
Composer validate Info 3 valid; 3 advisory notes (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 31 31
2.4.8 31 31
2.4.9 31 34

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
Open

More from Freento

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.