Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical Module development for Prestashop 8

You're reading from   Practical Module development for Prestashop 8 Create modern, customizable, and dynamic online stores using efficient modules

Arrow left icon
Product type Paperback
Published in Apr 2023
Publisher Packt
ISBN-13 9781837635962
Length 300 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Louis Authie Louis Authie
Author Profile Icon Louis Authie
Louis Authie
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Part 1 – Understanding How PrestaShop is Structured and How It Works
2. Chapter 1: Quick Overview of PrestaShop FREE CHAPTER 3. Chapter 2: The Configuration and Initialization of PrestaShop 4. Chapter 3: The Front Office 5. Chapter 4: The Back Office 6. Chapter 5: The Hooks 7. Chapter 6: The Themes 8. Part 2 – How to Create Your Own Modules
9. Chapter 7: What Are Modules? Let’s Create a Hello World Module 10. Chapter 8: A Reinsurance Block Module 11. Chapter 9: A Customer Callback Request Module 12. Chapter 10: Category Extension Module 13. Chapter 11: A Simple Blogging Module 14. Chapter 12: A Cash Payment Module 15. Chapter 13: A Drive Delivery Module 16. Part 3 – Customizing Your Theme
17. Chapter 14: How to Create a Child Theme 18. Chapter 15: Overriding Some Templates 19. Chapter 16: Assets Compiling with Webpack 20. Index 21. Other Books You May Enjoy Appendix – Module Upgrade, The Hooks Discovery Tool, and Multi-Store Functions

Overriding a module template from a (child) theme

If you remember our whrelaycarrier module, it adds a modal box that appears by choosing the Relay Carrier shipping option in the FO checkout controller. This modal box is provided by the displayAfterCarrier hook via the /modules/whrelaycarrier/views/templates/hook/displayAfterCarrier.tpl Smarty template file.

The modal box as designed in the original module looks as follows:

Figure 15.1 – The Relay points choice modal box provided by the original whrelaycarrier module

Figure 15.1 – The Relay points choice modal box provided by the original whrelaycarrier module

Our challenge here will be to add an H3 tag after the relay points H2 tag for the active (child) theme and not for others. This new tag will contain the "Custom Line to add to our theme text" text. The modal box should finally look like this:

Figure 15.2 – The custom (child) theme relay points choice modal box with the new H3 tag

Figure 15.2 – The custom (child) theme relay points choice modal box with the new H3 tag

Let’s suppose that the active theme is the child...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime