Hooks and understanding of updating cscart

Im curious, why cscart in case if we changed something in the core files when updating everything is gone, why not just save the changes and only updated the parts that needs to be updated. I want to understand the goal behind this???

The reason I asked this question is, why hooks??
Why not using hooks?? Is there is another way it can be solved ???

Because updating system does not know what has changed. If system would scan every file in CS-Cart and compare it if it matches the old version, updates would take ages.
And even if this was possible, tons of issues still remain. Imagine there is a function. You change how it works, and then CS-Cart update also changes how it works (and the rest of the system expects the function to work in a new way). Which version should be kept?

Hooks exist specifically, so that amateur & professional CS-Cart developers can modify the system without having to alter core files.

Best regards,
Robert

2 Likes

The changed files are simply replaced with the ones from the upgrade package, there are no hidden catches here :slight_smile:

So by using hooks, you ensure that your changes won’t be lost during an upgrade, because those changes will be in files separate from the core files.

1 Like

I’m an inquisitive person, I like to know the structure of things, thank you for answering my question.