postnl/postnl-magento2

[QUESTION] What is the reason that price for Extra Cover are not fetched from order table?

Paasi-gs opened this issue · 1 comments

Question
Is there a special reason why prices are loaded from the product repo for Extra Cover instead of getting them from the already loaded Order\Item object?

See: https://github.com/tig-nl/postnl-magento2/blob/a0c1e70bc82de4856d21ecef3f244ef63b3820d4/Model/Shipment.php#L831-L833

And: https://github.com/tig-nl/postnl-magento2/blob/a0c1e70bc82de4856d21ecef3f244ef63b3820d4/Model/Shipment.php#L874-L878

As price should be available using $orderItem->getPrice()
Think this will have some performance gain.

Hi @Paasi-gs,

Thanks for bringing this to our attention. I will check this with the development team and get back to you.

Have a nice day!

Vincent