cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the shipping amount for a particular order item?

SOLVED

How to get the shipping amount for a particular order item?

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();

}

2 REPLIES

Re: How to get the shipping amount for a particular order item?

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.

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: How to get the shipping amount for a particular order item?

You are right, I created a temporary quote adding that particular item alone, to collect its shipping rates