Jump to content

Edit History

elburgl69

elburgl69

You cannot overide classes from a module. That can only be accomplished in Themes. See: https://devdocs.prestashop.com/1.7/modules/concepts/overrides/

Upon installation of your module, you must copy the overrided class to the /override/... folder, programatically (not advised by the core team). But you cannot guarantee that this permitted for all installations, some Administrators might limit these capabilities.

If the changes are solely required for your module(s) and only used in your module(s) code, you can create an extended class (f.e. Class MyCustomer extends Customer) in your module structure and then use that class in your module.

Alternatively you can try to use hooks (https://devdocs.prestashop.com/1.7/modules/concepts/hooks/list-of-hooks/) and use the DB class to manipulate the database tables directly in relevant After... hooks.

Succes,

Leo

elburgl69

elburgl69

Things about overrides.

You cannot overide classes from a module. That can only be accomplished in Themes. See: https://devdocs.prestashop.com/1.7/modules/concepts/overrides/

Upon installation of your module, you must copy the overrided class to the /override/... folder, programatically (not advised by the core team). But you cannot guarantee that this permitted for all installations, some Administrators might limit these capabilities.

If the changes are solely required for your module(s) and only used in your module(s) code, you can create an extended class (f.e. Class MyCustomer extends Customer) in your module structure and then use that class in your module.

Alternatively you can try to use hooks (https://devdocs.prestashop.com/1.7/modules/concepts/hooks/list-of-hooks/) and use the DB class to manipulate the database tables directly in relevant After... hooks.

Succes,

Leo

×
×
  • Create New...