Book Image

PrestaShop Module Development

By : Fabien Serny
Book Image

PrestaShop Module Development

By: Fabien Serny

Overview of this book

Table of Contents (19 chapters)
PrestaShop Module Development
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Building Module Updates

In Chapter 2, Hooks, to create a SQL table, we used phpMyAdmin (any SQL manager tool will do). However, you will agree that it isn't very handy for the merchant who wants to install the module. There are no PrestaShop official methods to create, delete, or update a database table in a module. I will show you the one used in most of the native PrestaShop modules.

In this chapter, we will see how to do the following:

  • Create a SQL table when the module is installed

  • Delete a SQL table when the module is uninstalled

  • Alter the existing SQL table when the module is updated