Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PrestaShop Module Development
  • Table Of Contents Toc
  • Feedback & Rating feedback
PrestaShop Module Development

PrestaShop Module Development

By : Serny
4.5 (15)
close
close
PrestaShop Module Development

PrestaShop Module Development

4.5 (15)
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)
close
close
12
Index

Adding CSS and JS in your module

We will now look at two new functions, which will permit you to add CSS and JS in your module:

$this->context->controller->addJS($this>_path.'views/js/mymodcomments.js');
$this->context->controller->addCSS($this->_path.'views/css/mymodcomments.css', 'all');

You will probably ask yourself why use these methods when you can just add the link to your CSS and JS directly in your module templates. The reasons are as follows:

  • It makes your module compliant with the CCC option in Advanced parameters | Performance. This option is used to dynamically merge all the CSS files and JS files together.
  • It avoids including the same JS file several times (for example, if you need a specific jQuery UI plugin already used by another module).

Note

You can also add the JS file, which is in the common JS directory:

$this->context->controller->addJS(_PS_JS_DIR_.'jquery/jquery-ui-1.8.10.custom.min.js');

Or you can...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PrestaShop Module Development
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon