O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

OpenCart Theme and Module Development

Book Description

Create custom themes and modules using the exciting new features of OpenCart

  • Explore the new features in OpenCart by using them in your custom theme
  • Get hands-on with the Global Library Methods used in OpenCart to make themes and extensions
  • Packed with hands-on examples, step-by-step explanations, and illustrations to guide you through coding modules and themes

In Detail

OpenCart is an e-commerce cart application built with its own in-house Model-View-Controller-Language framework. With its popularity and ease of use for e-commerce, OpenCart is being used more and more to create custom extensions, themes, and pages.

This book embarks on an exciting journey of creating custom themes, pages, and templates in OpenCart.

It shows you how to change and manage the general setting of your store and manage the modules and their layout, along with files and folders of the default theme. You will explore the featured module to help you understand module code and its functionality. Finally, you will learn to create customized pages for feedback management and make an admin section where you will make forms and lists to perform CRUD functionalities and show this feedback at the frontend.

What You Will Learn

  • Integrate a custom design into the OpenCart framework
  • Change the design of your OpenCart module
  • Create a custom theme with the use of OpenCart's default theme
  • Create listing pages and a form page, and perform actions such as data retrieval, insertion, and deletion
  • Explore most of the system level libraries OpenCart provides
  • Discover how the backend code behind modules is developed
  • Use Bootstrap, Font Awesome, and FlexSlider to design templates and themes efficiently

Table of Contents

  1. OpenCart Theme and Module Development
    1. Table of Contents
    2. OpenCart Theme and Module Development
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Getting Started with OpenCart 2.0
      1. The features of OpenCart
      2. Changing the OpenCart shop's general settings
      3. Setting image height and width
        1. Managing the modules in the theme
        2. Managing the image dimensions of modules in the default theme
        3. Creating and setting a promotional banner
        4. Installing and uninstalling a module
        5. Setting the Banner, Carousel, and Slideshow modules
        6. Managing the layout and position of a module in a theme
      4. Describing the files and folders of the default theme
      5. Summary
    9. 2. Bootstrap, Font Awesome, and FlexSlider in OpenCart 2 Themes
      1. Bootstrap
        1. Advantages of using Bootstrap in OpenCart themes
        2. The basic template structure with Bootstrap in OpenCart 2
        3. A basic static Bootstrap template
      2. Font Awesome, an iconic font
        1. Setting up Font Awesome
          1. Using BootstrapCDN by MaxCDN
          2. Using default CSS
        2. The icons of Font Awesome
          1. Rotated and flipped icons
      3. FlexSlider
      4. Summary
    10. 3. Creating Custom Themes
      1. Preparing the files
      2. Integrating HTML and CSS into the OpenCart theme
        1. Creating a new theme based on the default theme
      3. Understanding the code in header.tpl
      4. Checklist for the header section
      5. Changing the style of currency
      6. Describing the code of the top menu categories
      7. Changing the style of the menu
      8. Understanding the code in footer.tpl
      9. Changing the style of the footer div in the footer
      10. Removing the copyright information in the footer
      11. The home page
      12. The category page
      13. The product page
      14. The information pages
      15. The contact us page
      16. Changing the CSS for the checkout steps
      17. Summary
    11. 4. Getting Started with OpenCart 2 Modules
      1. Creating a Hello World module
        1. The admin folder
        2. The catalog folder
      2. Installing, configuring, and uninstalling a module
        1. Installing a module
        2. Configuring the module
        3. Configuring layouts for the module
        4. Uninstalling the module
        5. Positions for the module
        6. The status of the module
        7. Sort order of modules
        8. Different layouts for the same module
      3. The file structure – admin and frontend
        1. Creating a language file for the admin section in OpenCart
        2. Creating a controller for the admin section in OpenCart
        3. Creating a template file for the admin section in OpenCart
          1. The breadcrumbs section of the module
        4. Creating a language file for the Catalog (frontend) module in OpenCart
        5. Creating a controller file for the Catalog (frontend) module in OpenCart
        6. Creating a template file for the Catalog (frontend) module in OpenCart
      4. Summary
    12. 5. Extensions Code
      1. Global library methods
        1. Affiliate (affiliate.php)
        2. Cache (cache.php)
        3. Cart (cart.php)
        4. Config (config.php)
        5. Currency (currency.php)
        6. Customer (customer.php)
        7. Database (db.php)
        8. Document (document.php)
        9. Encryption (encryption.php)
        10. Language (language.php)
        11. Length (length.php)
        12. Log (log.php)
        13. Mail (mail.php)
        14. Pagination (pagination.php)
        15. Request (request.php)
        16. Response (response.php)
        17. Session (session.php)
        18. Tax (tax.php)
        19. URL (url.php)
        20. User (user.php)
        21. Weight (weight.php)
      2. The Featured module
        1. Configuring the Featured module in OpenCart
        2. Exploring code used in Featured module
          1. Exploring the code of admin/controller/module/featured.php
          2. Exploring the code of admin/view/template/module/featured.tpl
          3. Exploring the code of catalog/controller/module/featured.php
      3. The Shipping module
        1. Changes required at the admin folder to create total cost based Shipping module
        2. Changes made in the catalog folder
      4. The Payment module
        1. Off-site payment
        2. On-site payment
        3. Order Total
      5. Summary
    13. 6. Create OpenCart Custom Pages
      1. Getting started with feedback management
        1. Database tables for feedback
        2. Creating files in the admin section for feedback
          1. Creating the language file in the admin section
          2. Creating the model file in the admin section
          3. Creating the controller file in the admin section
          4. Creating the template files for form and list pages in the admin section
          5. Creating the model file for the catalog folder frontend
          6. Creating the language file for the frontend
          7. Creating the controller file for the frontend
          8. Creating the template file for the frontend
      2. Summary
    14. Index