Hello guys, few days ago i made this edit to commerc_cart module: http://drupal.org/node/1782590

Now, my obvious problem is that if I update that module, all my custom events get lost.

Im wondering if there is a way to override the function where the module invoke my custom events (commerce_cart_view() in this case).

What can be a good practice to place (and mantain) custom rules events?

Comments

WorldFallz’s picture

Any module can provide events to rules. Instead of altering the commerce module, simply create your own module (i always create a 'custom' module for these type of site customizations) and put your custom event there.

strae’s picture

This is exactly what i meant to, but if you look the link I posted, to implement my own new event i should somehow override commerce_cart_view() function (as example, here i added the commerce_cart_cart_view_before and after events).

So how to do that?

You HAVE to assume your visitor is a maniac serial killer, out to destroy your application. And you have to prevent it.