Skip to content

Customer Custom Code

Paul Gomez edited this page Sep 15, 2017 · 1 revision

For Salesportal/Dpluso/CRM we define the customer in site/config.php as $config->cptechcustomer

For files that need customization or different logic we create a copy of that file prepend it with the customer code and a - so for scripts that might have some custom for CPTech the file would look like 'cptech-scripts.js' compared to scripts.js.

Anywhere where we need to include the custom file we need to check if the file with that customercode prepended exists, then we include it. For example on the site/templates/content/customer/cust-page/customer-page-outline.php

if (file_exists($config->paths->content."customer/cust-page/$config->cptechcustomer-customer-shiptos-form.php")) {
   include $config->paths->content."customer/cust-page/$config->cptechcustomer-customer-shiptos-form.php";
} else {
   include $config->paths->content.'customer/cust-page/customer-shiptos-form.php';
}

Clone this wiki locally