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)

Preface

If you can code OpenCart modules, you can customize OpenCart and make e-commerce sites easier to administer and also change the way the default OpenCart system works. This book shows you how to create all sorts of extensions: OpenCart module, Order Total module, ideas for creating payment, shipping modules, and ways to create custom pages and forms on OpenCart module to carry out the insert, edit, delete, and list functions.

This book focuses on teaching you all aspects of OpenCart modules by showing and defining code examples. The book uses default OpenCart module to clone other modules, the process by which one module gets transferred to another. It shows each and every line of code and describes them so readers know what the code does. You will clone the Google_talk module in the first chapter. In the second chapter, you will learn about all the available methods in OpenCart, and at last you will create two custom module feedback pages and the Tips Order Total modules.

Each chapter teaches you to make a new OpenCart module; you will thus be able to make three modules by reading this book. You will be able to create the Hello World module by cloning the Google talk module that you can then change to the Welcome Message module. Likewise, you will get a description of each code of default featured module of OpenCart, and then create the Feedback pages to manage the feedbacks. In the end, you will be able to create an Order Total module called Tips Order Total module.

Each chapter builds a practical module from the ground up using step-by-step instructions and examples.

What this book covers

Chapter 1, Getting Started with OpenCart Module, shows us how to clone the Google_talk module to the Hello World module and lists ways to install, configure, and uninstall the OpenCart module and show the structure of the file of admin and frontend.

Chapter 2, Describing The Code of Extensions, lists all global methods of OpenCart, shows you how to configure the feature module, describes the code of the feature module, shows the way to start the coding for the shipping module, and describes the payment module.

Chapter 3, Create Custom OpenCart Module, shows you how to create a feedback module and the Tips Order Total module. It also shows how code works and are managed.

What you need for this book

OpenCart, along with knowledge of the backend and frontend of the software is needed for this book.

Who this book is for

This book is for programmers working with OpenCart, who want to develop custom OpenCart modules. You need to be familiar with the basics of OpenCart and PHP programming; after reading the book, you will be able to create customized OpenCart modules.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: " As given at the controller, $group=helloworld, $data is $_POST, and $store_id is 0.."

A block of code is set as follows:

public function install($type, $code) {
  $this->db->query("INSERT INTO " . DB_PREFIX ."extension SET `type` = '" . $this->db->escape($type) . "', `code` = '" . $this->db->escape($code) . "'");
}

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes, for example, appear in the text like this: " The file structure is divided into two sections admin and catalog".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.