Book Image

Getting Started with OpenCart Module Development

By : Rupak Nepali
Book Image

Getting Started with OpenCart Module Development

By: Rupak Nepali

Overview of this book

OpenCart is an online shopping tool which is free to use. It has become widely popular because of its support for custom extensions and module development. This book helps you understand how to use the features available in OpenCart using step-by-step instructions. Getting Started with OpenCart Module Development gives you step-by-step explanations and illustrations on how to clone, customize, and develop modules and pages with OpenCart. This book shows you how to create custom OpenCart modules and pages which are needed as per the requirements of the clients to manage custom data. It describes each and every code used to make a Hello World module, a feedback module, a tips module, an order total module, and a shipping and payment module. The book covers installing, configuring, and uninstalling modules as well as how to clone them. It also discusses all the available Global Library methods of OpenCart as well as ways to handle the files and folders of a shipping and payment module. At the end of the book, you will learn how to make custom pages to manage data by creating a feedback module and how to create the order total using a tips module. In Getting Started with OpenCart Module Development, you will learn everything you need to know to create custom OpenCart modules.
Table of Contents (10 chapters)

Getting started with feedback management


We will show you the way to create the admin form and the list page, after this we will move forward to make the frontend pages where visitors can submit their feedback and lists of the feedback. As always, we will start with analyzing our requirements and seeing which part of OpenCart resembles them, so that we can clone the pages, making it easy to work with the code.

Database tables for feedback

We start by making tables at the database. As OpenCart is multistore, multilanguage support and can be shown at many layouts, we need to take care of those as well. For these, we have to make approximately four tables: feedback, feedback_description, feedback_to_layout, and feedback_to_store.

In the following screenshot, oc_ is the database prefix we use while installing Opencart. If you are not sure about the database prefix, you can see the config.php file at the root folder of the OpenCart, open it, and find the line "define('DB_PREFIX'". You will see define...