Prestashop Module | Override

/override/modules/customshipping/classes/CustomShippingCalculator.php Your override must extend the original class and use the same namespace.

In Back Office → Advanced Parameters → Performance → click "Clear cache". Important Naming Convention The override class name must be unique. The standard convention is: prestashop module override

return $originalCost + $extraFee;

/** * Override the cost calculation method */ public function calculateCost($products) // New logic: add $5 handling fee for

PrestaShop is one of the most flexible e-commerce platforms available, largely thanks to its modular architecture. However, there comes a time in every developer’s journey when a module doesn’t quite do what you need. The core logic is 90% perfect, but you need to tweak a method, add a filter, or change a database query. add a filter

// New logic: add $5 handling fee for fragile items $extraFee = 0; foreach ($products as $product) if ($product['is_fragile']) $extraFee += 5;