Hi,
I'd like to request a new feature related to carrier availability conditions.
Feature Idea
Disable a shipping carrier if at least one product in the cart exceeds a configurable weight limit (e.g., 31.5 kg).
Why We Need It
There are countries where DPD does not ship items heavier than 31.5 kg per item, or the shipping cost becomes unreasonably high. In such cases, it's more efficient to disable DPD and use alternative carriers that can handle heavy parcels.
Real Example
Our client sells musical instruments, including heavy items like digital pianos that often weigh more than 31.5 kg.
Currently, PrestaShop allows carrier restrictions only based on total cart weight, which is inefficient in this case. A cart may contain many light items that collectively exceed the limit.
Proposed Solution
We need an option to iterate through all cart products and disable the carrier if any product's weight exceeds a configurable threshold.
At the moment, I've implemented a custom solution by hardcoding the logic inside the getOrderShippingCostExternal method in dbdbaltics.php:
if (isset($deliveryAddress->id_country) && $cart->getTotalWeight() > 31.5) {
$cartCountryIsoCode = \Country::getIsoById($deliveryAddress->id_country);
$heavyParcelCountryIsoCodes = ['LT', 'LV', 'EE', 'PL'];
if (!in_array($cartCountryIsoCode, $heavyParcelCountryIsoCodes)) {
foreach ($cart->getProducts() as $product) {
if (isset($product['weight']) && $product['weight'] > 31.5) {
return false;
}
}
}
}
Request
Could you let me know if this feature might be considered for implementation in the near future?
Thanks in advance for your time
Hi,
I'd like to request a new feature related to carrier availability conditions.
Feature Idea
Disable a shipping carrier if at least one product in the cart exceeds a configurable weight limit (e.g., 31.5 kg).
Why We Need It
There are countries where DPD does not ship items heavier than 31.5 kg per item, or the shipping cost becomes unreasonably high. In such cases, it's more efficient to disable DPD and use alternative carriers that can handle heavy parcels.
Real Example
Our client sells musical instruments, including heavy items like digital pianos that often weigh more than 31.5 kg.
Currently, PrestaShop allows carrier restrictions only based on total cart weight, which is inefficient in this case. A cart may contain many light items that collectively exceed the limit.
Proposed Solution
We need an option to iterate through all cart products and disable the carrier if any product's weight exceeds a configurable threshold.
At the moment, I've implemented a custom solution by hardcoding the logic inside the
getOrderShippingCostExternalmethod indbdbaltics.php:Request
Could you let me know if this feature might be considered for implementation in the near future?
Thanks in advance for your time