PrestaShop Cloud-specific development

PrestaShop Cloud uses the same core architecture as PrestaShop 1.6, so your modules should work as-is.

For information purposes, here are a few tips and information that you might want to know about...

PrestaShop Cloud-specific development:

Validate!

As always, make sure your module passes the PrestaShop validator before you submit it to Addons!

https://validator.prestashop.com/

PrestaShop Cloud or not?

You can let your module know if it's running on a PrestaShop Cloud store or a regular store:

if (defined('_PS_HOST_MODE_'))
	// PrestaShop Cloud store.
else
	// Regular store.

Dev mode

To put your store in Dev mode, open the .htaccess file and put the HTTP_PS_MODE_DEV_ constant to true. Put it back to false once in production.

Read-accessible core files and folders

Here are the files and folders that each PrestaShop Cloud store can read:

  • /backoffice

  • /classes

  • /config

  • /controllers

  • /css

  • /docs

  • error500.html

  • footer.php

  • header.php

  • images.inc.php

  • /img

  • index.php

  • init.php

  • /js

  • /tools

  • /webservice

Read- and write-accessible per-store files and folders:

Here are the files and folders that each PrestaShop Cloud store can read and edit:

  • /backoffice

  • /backups

  • /cache

  • /config

  • /download

  • /export

  • /import

  • index.php

  • init.php

  • /localization

  • /log

  • /mails

  • /modules

  • /override

  • /pdf

  • /themes

  • /translations

  • /upload

Read- and write-accessible per-store files and folders through FTP

Here are the files and folders than you can access and change through an FTP account:

  • /modules

  • /override

  • /themes

  • .htaccess

Core modification

PrestaShop's core is shared among all the PrestaShop Cloud stores, is only read-accessible for each store. Therefore, it is impossible to modify it.

Overrides installation and custom classes

Only use overriding code when really necessary.

Each store has its own /override folder. Still, you should not use it for override files that come from a module you wish to install. Just follow the regular way of adding overriding classes: Overriding default behaviors. When a module update is available, the override files will be updated as well.

If you wish to manually add a new class for your script (not a module), you can copy it into the correct folder.

Using defines for folders

To access the various folders available to core, you have to use the constants listed in /config/defines.inc.php and /config/defines_uri.inc.php.

Including JavaScript and CSS files

Use the methods that are available to core in order to include the various JS and CSS files that are useful to your module:

$this->context->controller->addCSS($this->_path.'css/admin.css');
$this->context->controller->addJS($this->_path.'js/admin.js');

Using the right protocol

Make sure you use the right protocol to build your URL:

Tools::getShopProtocol();

Last updated