Prestashop Module Override -
// Original logic would run if we called parent $originalCost = parent::calculateCost($products);
/override/modules/customshipping/classes/CustomShippingCalculator.php Your override must extend the original class and use the same namespace. prestashop module override
Delete /var/cache/dev/class_index.php (and /var/cache/prod/ in production). // Original logic would run if we called
PrestaShop does not automatically scan new overrides. You must clear the class index. prestashop module override
// New logic: add $5 handling fee for fragile items $extraFee = 0; foreach ($products as $product) if ($product['is_fragile']) $extraFee += 5;
This is where come into play. What Is a Module Override? An override is a safe, core-respecting way to replace or extend the logic of an existing module without modifying its original source files.