Extending and Overriding Schemes with Modules in Venddor IO

In Venddor IO, modules can be leveraged to both extend and override existing schemes, enabling developers to customize and enhance the platform's functionalities.

To extend a scheme using a module, follow these steps:

Create a Schemas Directory:

If it doesn't already exist, generate a schemas directory within your module's folder.

Reproduce Core Schemas Structure:

Inside this schemas directory, replicate the core structure of Venddor IO's schemas to target a specific scheme.

Extending the Scheme:

The scheme can be enhanced either by appending new content at the end or by prepending content at the beginning.

When naming your files, follow this convention: <scheme_name>.[pre|post].php.

Example:

Let's say you want to augment the scheme block_manager/blocks. For this, establish the schemas/block_manager directory within your module's directory. You can then introduce the extension data in either blocks.pre.php (to prepend) or blocks.post.php (to append), or even use both for comprehensive extensions.

An excellent example showcasing this method can be found in Venddor IO's Affiliate module. This module demonstrates the extension of various schemes, such as block_manager/blocks.php.