Book Image

Practical Module development for Prestashop 8

By : Louis AUTHIE
Book Image

Practical Module development for Prestashop 8

By: Louis AUTHIE

Overview of this book

After version 1.7, PrestaShop underwent a host of changes, including migration to a Symfony-based system from an outdated legacy code. This migration brought about significant changes for developers, from routine maintenance to module development. Practical Module Development for PrestaShop 8 is curated to help you explore the system architecture, including migrated and non-migrated controllers, with a concise data structure overview. You’ll understand how hooks enable module customization and optimize the CMS. Through the creation of seven modules, you’ll learn about the structure of modules, hook registration, the creation of front-office controllers, and Symfony back-office controllers. By using Doctrine entities, services, CQRS, grids, and forms, you’ll be guided through the creation of standard, payment and carrier modules. Additionally, you'll customize and override themes to achieve your desired e-commerce store look. By the end of this book, you’ll be well equipped to provide modern solutions with PrestaShop that meet client requirements.
Table of Contents (23 chapters)
Part 1 – Understanding How PrestaShop is Structured and How It Works
Part 2 – How to Create Your Own Modules
Part 3 – Customizing Your Theme
Appendix – Module Upgrade, The Hooks Discovery Tool, and Multi-Store Functions

Assets Compiling with Webpack

With all the previous chapters, we know how the PrestaShop core works, how to build efficient modules, and how to customize our themes by using the best practices. Even if we can create our modules or theme assets directly by writing CSS and JavaScript code, most of us prefer using SASS to build stylesheets and to build JavaScript code with many third-party dependencies.

Instead of handling SASS compiling and embedding too many JavaScript files in the HTML code, leading to many HTTP requests, Webpack will help us manage all those tasks all at once.

Let’s learn more about this useful bundler by following these steps:

  • Understanding what Webpack does and its prerequisites
  • Discovering the structure of a Webpack config file
  • Building assets with Webpack

By the end of this chapter, we will know what Webpack does, how it works, and how to use it.