Practical Module Development for Prestashop 8: Create modern, customizable, and dynamic online stores using efficient modules
- Length: 300 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2023-04-28
- ISBN-10: 183763596X
- ISBN-13: 9781837635962
- Sales Rank: #0 (See Top 100 Books)
Elevate your e-commerce game and beat the competition by unleashing the power of PrestaShop 8.x with Symfony-based modules, customizable themes, and much more
Purchase of the print or Kindle book includes a free PDF eBook
Key Features
- Understand the data and object architecture of the legacy and new Symfony core of PrestaShop
- Create modules to add features such as content blocks, payment options, and carriers to your store
- Learn to customize themes and override existing module templates
Book Description
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.
What you will learn
- Understand the structure of PrestaShop’s core
- Explore hooks and their functions
- Create a hello world module
- Build modules to display blocks in the front office with different styles
- Design a module to add fields to the category pages and manage them
- Fashion a blogging module with front and modern back-office controllers
- Fabricate payment and carrier modules to improve the user experience
- Customize a theme by creating a child theme
Who this book is for
If you are a junior or advanced PHP developer already using PrestaShop as a simple user willing to know more or to solve online sellers’ problems by creating modules as a professional, this book is definitely for you. In order to learn from this book, you should have a basic knowledge of the Symfony framework. This book will be a really good help for the module developers expecting to move from the old legacy environment to the modern one. Other CMS developers can use that book as a tool to compare and move to PrestaShop.
Practical Module Development for Prestashop 8 Contributors About the author About the reviewers Preface Who this book is for What this book covers To get the most out of this book Download the example code files Download the color images Conventions used Get in touch Share Your Thoughts Download a free PDF copy of this book Part 1 – Understanding How PrestaShop is Structured and How It Works Chapter 1: Quick Overview of PrestaShop Technical requirements The data model–how and where data is stored Browsing the data Reverse engineering the contact entity Manipulating data by extending the ObjectModel class Using the Db class The core classes – how the MVC works Presenting the legacy core MVC pattern Discovering the core migration Summary Chapter 2: The Configuration and Initialization of PrestaShop Technical requirements The legacy FO controller initialization Initializing a Category FO controller The legacy BO and Symfony admin controller initialization The legacy BO controller initialization The Symfony BO controller initialization The most important constants to set as a developer The Dispatcher class Summary Chapter 3: The Front Office Technical requirements Discovering how an FO controller works Discovering the ControllerCore object Discovering the FrontControllerCore object Discovering the implementation of CmsController Using the model Using the views from the theme Summary Chapter 4: The Back Office Technical requirements Discovering how a legacy-based BO controller works Discovering the AdminController features Exploring the AdminCartsController class The most useful tools for recurrent HTML generation: the Helper classes Generating an edition form with HelperForm Generating an element list table with HelperList Discovering how a migrated Symfony-based BO controller works Handling the form submission Using the CQRS design pattern Using a Command object and its CommandHandler class in the CommandBus Using a Query and its QueryHandler in the QueryBus Generating table views by using Grid components Summary Chapter 5: The Hooks Technical requirements Quick presentation of a hook Discovering the hook ObjectModel child object Presenting the two types of hook Registering/unregistering a module to a hook and implementing a module’s behavior on a hook execution Executing a hook Executing a hook from a legacy controller Executing a hook from a Symfony controller Executing a hook from a Smarty template Executing a hook from a Twig template Summary Chapter 6: The Themes Technical requirements Understanding what a theme is and its structure The FO Smarty templates The most used Smarty constants The CSS/JS assets Embedding the CSS Embedding the JavaScript Summary Part 2 – How to Create Your Own Modules Chapter 7: What Are Modules? Let’s Create a Hello World Module Technical requirements Defining a module Creating our first hello world module Overriding the install() and uninstall() methods Defining the hookDisplayHome($params) function Providing the module logo Adding an index.php file for security Installing our first module Summary Chapter 8: A Reinsurance Block Module Technical requirements Defining our module design Creating the module’s initial structure Defining the module class Choosing our hooks Defining the install() and uninstall() methods Defining the hook execution handlers Adding a Smarty template view Adding CSS styles to our module Testing our module Summary Chapter 9: A Customer Callback Request Module Technical requirements Defining our module design Creating the module’s initial structure Managing the model the modern way Creating the callback request entity Handling inserting a callback request into the database Sending a notification email Creating a modern BO controller containing a grid to list all the requests Creating a modern admin controller Creating a route in the Symfony router Using the Grid component to generate our callback requests listing view Handling a callback request delete action from the grid Adding the BO controller to the BO menu Creating a configuration page for our module and adding a Symfony form Defining our form type Defining our form data provider Generating the form and displaying it Handling form submission with a form handler Summary Chapter 10: Category Extension Module Technical requirements Presenting the most useful hooks to extend a form and handle it Extending the Category Symfony-based form on the BO Category controller Handling new input from the extended form Cleaning our saved content on Category deletions Defining our module design Creating the module’s initial structure Creating the entities Extending the Category form in creation mode Improving the Category form in edition mode Handling the extended form submission Handling Category deletion Displaying saved content on the FO Category page Testing our module Summary Chapter 11: A Simple Blogging Module Technical requirements Defining our module design Designing the general architecture of this module Defining the data structure Designing the BO controllers Designing the FO controllers Creating entities and relationships, repositories, and database tables Creating commands, queries, and data transfer objects Creating BO controllers and routes Creating AdminWHBlogCategoryController and its routes Creating AdminWHBlogPostController and its routes Adding forms for creating and editing entities Creating Grids Handling deletions Creating the FO controllers and displaying the data Summary Chapter 12: A Cash Payment Module Technical requirements Defining our module design Defining a PrestaShop payment module Creating our module structure Implementing the hookPaymentOptions($params) method Implementing the hookDisplayPaymentReturn($params) method Creating a new order status for orders pending cash payment Creating the payment validation controller Testing our module Summary Chapter 13: A Drive Delivery Module Technical requirements Defining our module design Defining a PrestaShop Carrier module Creating our module structure Creating a WHRelayCart entity to save our chosen relay points Creating a Carrier programmatically Displaying the relay pickup points list during the checkout Handling a relay pickup point choice via an Ajax FO controller Displaying the pickup point on the order view BO controller Creating a Widget to promote our module anywhere on the FO Testing our module Summary Part 3 – Customizing Your Theme Chapter 14: How to Create a Child Theme Technical requirements Discovering what a child theme is Creating a child theme structure Installing and testing our child theme example Summary Chapter 15: Overriding Some Templates Technical requirements Overriding a module template from a (child) theme Overriding a module CSS asset from a (child) theme Overriding a module JavaScript asset from a (child) theme Summary Chapter 16: Assets Compiling with Webpack Technical requirements Understanding what Webpack does and its prerequisites Discovering the structure of a Webpack config file Building assets with Webpack Summary Appendix – Module Upgrade, The Hooks Discovery Tool, and Multi-Store Functions Getting the hook parameters quickly Making a module multistore-compliant Upgrading a module Index Why subscribe? Other Books You May Enjoy Packt is searching for authors like you Share Your Thoughts Download a free PDF copy of this book
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Practical Module Development for Prestashop 8: Create modern, customizable, and dynamic online stores using efficient modules
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.