Overriding templates is often handled within your theme folder to keep design changes separated from core logic.
Let’s say you’re using a module called customshipping and you want to change the calculateCost() method. prestashop module override