You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
Go to the admin, set condition = "Prices vs. Destination" and use table rates for handling fees calculation, with (for example) two prices: 3.95 euro for subtotal 0 and above, 0 euro for subtotal 32.2314 (ex VAT, which is 39 incl VAT) and above
Add one or more products with weight (for example a weight of 1) to the cart, resulting in a subtotal of 32.2314+ (which should trigger the free shipping)
Note:
Because of the following line: if ($bindings[':condition_name'] == null && $bindings[':condition_value'] == 0.0)
It does seem to work when no weight is set for the product.
Screenshots
Shipping rates:
Settings:
Magento version: 2.3.7-p1
PHP version: 7.4.23
TIG GLS version: 1.4.0
The text was updated successfully, but these errors were encountered:
The following patch can be used to quick-fix this:
https://github.com/tig-nl/gls-magento2/issues/28
===================================================================
diff --git a/vendor/tig/gls-magento2/Model/ResourceModel/Carrier/GLS.php b/vendor/tig/gls-magento2/Model/ResourceModel/Carrier/GLS.php
--- a/vendor/tig/gls-magento2/Model/ResourceModel/Carrier/GLS.php
+++ b/vendor/tig/gls-magento2/Model/ResourceModel/Carrier/GLS.php (date 1638787288081)
@@ -149,7 +149,7 @@
$rateQuery->prepareSelect($select);
$bindings = $rateQuery->getBindings();
- $bindings[':condition_value'] = $request->getPackageWeight();
+ $bindings[':condition_value'] = $bindings[':condition_value'] = $this->getConditionValue($request->getAllItems());
// If quote is lost these values are empty, causing table rates to return the wrong shipping rate.
if ($bindings[':condition_name'] == null && $bindings[':condition_value'] == 0.0) {
Add it to Composer:
"patches": {
"tig/gls-magento2": {
"ISSUE-28: Condition value is always package weight and never subtotal": "patches/composer/GLS-28-incorrect-condition-value.patch"
}
}
Thank you for submitting this fix, we will investigate this further and make adjustments where needed. My colleague looked at your fix and said the following, a small adjustment you can make is: $bindings[':condition_value'] = $bindings[':condition_value'] = $this->getConditionValue($request->getAllItems());
Change it to $bindings[':condition_value'] = $this->getConditionValue($request->getAllItems());
Thank you again for bringing this to our attention we will investigate the issue!
To Reproduce
Steps to reproduce the behavior:
Expected result
The shipping costs is 0
Actual result
The shipping costs is 3.95
Workaround
Change \TIG\GLS\Model\ResourceModel\Carrier\bindings, line 152:
Old:
$bindings[':condition_value'] = $request->getPackageWeight();
New:
$bindings[':condition_value'] = $this->getConditionValue($request->getAllItems());
Note:
Because of the following line:
if ($bindings[':condition_name'] == null && $bindings[':condition_value'] == 0.0)
It does seem to work when no weight is set for the product.
Screenshots
Shipping rates:
Settings:
The text was updated successfully, but these errors were encountered: