@packy this library might be useful for you: https://www.boxpacker.io/en/stable/
Getting E-Commerce parcel size
I am currently building an e-commerce solution for a company and having trouble wrapping my head around shipping costs. I am using Shippo and I can easily get rates, labels and really everything I need, the issue is not a technical one with their API. I am just curious how you find the Parcel size to get rates before we package it. Right now the systems works like any other: you click to checkout, we know whats in your cart, you fill out shipping destination and the API returns rates. To get the rates I need to provide the parcel weight and size. I can add all the weights of items but how do you figure a box size? If the item is 4X1X1 that is not the actual box size, just the item size. If we have multiple items how can a pick a box size? I assume most people just use the same box size for 1 item as the do 5 items.
Here is the Shippo tutorial I used:
https://m.dotdev.co/easily-handle-shipping-in-laravel-with-shippo-12055c903704
Here is what I need to pass Shippo to get rates for the user to select (Parcel is the final package to send):
$parcel = array(
'length'=> '5',
'width'=> '5',
'height'=> '5',
'distance_unit'=> 'in',
'weight'=> '2',
'mass_unit'=> 'lb',
);
$shipment = Shippo_Shipment::create( array(
'address_from'=> $fromAddress,
'address_to'=> $toAddress,
'parcels'=> array($parcel),
'async'=> false
)
);
Please or to participate in this conversation.