Introducing Plugins
- By captainerd
- 08/04/2025
- 0 comments
Introducing Plugins
What are Plugins in VentoCart?
VentoCart introduces Plugins as a powerful and flexible way to add features to your store, without directly tying those features to a specific layout or controller. Plugins are similar to modules but are designed to decouple logic from the layout. This allows plugins to be injected into templates, articles, or even in custom locations via simple tags.
The Difference Between Extensions, Modules, and Plugins:
-
Extensions: Large or small add-ons that enhance the functionality of VentoCart, from simple tweaks to complex features (e.g. like Journal ^theme^ back in the day).
-
Modules: Small blocks of functionality tied to specific locations within layouts. You need to specify the layout and position for these modules from the Admin.
-
Plugins: A new class of add-on in VentoCart. Plugins decouple logic from the layout, they can be added anywhere in the site where you can type in as an Admin, such as articles, pages, blog posts, or even templates files (header, footer, etc), by using tags.
Format
[plugin=<plugin route>, <param1>, <param2>, ..... ]
Provided plugins
Two simple yet extremely useful plugins are bundled with the premiere of the plugin system
-
Ajax-Powered Contact Form Plugin This plugin is designed to and allows customers to submit contact forms via AJAX.
Example tag to embed the plugin:
[plugin=extension/ventocart/plugins/contactform]
This will render an AJAX-powered contact form in the location where the tag is placed.
-
Customizable Photo Carousel Plugin This plugin allows you to showcase a carousel of images. You can specify how many slides per page, and the plugin will use the
product.getImage()
method to fetch the images.Example tag to embed the photo carousel plugin:
[plugin=extension/ventocart/plugins/photocarousel, 2, index.php?route=product/product.getImage&image=/catalog/categories/child-toys-still-life_23-2148144864.jpg&width=300&height=200, index.php?route=product/product.getImage&image=/catalog/categories/pexels-photo-3945667.jpeg&width=300&height=200]
This will display a carousel of two images per page, at 300x200 pixels.
Key Benefits of Plugins:
-
No Layout Dependency: Plugins are decoupled from layouts and can be used anywhere via simple tags.
-
Flexible and Customizable: With plugins, you can add complex features with minimal effort.
-
Extendable: You can create your own plugins for specific functionality or use third-party plugins to add new features.