[-] BO : #PSFV-221 - Fixed bad ajax return on no manufacturers on the product tab
This commit is contained in:
+2
-4
@@ -75,13 +75,11 @@ if (Tools::isSubmit('ajaxProductManufacturers'))
|
|||||||
{
|
{
|
||||||
AdminTab::$currentIndex = 'index.php?tab=AdminCatalog';
|
AdminTab::$currentIndex = 'index.php?tab=AdminCatalog';
|
||||||
$manufacturers = Manufacturer::getManufacturers();
|
$manufacturers = Manufacturer::getManufacturers();
|
||||||
|
$jsonArray = array();
|
||||||
if ($manufacturers)
|
if ($manufacturers)
|
||||||
{
|
|
||||||
$jsonArray = array();
|
|
||||||
foreach ($manufacturers AS $manufacturer)
|
foreach ($manufacturers AS $manufacturer)
|
||||||
$jsonArray[] = '{"optionValue": "'.$manufacturer['id_manufacturer'].'", "optionDisplay": "'.htmlspecialchars(trim($manufacturer['name'])).'"}';
|
$jsonArray[] = '{"optionValue": "'.$manufacturer['id_manufacturer'].'", "optionDisplay": "'.htmlspecialchars(trim($manufacturer['name'])).'"}';
|
||||||
die('['.implode(',', $jsonArray).']');
|
die('['.implode(',', $jsonArray).']');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1949,13 +1949,11 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
public function ajaxProcessProductManufacturers()
|
public function ajaxProcessProductManufacturers()
|
||||||
{
|
{
|
||||||
$manufacturers = Manufacturer::getManufacturers();
|
$manufacturers = Manufacturer::getManufacturers();
|
||||||
if ($manufacturers)
|
|
||||||
{
|
|
||||||
$jsonArray = array();
|
$jsonArray = array();
|
||||||
foreach ($manufacturers AS $manufacturer)
|
if ($manufacturers)
|
||||||
$jsonArray[] = '{"optionValue": "'.$manufacturer['id_manufacturer'].'", "optionDisplay": "'.htmlspecialchars(trim($manufacturer['name'])).'"}';
|
foreach ($manufacturers AS $manufacturer)
|
||||||
|
$jsonArray[] = '{"optionValue": "'.$manufacturer['id_manufacturer'].'", "optionDisplay": "'.htmlspecialchars(trim($manufacturer['name'])).'"}';
|
||||||
die('['.implode(',', $jsonArray).']');
|
die('['.implode(',', $jsonArray).']');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user