Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel2
styledisc
printablefalse

Designer Guide

The default PrestaShop install offers a neutral theme in shades of gray, enabling sellers to quickly and freely start their activity, whatever their business line.

More than 700 themes are available through the PrestaShop Addons marketplace. They were created either by the PrestaTeam or the PrestaShop community, and are sold at reasonable prices – some even free.

As a graphic designer/web developer, you too can put your themes up for sale on the PrestaShop Addons site, and earn 70% of the selling price.

Anyone with some knowledge of CSS and image manipulation can create a new custom theme for PrestaShop. Provided you know PHP as well, you can build a whole new theme for your shop. Thanks to a tried and tested theme system, any shop can quickly sport a theme tailored to its needs.

...

That theme system is based on a template engine, called Smarty, which allows web-designers and developers to easily build their own theme, with little technical knowledge.

Tip

All web-designers and developers should use the following tools:

  • Firefox: Firebug is a free extension for easy comparison and debugging between your CSS and the output.
  • Firefox/Chrome: Web Developer adds many handy web developer tools to your browser.
  • Safari/Chrome: enable the Web Inspector.
  • Opera: Dragonfly, a fully-featured debugging environment.
  • Internet Explorer 8+: Developer Tools are available through the Tools menu.

Internet Explorer users can also make use of Firebug lite.

Concepts and technical information

How a theme works

A PrestaShop theme is a set of files which you can edit in order to change the look of your online shop.

Here are a few important tidbits:

  • All themes have their files located in the /themes root folder.
  • Each theme has its own sub-folder, in the main themes folder.
  • Each theme is made of template files (/tpl), image files (.gif, .jpg, .png), one or more CSS files (/css), and sometimes even JavaScript files (.js).
  • Each theme has a preview.jpg image file in its folder, enabling the shop-owner to see what the theme looks like directly from the back-office, and select the theme appropriately.

Here is an overview of the file structure of a PrestaShop theme (here, the default one):

Image Added

  • The /css folder contains all CSS files.
  • The /img folder contains all images.
  • The /js folder contains all the JavaScript files.
  • The /lang folder contains the theme's translations. Its access rights should be set at CHMOD 666 (for instance), so that the back-office translation tool can read and write into it.
  • The root of the folder contains TPL files only (Smarty files), as well as the preview.jpg file.
Info

The /css, /img and /js folder are optional, the module can perfectly work without them, it's up to you to create them.

Handling translations

All of your theme's text string should be enclosed in a Smarty function, like so:

Code Block

{l s='Mon Texte'}

This will enable anyone to translate the theme into his own language, using the internal translation tool, which you can find in the PrestaShop back-office, under the "Tools" tab and its "Translation" sub-tab. In the "Modify translations" section, use the drop-down menu, choose "Back Office translation", then click on the flag of the language you wish to translate strings into. All the back-office strings will then be displayed, and the strings for your theme are those whose sections are not prefixed with "Admin*".

Having data sent to a theme

PrestaShop uses a 3-tier architecture, in order to clearly separate concerns: it uses...

  • a presentation tier: the user interface.
  • an application tier: controls the data flow from and to the other two tiers. Also called "business tier".
  • a data tier: the databases themselves.

(schema)

Thanks to the l() function, the hello.tpl file can display text in the user's language of choice.

The PrestaShop file structure

The PrestaShop developers have done their best to clearly and intuitively separate the various parts of the software.

Here is how the files are organized:

  • /admin:
  • /cache:
  • /classes:
  • /config:
  • /controlers:
  • /css:
  • /docs:
  • /download:
  • /img:
  • /install:
  • /js:
  • /localization:
  • /log:
  • /mails:
  • /modules:
  • /override:
  • /themes:
  • /tools:
  • /translations:
  • /upload:
  • /webservice:

Image Added

Customizing the default theme

...

You can also sell theme to PrestaShop users through our Addons website!

Creating your own theme

Integration: where the hooks and modules are

...