How to install two modules with the same overrides

07 May

Initially overriding each module begins the same way, for instance for classes/cart.php

Cart.php from the other module starts with :

class Cart extends CartCore {

Cart.php from myOwnReservations starts with :

class Cart extends CartCore {

To make the two compatible modules override of each module must be modified and renamed.
In our example myOwnReservations override the other module (the reverse is also possible).

We rename the file and the class name from the override “CartOther” that will be overridden by myOwnReservations.
Rename Cart.php from the other module to CartOther.php
Next edit CartOther.php from the other module to begin with :

class CartOther extends CartCore {

Then edit Cart.php from myOwnReservations to begin with :

class Cart extends CartOther {

File changes override myOwnReservations must be made ​​in /override/classes/ and also in folder /modules/myownreservations/override/classes.

Tags: