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)

The Shipping module


OpenCart has many prebuilt shipping modules. Navigate to Admin | Extensions | Shipping, it lists out the Shipping module as shown in the following screenshot:

You have to install and configure it, and it will be shown at the frontend under Shipping Methods while performing a checkout.

As you already know, modules or extensions can be created by cloning an existing one that functions in a similar way to what you want. So, for Shipping, we will be cloning any one of them that fulfills our requirement. For example, if you want the shipping cost to be charged as per the total cost purchased, you can clone the weight-based shipping module; likewise, if you want to make DHL shipping rates module using the live rate, look up from the DHL site. You need to start with the existing UPS shipping extension.

Let's start to make the Shipping module that is based on the total cost purchased.

Changes made in the admin folder

In this section we will see the changes that are to be made in the...