July, 2010Archive for

Writing your own Prestashop Module – Part 5

The finishing touches Introduction In this final part of our basic module writing tutorial series we’ll look at the final steps to transform our Tutorialthird module class into a base template that we can use to kick start the writing of new modules. Rather than republish the same old code again we’ll only discuss the changes, but I’ve added a download link at the end of this part so you can grab the final code and use it as the basis for your own projects. We’re going to call this module ...

Google Sitemap Generator Module

Module Description: There seems to have been a lot of problems with the Google XML Sitemap generator shipping with PrestaShop 1.2, so I’ve had a run through and re-written a fair bit of the code to fix these issues. The main changes (in 1.4.2) are: * New XML generation code using the DOMDocument(*) class * Modified the logic to remove extra elements from the generated URLs * Added an xml-stylesheet reference to the output file, xsl included in download * Fixed the issues...

Sliding accordion categories block

Module Description: Sliding accordion categories block features include: * Top-level categories slide so that only one set of subcategories is visible at a time, which saves room when there are many categories. * Configuration page allows one of following slide animations to be used: None, Default, Ease and Bounce. * The categories can be set to slide on mouse click or mouse hover. * The block height can be set to a fixed size or a variable size that changes based on how ma...

Create Hooks in 6 easy steps!

Took me quite a while and lots of meddling to figure this out… thought I would share with the rest of you guys on how to create a hook so u can NOT waste the number of hours like I did. 1. Goto your database and modify ps_hook… (ps_ is what I named my database, so it can be replaced by what you named yours.) 2. find the last id_hook number and insert a new number after with the hook that you want to name e.g. I name it ‘cat’ 3. goto the php of the pages you want the hook to be in… e.g f...

Horizontal Category Menu Module

Module Description: This is a horizontal category bar module. Module Download: Free download Horizontal Category Menu Module Module Homepage: Horizontal Category Menu Module

Writing your own Prestashop Module – Part 4

Form Validation and Security Introduction While being sufficiently functional for what it does, the module we created in Part 2 does present us with some issues to consider when implementing “real world” modules to extend Prestashop. In particular the user input we captured with our form was written directly to the configuration entry without any checking to determine whether it was valid, nor did we take account of the type of data being entered. In this tutorial we will look at the ge...

Writing your own Prestashop Module – Part 3

Storing Module Configuration Introduction In the third part of this series we’ll look at how we can store configuration data for our modules in the Prestashop database, and how we can allow users to interact with this data to control the module’s behaviour. We will also briefly touch on how we can generate output from our module to provide visual feedback of the configuration changes. Managing user settings We’re going to call this module “TutorialSecond” so we again need to create a...

Writing your own Prestashop Module – Part 2

Creating a basic module Introduction In this second part of the series we will look at creating our first basic Prestashop module that can be controlled from the Back Office. The Module class Similar to the ObjectModel base class, all Prestashop modules are extended from a common base class used to define their basic functionality. The “Module” class provides the interface between the administration screens and your module as well as providing internationalisation and “hook” manageme...

Writing your own PrestaShop Module – Part 1

Introduction There has always been a little bit of Voodoo associated Prestashop modules. This has been mainly down to a lack of documentation available, but never fear — this series of tutorials aim to introduce module writing to the PHP programming masses. This series will look at building our very own fully functional module which will provide all the standard functionality that is the basis for many of the most common modules. It will also provide a basic framework that you can use as a&nb...

How to make Prestashop Modules?

Believe me its really simple to make a prestashop module. All you need to understand how prestashop modules works. I've attached a sample module at the end of this article. Well... All modules are attached with hooks. What is hook? Hook is actually a module holder. By default prestashop have some hooks i.e. rightColumn, leftColumn, payment, paymentReturn, updateOrderStatus, top, footer, productActions, cart, customerAccount, header, productTab, productTabContent, home and lots more. I'll writ...