Override Prestashop New! Now
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null) // Get original cost $originalCost = parent::getPackageShippingCost($id_carrier, $use_tax, $default_country, $product_list, $id_zone); // Apply custom logic (e.g., free shipping over $100) if ($this->getOrderTotal(true, Cart::ONLY_PRODUCTS) > 100) return 0; return $originalCost;
/override/modules/blockreassurance/controllers/front/AdditionalProductTabController.php override prestashop
/modules/blockreassurance/controllers/front/AdditionalProductTabController.php Best Practice – Use a Custom Module Instead
❌ You can do the same with a hook, template, or module configuration. 9. Common Pitfalls & Solutions | Problem | Solution | |---------|----------| | White screen after override | Check PHP error log; verify you extended the correct parent class ( XXXCore ) | | Override ignored | Delete /var/cache/prod/class_index.php and clear cache | | Conflict between two modules | One will win; override should be inside a custom module, not directly in /override/ | | Override breaks after PS update | Review changelog – your overridden method may have changed signature | | Can't override static methods | You can, but careful; call parent::method() if needed | 10. Best Practice – Use a Custom Module Instead of placing files directly in /override/ , put overrides inside a custom module : public function getPackageShippingCost($id_carrier = null
public function installOverrides()
