PrestaShop Module Development
eBook - ePub

PrestaShop Module Development

Fabien Serny

  1. 254 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

PrestaShop Module Development

Fabien Serny

Book details
Book preview
Table of contents
Citations

About This Book

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.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is PrestaShop Module Development an online PDF/ePUB?
Yes, you can access PrestaShop Module Development by Fabien Serny in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Sistemas de gestión de contenidos. We have over one million books available in our catalogue for you to explore.

Information

PrestaShop Module Development


Table of Contents

PrestaShop Module Development
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Creating a New Module
First steps
Adding the module configuration
Making a simple configuration form
Summary
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
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
The compatibility check
The dependency check
Summary
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
5. Front Controllers, Object Models, and Overrides
Using front controllers to create a new page
Creating the front controller
Maintaining compatibility with the Friendly URL option
Creating a small action dispatcher
Displaying the product name and comments
Including CSS and JS media in the controller
Adding a pagination system
Creating routes for a module's controller
Installing overrides with modules
Creating the override class
Editing the template file to display grades on products list
Creating a new method in a native class
Using object models to create cleaner code
Creating the ObjectModel class
Using the ObjectModel class in our module
Placing all the database requests in our ObjectModel class
Using HelperForm to make a scalable form
Cleaning your code using the hook's controller
Summary
6. Admin Controllers and Hooks
Adding an admin controller
Adding and installing a new tab to your admin panel
Uninstalling the tab when the module is uninstalled
Listing comments in your admin controller
Improving the list view
Adding actions on the list view
Creating your own view template
Configuring your form view
Using back office hooks
Attaching your module to a product hook
Displaying comments in a product hook
Displaying comments associated with a customer
Making links between admin sections
Summary
7. The Carrier Module
First step to create a carrier module
Using web services
API description
Module configuration
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
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
Updating the module's configuration form
Displaying the new payment method
Building the validation API controller
Summary
9. Multistore
Configuring the multistore feature on your PrestaShop
Enabling the multistore feature
Creating a new shop
Updating the MySQL table of the module
Updating the module code
Updating the ObjectModel class
Using Context in the get method
Updating the AdminController class
Using the Configuration class with multistore
Summary
10. Security and Performance
Securing your module
Protecting your module against directory listing
Forbidding direct access to class and controller files
Protecting your code against SQL injection
Protecting your templates against XSS
Verifying the data with MD5 hash
Searching for malicious code in modules
Checking for unusual e-mail sending
Checking for strange URL calls
Checking the use of eval
Checking the use of system, exec, and backquotes
Checking the use of base64_decode
Wrapping up on this section
Performance and optimization
Using Combine, Compress, and Cache
Using the cache system
Using the Smarty cache
Summary
A. Native Hooks
The list of all the dynamic hooks
Definitions of the variables
Index

PrestaShop Module Development

Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt ...

Table of contents

  1. PrestaShop Module Development
Citation styles for PrestaShop Module Development

APA 6 Citation

Serny, F. (2014). PrestaShop Module Development (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/391062/prestashop-module-development-pdf (Original work published 2014)

Chicago Citation

Serny, Fabien. (2014) 2014. PrestaShop Module Development. 1st ed. Packt Publishing. https://www.perlego.com/book/391062/prestashop-module-development-pdf.

Harvard Citation

Serny, F. (2014) PrestaShop Module Development. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/391062/prestashop-module-development-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Serny, Fabien. PrestaShop Module Development. 1st ed. Packt Publishing, 2014. Web. 14 Oct. 2022.