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 ACCEPTED SOLUTIONS

Accepted Solutions

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.

View solution in original post

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

View solution in original post

2 REPLIES 2

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.

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