LanguagesPHPPHP Module Programming with OXID eShop CE

PHP Module Programming with OXID eShop CE

Developer.com content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

OXID eShop is PHP-based e-commerce product designed to help merchants quickly and efficiently enter the world of online retail. An open source version of the product is available under the GNU General Public License and free for merchants to download, install, customize and use to their e-commerce requirements.

In particular, OXID eShop comes with an integrated module interface that allows PHP developers to adapt the product to any customer needs. In his PHPBuilder tutorial, Andreas Ziethen explains the fundamental principles of OXID module development and provides a live example of using a custom module to tweak the eShop’s content management system.

Understanding Program Architecture

Before you start programming your first module, it’s worthwhile to learn the architecture of the OXID platform.

MVC Implementation

OXID eShop was developed using PHP5 object-oriented techniques. It makes good use of getter and setter methods. This means that object attributes are generally not directly accessible and must be addressed via get() or set() methods.

Rather than using an established third-party framework (e.g., Zend Framework), the OXID eShop uses its own established, MVC-compliant framework. View classes are located in the /oxid/views directory and corresponding model classes in the /oxid/core directory. You can overload both class groups as modules, which allows nearly unlimited possibilities for extension and modification. You can review the API documentation to obtain a better understanding of the class structures.

Templates

The OXID eShop uses the Smarty template engine. The templates associated with each view are located in the directory /oxid/out/basic/tpl (front-end) and /oxid/out/admin/tpl (back-end). They are pure HTML files, where you can embed content with so-called “Smarty-Tags.” Therefore, you can perform limitless visual customizations, provided you inherit the respective Smarty-Tags accurately.

Module Interface

As mentioned earlier, you can overload almost all view and core classes as modules. In order to do that, you must define a new class by extending an existing class and save the resulting class definition file within the /oxid/modules directory. You must register this module in the administration area, so that the system knows to factor in the new module (if necessary) when instantiating a new object.

Read the entire article at PHPBuilder to learn all about PHP module programming with OXID eShop CE.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories