PrestaShop Module Development

Develop and customize powerful modules for PrestaShop 1.5 and 1.6

PrestaShop Module Development

Progressing
Fabien Serny

Develop and customize powerful modules for PrestaShop 1.5 and 1.6
$29.99
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook
$12.99 p/month

Want this title & more? Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.
+ Collection
Free Sample

Book Details

ISBN 139781783280254
Paperback254 pages

About This Book

  • Create and customize PrestaShop modules quickly and easily
  • Provide a strong foundation in module development for developers who are new to PrestaShop
  • Explore the advanced features of PrestaShop with clear and practical instructions

Who This Book Is For

If you are a developer who is new to PrestaShop and wants to get a good foundation in development on the PrestaShop framework, this book is for you. It's assumed that you will have some experience with PHP5, jQuery, and HTML/CSS (no need to be an expert on it).

Table of Contents

Chapter 1: Creating a New Module
First steps
Adding the module configuration
Making a simple configuration form
Summary
Chapter 2: Hooks
Registering our module on hooks
Changing the position of your module on a hook
Using hooks to display templates
Using the database class to save comments
Displaying comments
Triggering hooks
Adding a hook
The dynamic hooks
Summary
Chapter 3: Using Context and its Methods
Looking at the Context object
Using the translate method
Adding CSS and JS in your module
Checking compatibilities and dependencies
Summary
Chapter 4: Building Module Updates
Creating a database table on module installation
Deleting a table on uninstallation
Upgrading your module
Updating the module code
Adding a callback to options
Summary
Chapter 5: Front Controllers, Object Models, and Overrides
Using front controllers to create a new page
Installing overrides with modules
Using object models to create cleaner code
Using HelperForm to make a scalable form
Cleaning your code using the hook's controller
Summary
Chapter 6: Admin Controllers and Hooks
Adding an admin controller
Using back office hooks
Summary
Chapter 7: The Carrier Module
First step to create a carrier module
Using web services
Creating new carriers
Using web services on shipping cost calculation
Handling carrier update
Displaying relay points
Associating the chosen relay point with the cart
Displaying the customer's choice in the back office
Summary
Chapter 8: The Payment Module
Creating a payment module
Creating the payment controller
Checking the currency
Validating a cart into an order
Displaying information on the order confirmation page
Creating your own order state
Associating an e-mail with an order state
Working with a third-party API
Summary
Chapter 9: Multistore
Configuring the multistore feature on your PrestaShop
Updating the MySQL table of the module
Updating the module code
Using the Configuration class with multistore
Summary
Chapter 10: Security and Performance
Securing your module
Searching for malicious code in modules
Performance and optimization
Summary

What You Will Learn

  • Code your own module from scratch
  • Explore best practices for database table creation
  • Use hooks or implement overrides
  • Discover the many native methods available in PrestaShop
  • Make new administration tools
  • Create fully functional payment modules
  • Develop carrier modules
  • Secure and optimize your modules
  • Build functionalities compliant with the multistore feature

In Detail

The number of e-commerce websites has drastically increased in these past few years. Building your own web store is a complex and expensive task; that's why open source solutions such as PrestaShop have become so successful in tackling this issue. The main interest with open source solutions is that you can easily add or edit features by creating modules.

This practical, hands-on guide provides you with a number of clear, step-by-step exercises to help you understand how PrestaShop works, and also help you add and edit features.

Starting with the basics, this book takes you through complete module development in an effective manner. You will learn about module architecture, what a hook is, and how to use it to add functionalities to PrestaShop. You will also see how to build payment and carrier modules and make your module multistore-ready. Develop PrestaShop modules the right way and make them secure and compliant with different versions of PrestaShop.

Authors

Table of Contents

Chapter 1: Creating a New Module
First steps
Adding the module configuration
Making a simple configuration form
Summary
Chapter 2: Hooks
Registering our module on hooks
Changing the position of your module on a hook
Using hooks to display templates
Using the database class to save comments
Displaying comments
Triggering hooks
Adding a hook
The dynamic hooks
Summary
Chapter 3: Using Context and its Methods
Looking at the Context object
Using the translate method
Adding CSS and JS in your module
Checking compatibilities and dependencies
Summary
Chapter 4: Building Module Updates
Creating a database table on module installation
Deleting a table on uninstallation
Upgrading your module
Updating the module code
Adding a callback to options
Summary
Chapter 5: Front Controllers, Object Models, and Overrides
Using front controllers to create a new page
Installing overrides with modules
Using object models to create cleaner code
Using HelperForm to make a scalable form
Cleaning your code using the hook's controller
Summary
Chapter 6: Admin Controllers and Hooks
Adding an admin controller
Using back office hooks
Summary
Chapter 7: The Carrier Module
First step to create a carrier module
Using web services
Creating new carriers
Using web services on shipping cost calculation
Handling carrier update
Displaying relay points
Associating the chosen relay point with the cart
Displaying the customer's choice in the back office
Summary
Chapter 8: The Payment Module
Creating a payment module
Creating the payment controller
Checking the currency
Validating a cart into an order
Displaying information on the order confirmation page
Creating your own order state
Associating an e-mail with an order state
Working with a third-party API
Summary
Chapter 9: Multistore
Configuring the multistore feature on your PrestaShop
Updating the MySQL table of the module
Updating the module code
Using the Configuration class with multistore
Summary
Chapter 10: Security and Performance
Securing your module
Searching for malicious code in modules
Performance and optimization
Summary

Book Details

ISBN 139781783280254
Paperback254 pages
Read More

Recommended for You

PrestaShop 1.5 Beginner’s Guide
$ 26.99
PrestaShop 1.3 Beginner's Guide
$ 26.99
PrestaShop 1.3 Theming – Beginner’s Guide
$ 23.99