diff --git a/controllers/admin/AdminAccountingExportController.php b/controllers/admin/AdminAccountingExportController.php
index cee4793d9..bd95f1579 100644
--- a/controllers/admin/AdminAccountingExportController.php
+++ b/controllers/admin/AdminAccountingExportController.php
@@ -39,7 +39,7 @@ class AdminAccountingExportControllerCore extends AdminController
public $exportSelected = '';
- public $fd = NULL;
+ public $fd = null;
public $date = array(
'begin' => '',
@@ -157,7 +157,7 @@ class AdminAccountingExportControllerCore extends AdminController
'urlDownload' => Tools::getShopDomain().'/download/'
));
- foreach($this->exportTypeList as $exportType)
+ foreach ($this->exportTypeList as $exportType)
{
$this->context->smarty->assign(array(
'title' => $exportType['name'],
@@ -189,7 +189,7 @@ class AdminAccountingExportControllerCore extends AdminController
// Switch to ajax if there is any problems with time
ini_set('max_execution_time', 0);
- switch($this->exportSelected)
+ switch ($this->exportSelected)
{
case 'reconciliation_export':
$this->runReconciliationExport();
@@ -218,10 +218,10 @@ class AdminAccountingExportControllerCore extends AdminController
{
$this->checkRights();
- if (!count($this->errors) && $this->fd !== NULL)
+ if (!count($this->errors) && $this->fd !== null)
{
$buffer = '';
- foreach($this->exportTypeList[$this->exportSelected]['fields'] as $key => $translation)
+ foreach ($this->exportTypeList[$this->exportSelected]['fields'] as $key => $translation)
$buffer .= '"'.$translation.'";';
fwrite($this->fd, mb_convert_encoding(rtrim($buffer, ';')."\r\n", 'UTF-16LE'));
@@ -293,7 +293,7 @@ class AdminAccountingExportControllerCore extends AdminController
$line[9] = $row['wording'];
// Override case depending of the whished line
- switch($line_number)
+ switch ($line_number)
{
case 0:
$line[2] = $row['account_client'];
@@ -301,7 +301,7 @@ class AdminAccountingExportControllerCore extends AdminController
break;
case 1:
$line[2] = !empty($row['account']) ? $row['account'] :
- Configuration::get('default_account_number', NULL, NULL, $row['id_shop']);
+ Configuration::get('default_account_number', null, null, $row['id_shop']);
// Force an empty string if Configuration send false
$line[2] = empty($line[2]) ? '' : $line[2];
$line[5] = $row['product_price_ht'];
@@ -328,7 +328,7 @@ class AdminAccountingExportControllerCore extends AdminController
// Cache list to merge easily the content with the same accounting for different invoice number
$cache_list = array();
$num = 0;
- foreach($db_details as $row)
+ foreach ($db_details as $row)
{
// Init the list for the current invoice number
if (!array_key_exists($row['invoice_number'], $cache_list))
@@ -337,7 +337,7 @@ class AdminAccountingExportControllerCore extends AdminController
// Need to Generate 3 lines for a product
for ($i = 0; $i < 3; ++$i)
// Create the two first line and check if a tax exist for the last one
- if ($i < 2 || ($i == 2 && $row['id_tax'] !== NULL))
+ if ($i < 2 || ($i == 2 && $row['id_tax'] !== null))
{
// Generate a product line
$line = $this->createLine($row, $i);
@@ -379,9 +379,9 @@ class AdminAccountingExportControllerCore extends AdminController
// If advanced stock management enable then we foreach the cache_list to know
// if a product use the system to store back the movement price.
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
- foreach($cache_list as $invoice_list)
- foreach($invoice_list as $product_list)
- foreach($product_list as $id_product => $product_detail)
+ foreach ($cache_list as $invoice_list)
+ foreach ($invoice_list as $product_list)
+ foreach ($product_list as $id_product => $product_detail)
if ($product_detail['advanced_stock_management'])
{
// Get stock product stock movement detail
@@ -465,7 +465,7 @@ class AdminAccountingExportControllerCore extends AdminController
protected function downloadFile($fileName)
{
$path = $this->downloadDir.$fileName;
- header('Content-length: ' . filesize($path));
+ header('Content-length: '.filesize($path));
header('Content-Disposition: attachment; filename="'.$fileName.'"');
// Flush buffered data before reading the file
diff --git a/controllers/admin/AdminAccountingManagementController.php b/controllers/admin/AdminAccountingManagementController.php
index 49aee5faa..001fc3581 100644
--- a/controllers/admin/AdminAccountingManagementController.php
+++ b/controllers/admin/AdminAccountingManagementController.php
@@ -49,15 +49,14 @@ class AdminAccountingManagementControllerCore extends AdminController
$id_shop = $this->context->shop->getID();
// Set default zone value to the shop and sort it
- foreach($zones as $zone)
+ foreach ($zones as $zone)
{
$shop['zones'][$zone['id_zone']]['name'] = $zone['name'];
$shop['zones'][$zone['id_zone']]['account_number'] = '';
$shop['name'] = $this->context->shop->name;
}
- $shop['default_account_number'] = Configuration::get('default_account_number',
- NULL, NULL, $id_shop);
+ $shop['default_account_number'] = Configuration::get('default_account_number', null, null, $id_shop);
ksort($shop['zones']);
$zoneShopList = Accounting::getAccountNumberZoneShop($id_shop);
diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php
index ad8826a28..a2737cd01 100644
--- a/controllers/admin/AdminAddressesController.php
+++ b/controllers/admin/AdminAddressesController.php
@@ -391,11 +391,11 @@ class AdminAddressesControllerCore extends AdminController
foreach (array('inv','dlv') as $adr_type)
{
foreach (${$adr_type.'_adr_fields'} as $fields_line)
- foreach(explode(' ',$fields_line) as $field_item)
+ foreach (explode(' ', $fields_line) as $field_item)
${$adr_type.'_all_fields'}[] = trim($field_item);
- $out[$adr_type.'_adr_fields'] = ${$adr_type.'_adr_fields'};
- $out[$adr_type.'_all_fields'] = ${$adr_type.'_all_fields'};
+ $out[$adr_type.'_adr_fields'] = ${$adr_type.'_adr_fields'};
+ $out[$adr_type.'_all_fields'] = ${$adr_type.'_all_fields'};
}
return $out;
diff --git a/controllers/admin/AdminAttributesGroupsController.php b/controllers/admin/AdminAttributesGroupsController.php
index 8f1798e8e..15d96fbc4 100644
--- a/controllers/admin/AdminAttributesGroupsController.php
+++ b/controllers/admin/AdminAttributesGroupsController.php
@@ -329,7 +329,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
$str_attributes_groups = '';
foreach ($attributes_groups as $attribute_group)
- $str_attributes_groups .= '"'.$attribute_group['id_attribute_group'].'" : '.($attribute_group['group_type'] == 'color' ? '1' : '0' ) .', ';
+ $str_attributes_groups .= '"'.$attribute_group['id_attribute_group'].'" : '.($attribute_group['group_type'] == 'color' ? '1' : '0' ).', ';
$image = _PS_IMG_DIR_.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg';
$this->tpl_form_vars = array(
diff --git a/controllers/admin/AdminCartRulesController.php b/controllers/admin/AdminCartRulesController.php
index 5c0b6c938..b8f16eab8 100644
--- a/controllers/admin/AdminCartRulesController.php
+++ b/controllers/admin/AdminCartRulesController.php
@@ -84,7 +84,7 @@ class AdminCartRulesControllerCore extends AdminController
$this->afterAdd($currentObject);
}
- // TODO Move this function into CartRule
+ /* @TODO Move this function into CartRule */
public function afterAdd($currentObject)
{
// Add restrictions for generic entities like country, carrier and group
@@ -289,20 +289,20 @@ class AdminCartRulesControllerCore extends AdminController
// All the filter are prefilled with the correct information
$customer_filter = '';
- if (Validate::isUnsignedId($current_object->id_customer) AND
- $customer = new Customer($current_object->id_customer) AND
+ if (Validate::isUnsignedId($current_object->id_customer) &&
+ ($customer = new Customer($current_object->id_customer)) &&
Validate::isLoadedObject($customer))
$customer_filter = $customer->firstname.' '.$customer->lastname.' ('.$customer->email.')';
$gift_product_filter = '';
- if (Validate::isUnsignedId($current_object->gift_product) AND
- $product = new Product($current_object->gift_product, false, Context::getContext()->language->id) AND
+ if (Validate::isUnsignedId($current_object->gift_product) &&
+ ($product = new Product($current_object->gift_product, false, Context::getContext()->language->id)) &&
Validate::isLoadedObject($product))
$gift_product_filter = trim($product->reference.' '.$product->name);
$reduction_product_filter = '';
- if (Validate::isUnsignedId($current_object->reduction_product) AND
- $product = new Product($current_object->reduction_product, false, Context::getContext()->language->id) AND
+ if (Validate::isUnsignedId($current_object->reduction_product) &&
+ ($product = new Product($current_object->reduction_product, false, Context::getContext()->language->id)) &&
Validate::isLoadedObject($product))
$reduction_product_filter = trim($product->reference.' '.$product->name);
diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php
index a9b73291d..c5b1ed9f3 100755
--- a/controllers/admin/AdminCartsController.php
+++ b/controllers/admin/AdminCartsController.php
@@ -245,7 +245,7 @@ class AdminCartsControllerCore extends AdminController
return;
if ($this->context->cart->OrderExists())
$errors[] = Tools::displayError('An order already placed with this cart');
- elseif (!($id_product = (int)Tools::getValue('id_product')) OR !($product = new Product((int)$id_product, true, $this->context->language->id)))
+ elseif (!($id_product = (int)Tools::getValue('id_product')) || !($product = new Product((int)$id_product, true, $this->context->language->id)))
$errors[] = Tools::displayError('Invalid product');
elseif (!($qty = Tools::getValue('qty')) || $qty == 0)
$errors[] = Tools::displayError('Invalid quantity');
@@ -355,9 +355,7 @@ class AdminCartsControllerCore extends AdminController
if ($this->tabAccess['edit'] === '1')
{
$errors = array();
- $customer = new Customer((int)$this->context->cart->id_customer);
-
- if (!$id_cart_rule = Tools::getValue('id_cart_rule') OR !$cart_rule = new CartRule((int)$id_cart_rule))
+ if (!$id_cart_rule = Tools::getValue('id_cart_rule') || !$cart_rule = new CartRule((int)$id_cart_rule))
$errors[] = Tools::displayError('Invalid voucher');
else if ($err = $cart_rule->checkValidity($this->context))
$errors[] = $err;
diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php
index 64ec9c414..d47c99656 100644
--- a/controllers/admin/AdminCategoriesController.php
+++ b/controllers/admin/AdminCategoriesController.php
@@ -160,7 +160,7 @@ class AdminCategoriesControllerCore extends AdminController
asort($categories_tree);
$this->tpl_list_vars['categories_tree'] = $categories_tree;
- if (Tools::isSubmit('submitBulkdelete'.$this->table) OR Tools::isSubmit('delete'.$this->table))
+ if (Tools::isSubmit('submitBulkdelete'.$this->table) || Tools::isSubmit('delete'.$this->table))
{
$category = new Category(Tools::getValue('id_category'));
if ($category->is_root_category)
@@ -265,9 +265,9 @@ class AdminCategoriesControllerCore extends AdminController
$guest = new Group(Configuration::get('PS_GUEST_GROUP'));
$default = new Group(Configuration::get('PS_CUSTOMER_GROUP'));
- $unidentified_group_information = sprintf($this->l('%s - All persons without a customer account or unauthenticated.'), "".$unidentified->name[$this->context->language->id]."");
- $guest_group_information = sprintf($this->l('%s - Customer who placed an order with the Guest Checkout.'), "".$guest->name[$this->context->language->id]."");
- $default_group_information = sprintf($this->l('%s - All persons who created an account on this site.'), "".$default->name[$this->context->language->id]."");
+ $unidentified_group_information = sprintf($this->l('%s - All persons without a customer account or unauthenticated.'), ''.$unidentified->name[$this->context->language->id].'');
+ $guest_group_information = sprintf($this->l('%s - Customer who placed an order with the Guest Checkout.'), ''.$guest->name[$this->context->language->id].'');
+ $default_group_information = sprintf($this->l('%s - All persons who created an account on this site.'), ''.$default->name[$this->context->language->id].'');
$root_category = Category::getRootCategory();
$root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name);
$this->fields_form = array(
@@ -511,9 +511,8 @@ class AdminCategoriesControllerCore extends AdminController
if (Validate::isLoadedObject($object = $this->loadObject()) && isset($this->fieldImageSettings))
{
if ($object->isRootCategoryForAShop())
- {
$this->errors[] = Tools::displayError('You cannot remove this category because a shop uses this category as a root category.');
- }// check if request at least one object with noZeroObject
+ // check if request at least one object with noZeroObject
elseif (isset($object->noZeroObject) &&
count($taxes = call_user_func(array($this->className, $object->noZeroObject))) <= 1)
$this->errors[] = Tools::displayError('You need at least one object.').' '.
diff --git a/controllers/admin/AdminCmsCategoriesController.php b/controllers/admin/AdminCmsCategoriesController.php
index 5c31a3f6e..f80a3408c 100644
--- a/controllers/admin/AdminCmsCategoriesController.php
+++ b/controllers/admin/AdminCmsCategoriesController.php
@@ -73,7 +73,7 @@ class AdminCmsCategoriesControllerCore extends AdminController
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
}
- public function postProcess($token = NULL)
+ public function postProcess($token = null)
{
$this->tabAccess = Profile::getProfileAccess($this->context->employee->id_profile, $this->id);
if (Tools::isSubmit('submitAdd'.$this->table))
@@ -89,7 +89,7 @@ class AdminCmsCategoriesControllerCore extends AdminController
}
}
/* Change object statuts (active, inactive) */
- elseif (isset($_GET['statuscms_category']) AND Tools::getValue($this->identifier))
+ elseif (isset($_GET['statuscms_category']) && Tools::getValue($this->identifier))
{
if ($this->tabAccess['edit'] === '1')
{
@@ -111,10 +111,10 @@ class AdminCmsCategoriesControllerCore extends AdminController
{
if ($this->tabAccess['delete'] === '1')
{
- if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings))
+ if (Validate::isLoadedObject($object = $this->loadObject()) && isset($this->fieldImageSettings))
{
// check if request at least one object with noZeroObject
- if (isset($object->noZeroObject) AND sizeof($taxes = call_user_func(array($this->className, $object->noZeroObject))) <= 1)
+ if (isset($object->noZeroObject) && count($taxes = call_user_func(array($this->className, $object->noZeroObject))) <= 1)
$this->errors[] = Tools::displayError('You need at least one object.').' '.$this->table.' '.Tools::displayError('You cannot delete all of the items.');
else
{
diff --git a/controllers/admin/AdminCmsContentController.php b/controllers/admin/AdminCmsContentController.php
index 4f033a379..f24ef1f36 100644
--- a/controllers/admin/AdminCmsContentController.php
+++ b/controllers/admin/AdminCmsContentController.php
@@ -34,7 +34,7 @@ class AdminCmsContentControllerCore extends AdminController
private $adminCMS;
/** @var object Category() instance for navigation*/
- private static $_category = NULL;
+ private static $_category = null;
public function __construct()
{
diff --git a/controllers/admin/AdminCmsController.php b/controllers/admin/AdminCmsController.php
index d8a43bd44..983acc6d5 100644
--- a/controllers/admin/AdminCmsController.php
+++ b/controllers/admin/AdminCmsController.php
@@ -185,12 +185,12 @@ class AdminCmsControllerCore extends AdminController
return parent::renderList();
}
- public function displayList($token = NULL)
+ public function displayList($token = null)
{
/* Display list header (filtering, pagination and column names) */
$this->displayListHeader($token);
- if (!sizeof($this->_list))
- echo '
'.$this->l('No items found').'
';
+ if (!count($this->_list))
+ echo '
'.$this->l('No items found').'
';
/* Show the content of the table */
$this->displayListContent($token);
@@ -212,15 +212,15 @@ class AdminCmsControllerCore extends AdminController
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
}
- function postProcess()
+ public function postProcess()
{
- if (Tools::isSubmit('viewcms') AND ($id_cms = (int)(Tools::getValue('id_cms'))) AND $cms = new CMS($id_cms, $this->context->language->id) AND Validate::isLoadedObject($cms))
+ if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms))
{
$redir = $this->context->link->getCMSLink($cms);
if (!$cms->active)
{
$admin_dir = dirname($_SERVER['PHP_SELF']);
- $admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1);
+ $admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
$redir .= '?adtoken='.Tools::encrypt('PreviewCMS'.$cms->id).'&ad='.$admin_dir;
}
Tools::redirectAdmin($redir);
@@ -262,10 +262,10 @@ class AdminCmsControllerCore extends AdminController
else
$this->errors[] = Tools::displayError('You do not have permission to delete here.');
}
- elseif (Tools::isSubmit('submitAddcms') OR Tools::isSubmit('submitAddcmsAndPreview'))
+ elseif (Tools::isSubmit('submitAddcms') || Tools::isSubmit('submitAddcmsAndPreview'))
{
parent::validateRules();
- if (!sizeof($this->errors))
+ if (!count($this->errors))
{
if (!$id_cms = (int)(Tools::getValue('id_cms')))
{
@@ -282,7 +282,7 @@ class AdminCmsControllerCore extends AdminController
if (!$cms->active)
{
$admin_dir = dirname($_SERVER['PHP_SELF']);
- $admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1);
+ $admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
$token = Tools::encrypt('PreviewCMS'.$cms->id);
$preview_url .= $cms->active ? '' : '&adtoken='.$token.'&ad='.$admin_dir;
@@ -306,7 +306,7 @@ class AdminCmsControllerCore extends AdminController
if (!$cms->active)
{
$admin_dir = dirname($_SERVER['PHP_SELF']);
- $admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1);
+ $admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
$token = Tools::encrypt('PreviewCMS'.$cms->id);
$preview_url .= $object->active ? '' : '&adtoken='.$token.'&ad='.$admin_dir;
@@ -330,7 +330,7 @@ class AdminCmsControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=4'.(($id_category = (int)(Tools::getValue('id_cms_category'))) ? ('&id_cms_category='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCmsContent'));
}
/* Change object statuts (active, inactive) */
- elseif (Tools::isSubmit('status') AND Tools::isSubmit($this->identifier))
+ elseif (Tools::isSubmit('status') && Tools::isSubmit($this->identifier))
{
if ($this->tabAccess['edit'] === '1')
{
diff --git a/controllers/admin/AdminContactController.php b/controllers/admin/AdminContactController.php
index 21ae8317f..4918f2a87 100644
--- a/controllers/admin/AdminContactController.php
+++ b/controllers/admin/AdminContactController.php
@@ -43,11 +43,11 @@ class AdminContactControllerCore extends AdminController
$this->context = Context::getContext();
$countryList = array();
$countryList[] = array('id' => '0', 'name' => $this->l('Choose your country'));
- foreach (Country::getCountries($this->context->language->id) AS $country)
+ foreach (Country::getCountries($this->context->language->id) as $country)
$countryList[] = array('id' => $country['id_country'], 'name' => $country['name']);
$stateList = array();
$stateList[] = array('id' => '0', 'name' => $this->l('Choose your state (if applicable)'));
- foreach (State::getStates($this->context->language->id) AS $state)
+ foreach (State::getStates($this->context->language->id) as $state)
$stateList[] = array('id' => $state['id_state'], 'name' => $state['name']);
$formFields = array(
@@ -81,12 +81,12 @@ class AdminContactControllerCore extends AdminController
$fields = array();
$orderedFields = AddressFormat::getOrderedAddressFields(Configuration::get('PS_SHOP_COUNTRY_ID'), false, true);
- foreach($orderedFields as $lineFields)
+ foreach ($orderedFields as $lineFields)
if (($patterns = explode(' ', $lineFields)))
- foreach($patterns as $pattern)
+ foreach ($patterns as $pattern)
if (($key = array_search($pattern, $associatedOrderKey)))
$fields[$key] = $formFields[$key];
- foreach($formFields as $key => $value)
+ foreach ($formFields as $key => $value)
if (!isset($fields[$key]))
$fields[$key] = $formFields[$key];
diff --git a/controllers/admin/AdminCurrenciesController.php b/controllers/admin/AdminCurrenciesController.php
index 79c6876c8..7e9b70a2e 100644
--- a/controllers/admin/AdminCurrenciesController.php
+++ b/controllers/admin/AdminCurrenciesController.php
@@ -296,7 +296,7 @@ class AdminCurrenciesControllerCore extends AdminController
public function processExchangeRates($token)
{
if (!$this->errors[] = Currency::refreshCurrencies())
- Tools::redirectAdmin(self::$currentIndex . '&conf=6' . '&token=' . $this->token);
+ Tools::redirectAdmin(self::$currentIndex.'&conf=6&token='.$this->token);
}
/**
diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php
index 454e482fb..9bb5e41f7 100644
--- a/controllers/admin/AdminCustomersController.php
+++ b/controllers/admin/AdminCustomersController.php
@@ -199,7 +199,7 @@ class AdminCustomersControllerCore extends AdminController
LIMIT 1
) as connect';
- if (Tools::isSubmit('submitBulkdelete'.$this->table) OR Tools::isSubmit('delete'.$this->table))
+ if (Tools::isSubmit('submitBulkdelete'.$this->table) || Tools::isSubmit('delete'.$this->table))
$this->tpl_list_vars = array(
'delete_customer' => true,
'REQUEST_URI' => $_SERVER['REQUEST_URI'],
@@ -397,13 +397,14 @@ class AdminCustomersControllerCore extends AdminController
);
}
- if (Configuration::get('PS_B2B_ENABLE')) {
+ if (Configuration::get('PS_B2B_ENABLE'))
+ {
$risks = Risk::getRisks();
$list_risks = array();
foreach ($risks as $key => $risk)
{
- $list_risks[$key]['id_risk'] = (int) $risk->id;
+ $list_risks[$key]['id_risk'] = (int)$risk->id;
$list_risks[$key]['name'] = $risk->name;
}
diff --git a/controllers/admin/AdminEmailsController.php b/controllers/admin/AdminEmailsController.php
index 98372f0c2..500fe95cd 100644
--- a/controllers/admin/AdminEmailsController.php
+++ b/controllers/admin/AdminEmailsController.php
@@ -34,7 +34,7 @@ class AdminEmailsControllerCore extends AdminController
parent::__construct();
- foreach (Contact::getContacts($this->context->language->id) AS $contact)
+ foreach (Contact::getContacts($this->context->language->id) as $contact)
$arr[] = array('email_message' => $contact['id_contact'], 'name' => $contact['name']);
$this->options = array(
@@ -89,7 +89,7 @@ class AdminEmailsControllerCore extends AdminController
if (isset($_POST['PS_SHOP_EMAIL']))
$_POST['PS_SHOP_EMAIL'] = Configuration::get('PS_SHOP_EMAIL');
- if ($_POST['PS_MAIL_METHOD'] == 2 AND (empty($_POST['PS_MAIL_SERVER']) OR empty($_POST['PS_MAIL_SMTP_PORT'])))
+ if ($_POST['PS_MAIL_METHOD'] == 2 && (empty($_POST['PS_MAIL_SERVER']) || empty($_POST['PS_MAIL_SMTP_PORT'])))
$this->errors[] = Tools::displayError('You must define a SMTP server and a SMTP port. If you do not know, use the PHP mail() function instead.');
}
}