postnl / postnl-magento2

This is the official Magento 2 extension for the logistics company PostNL. Add shipping options and parcelshops to your checkout. Create labels with track and trace functionality from the backend.
59 stars 60 forks source link

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

Closed Paasi-gs closed 1 year ago

Paasi-gs commented 1 year ago

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.

tig-vincentthart commented 1 year ago

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