Now that you created an amazing theme, you probably want to release it. The following documentation will walk you through creating a zip and passing Addons validation.
But first, you need to test your theme!
What make a theme valid¶
When you’re trying to select a theme in the backoffice, PrestaShop will test if your theme is valid. It won’t install if the theme isn’t valid.
A theme is valid if it contains some files and some configuration keys.
Here is the complete list of required files:
Required configuration keys¶
Your configuration file
config/theme.yml (read more about this file)
must details some configuration keys.
Here is the list of keys PrestaShop will look for. The dot represent the nesting.
How to use PrestaShop Automated Test Suite¶
PrestaShop 1.7 comes with an automated test suite used to develop Classic. You should use them to ensure your theme is fully compatible with PrestaShop’s feature.
java and Chrome installed on your machine.
The test suite is destructive. Do not run it in production.
Prepare your store for the tests:
- Install PrestaShop, preferably with 2 languages (though tests should ideally be language and settings agnostic)
tests/Selenium/settings.jsand customize according to your setup
- Once PrestaShop is installed, run
php prepare-shop.php. WARNING: never do this on a production shop because it will edit existing products without asking for your permission.
The test suite uses Selenium,
webdriver.io allows you to perform almost any action a browser would do using a fluent promise-based API.
You will need some familiarity with promises to make the most of the tool.
Add a new test¶
If you want to create a custom test, there are a few things you should know. Tests are contained in
Until we can do more documentation, please have a look at the existing tests and at the WebDriver.io API.
If you need to add general purpose helper functions for your tests, they should go in
If you need fixtures for your tests, please use the ones from the default installation or provide a script that installs them.
Do not hard-code things such as product ids in your tests: instead abstract them behind a name and put
them in the
Creating a valid zip file¶
There is no longer any theme data in the database with PrestaShop 1.7. Hence a theme is installed as soon as it’s on the disk.
If you want to theme to appears in the backoffice, it’s simply have to contain a
This will only display it, if you want to select it as your active theme, it has to be valid. Read What
makes a valid theme
Once it’s active you can export your theme using the _”Export current theme”_ button or use the command from your terminal.