tig-nl / gls-magento2

Integrate GLS shipping services into Magento 2. Add GLS shipping and parcelshops to your checkout. Create your labels with Track and Trace functionality from the Magento backend.
5 stars 8 forks source link

[BUG] Free shipping and various currencies #35

Open vandijkstef opened 2 years ago

vandijkstef commented 2 years ago

The free shipping calculation is based on the order subtotal but this can lead to some unwanted free shipments. It doesn't matter too much if we're talking GBP/USD over a EUR base price, but it is massive on currencies like SEK (10:1!)

I've already patched it myself (see below). Basically Magento always keeps functioning with the base currency, and those fields should be used/checked.

---
 web/app/code/TIG/GLS/Model/ResourceModel/Carrier/GLS.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web/app/code/TIG/GLS/Model/ResourceModel/Carrier/GLS.php b/web/app/code/TIG/GLS/Model/ResourceModel/Carrier/GLS.php
index 14fd9ae1c6..0606ccd634 100644
--- a/web/app/code/TIG/GLS/Model/ResourceModel/Carrier/GLS.php
+++ b/web/app/code/TIG/GLS/Model/ResourceModel/Carrier/GLS.php
@@ -223,7 +223,7 @@ class GLS extends Tablerate
     {
         $quote = $this->reloadQuote($items);

-        return (float) $quote->getSubtotal();
+        return (float) $quote->getBaseSubtotal();
     }

     /**
-- 
tig-jeffreybranderhorst commented 2 years ago

Hi @vandijkstef,

Thank you for bringing this to our attention, I will place this on our backlog, so we can fix this in the near future.

Have a great day, Jeffrey