How to get the shipping amount for a particular order item? I know we can find the shipping amount for an order by $order->getShippingAmount(). How do we get the split up for each ordered item , looking for something like :
foreach ($order->getAllItems() as $item) {
$item->getShippingAmount();
}
Solved! Go to Solution.
Hi @arunsomanhere,
I think taht kind of detail will depend of your shipment module. Basically, shipment is used as flat or by the whole package and then Magento stores the total.
Check, for example, table rates.
By default Magento won't provide that information (using a vanilla installation).
I guess the first step is to know if your carrier provides that kind of detail and then, maybe, you can store that information.
Also, how are you calculating shipment? Isn't the same if you calculate by units or by dimension.
You are right, I created a temporary quote adding that particular item alone, to collect its shipping rates
Hi @arunsomanhere,
I think taht kind of detail will depend of your shipment module. Basically, shipment is used as flat or by the whole package and then Magento stores the total.
Check, for example, table rates.
By default Magento won't provide that information (using a vanilla installation).
I guess the first step is to know if your carrier provides that kind of detail and then, maybe, you can store that information.
Also, how are you calculating shipment? Isn't the same if you calculate by units or by dimension.