Book Image

PrestaShop Module Development

By : Serny
Book Image

PrestaShop Module Development

By: Serny

Overview of this book

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 (13 chapters)
12
Index

Upgrading your module


This section is optional unless you want to distribute your module (that is, give or sell). However, if you skip this part, be sure to use the module attached with this chapter, instead of your own, before going to the next chapter.

This section is only for PrestaShop 1.5 and newer (module upgrade methods did not exist in PrestaShop 1.4).

Why use an update method? When you improve one of your modules, there may be times you will need to add a SQL table, alter existing ones, or even make specific configuration actions. In most cases, the merchant won't be able to make the updates manually and you can't ask them to uninstall/reinstall the module because, in our case, it means that all the comments posted will be deleted.

Let's add some fields (firstname, lastname, and e-mail address) to the comment form on the product pages. We will not only need to update the PHP and template files, but also alter the mymod_comment SQL table.

First of all, in mymodcomments.php, change the...