Tag: design

  • Tired of hooks? Try a Plugin (Prestashop 1.4)

    Please note that this version only works currently for Smarty v2, enabling smarty v3 will cause an error. I’ll post an update that resolves this issue shortly.

    Update: This article has been revised in: 1.4 Plugins Revisited

    In a previous article Display Module Output Anywhere I touched on the subject of subverting Prestashop’s internal Module architecture to our own ends. In this article we’ll be looking at creating a new mechanism for injecting module output into themes that doesn’t rely on tedious code changes, and should be able to be employed by (almost) anyone regardless of programming ability.

    How about being able to display the home featured products anywhere in your template files just by adding a single line (as below)?

    {plugin module='homefeatured' hook='home'}

    If this looks like something you would find useful, then read on….

    (more…)
  • The Ultimate Prestashop Module and Theme Development Tool

    Debugging Prestashop Templates

    While stumbling around the internet as you do when pondering a particularly awkward programming challenge, I came across an excellent post on smarty debug with FireBug. This inspired me to pull together a Prestashop module to allow store owners, designers and developers to view indepth debugging data from right within the Prestashop environment.

    (more…)
  • Customising Prestashop Module Templates

    Please don’t edit those originals!

    I came across this little gem a while ago on the Prestashop forum, and thought I would draw attention to it in the hopes that it will help someone, somewhere.

    (more…)
  • Writing your own Prestashop Module – Part 4

    Form Validation and Security

    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 general issue of form input checking and security, both for Back Office and Front Office forms and user input as well as looking at improving our code both functionally and aesthetically.

    Updated for Prestashop version 1.4 onwards.

    (more…)
  • Writing your own Prestashop Module – Part 3

    Storing Module Configuration

    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.

    Updated for Prestashop version 1.4 onwards.

    (more…)
  • Writing your own Prestashop Module – Part 2

    Creating a basic module

    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.

    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” management functionality.

    Updated for Prestashop version 1.4 onwards.

    (more…)
  • Writing your own PrestaShop Module – Part 1

    So you want to write a module?

    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  template for your own code. Later articles will look at creating Payment Modules and extending the Administration interface, but initially we’ll look at the class of modules which deal mainly with inserting content into your pages, as this best demonstrates the fundamental basic concepts of developing for PrestaShop.

    Updated for Prestashop version 1.4 onwards.

    (more…)
  • Randomly Displayed Adverts and Callouts

    Another useful tool for conversions is being able to attract the attention of your visitors and guide them to the parts of your site you really want them to see. We’ve come up with yet another great little PrestaShop module to do precisely that!

    (more…)
  • “AddStuff” for PrestaShop

    Addstuff will be 1 year old on 5th August 2009!!

    Here’s a fun little module that several have used to add some easy custom items to their pages. Inspired by many modules by the same (or similar) names for other open source projects, this allows you to include your own html (or anything else you can think of) into your right or left column easily.

    The configuration consists of two items:

    • A filename (default “mystuff.html” in the module directory)
    • A check box to select using the standard box model class (heading is styled with h4)

    The example code puts an image and link on your page, so you’ll probably want to change it, but feel free to link back to here from your sites. We appreciate your support!

    Latest Version: Addstuff v0.6.3

  • Preventing the copying of your site design templates

    I was browsing the prestashop forum and ended up on a thread concerning an issue with people stealing a site design by downloading the template files from the theme directory. It struck me that this is probably something that those of you who use other template systems with your sites may also face, so thought I’d post the solution here too.

    The problem is that although php files cannot be viewed directly on your browser, other source files can be e.g. files ending in .tpl

    The best way to protect your site is to change the permissions on these files to 600. This will make them accessible only by your own code on the server and present anyone nosey enough to try and look at them with a 403 (forbidden) error. The same is true for php files (although these shouldn’t display the source unless your server configuration is broken).

    Simple.