Announcement

Collapse
No announcement yet.

Can I create PHP functions?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can I create PHP functions?

    It is possible to include PHP expressions within the layouts in SellerDeck. These are only executed on the desktop, i.e. you cannot create PHP functions to dynamically change things online, but they still allow you to do a range of advanced customisations on your store data.

    There are some example PHP functions elsewhere in this guide – to find them,search this guide for: php="true"

    To include a php expression into a layout, start the code with...

    <actinic:block php="true">

    ...and finish it with...

    </actinic:block>

    When including a variable within a PHP function you need to right-click on it, select 'Edit Appearance' and then 'Encoding' to 'Quoted Perl' and set 'Selectable' to 'False'.

    * encoding="perl" means that any line breaks, quotes etc. within the variable values that might break the PHP expression will be encoded safely.

    * selectable="false" means that it cannot be selected in the 'Design' tab – this is essential as the dotted lines that get placed around selected variables will break PHP expressions.

    Within the 'Actinic v8' folder there is a file called 'actinic_main.php' which contains a set of PHP functions that are referred to from within the SellerDeck default layouts. If you want to create your own php functions and then refer to them from your layouts, do the following:

    1. Create a new file within the 'Actinic v8' folder called 'custom.php'.

    2. Add your new functions within 'custom.php'

    3. Place the following line within 'actinic_main.php':

    include_once("custom.php");
Working...
X