Closed mlaurense closed 2 years ago
Hi @mlaurense,
Thank you for submitting this issue with this much information. We are going to test it, I do have some questions. You are using the matrix rates not the table right, am I correct? And would it be possible to share your matrix rate, so we are testing with the same rates?
Have a great day. Jeffrey
Hi @tig-jeffreybranderhorst,
Yes, it is matrix rates (my bad). I attached the used rates:
Hi @mlaurense,
Thank you for the matrix rates we are going to test this!
Have a great day, Jeffrey
Hi @mlaurense,
We have tested your matrix, and we can reproduce the last price is not reached because the 50 and above comes first, and then he will stop there instead of going to the 75. We will test your PR thank you for submitting this!
Have a great day, Jeffrey
Hi @mlaurense ,
We have just released v1.12.2 and included a fix for this. Thank you for the detailed description.
Have a nice day! Vincent
When filtering the table rates, the matrixrateCollection is sorted using only the subtotal (descending). But this breaks the correct rate calculation when using weight. Given a cart of ~ 35kg of weight, after filtering the rates in
vendor/tig/postnl-magento2/Service/Carrier/Price/Matrixrate.php
, these two rates are remaining:This will incorrectly return a shipping of € 5, while it should return € 10.
Possibly related to https://github.com/tig-nl/postnl-magento2/issues/224 as well
To Reproduce Steps to reproduce the behavior:
Expected result Shipping should be € 10
Actual result Shipping is € 5
Workaround Modify https://github.com/tig-nl/postnl-magento2/blob/master/Service/Carrier/Price/Matrixrate.php#L97 to also sort by weight:
$matrixrateCollection = $this->matrixrateCollection->addOrder('subtotal', 'DESC')->addOrder('weight', 'DESC');
After filtering, the rates are returned as follows:
Please complete the following information