Нашел в французской ветке на prestashop.com
Для того, чтобы вывести характеристики в нужном порядке перед каждой характеристикой пишем ее порядковый номер, под которым она должна быть в списке. Пример:
01.Тип
02.Вес
03.Размеры
04.Емкость
Идем в папку classes, в файле product.php, находим находим такой код(у меня 2713 строка):
Код:
public static function getProductsProperties($id_lang, $query_result)
{
$resultsArray = array();
foreach ($query_result AS $row)
if ($row2 = Product::getProductProperties($id_lang, $row))
$resultsArray[] = $row2;
return $resultsArray;
}
/*
* Select all features for a given language
*
* @param $id_lang Language id
* @return array Array with feature's data
*/
public static function getFrontFeaturesStatic($id_lang, $id_product)
{
if (!array_key_exists($id_product.'-'.$id_lang, self::$_frontFeaturesCache))
{
self::$_frontFeaturesCache[$id_product.'-'.$id_lang] = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT name, value, pf.id_feature
FROM '._DB_PREFIX_.'feature_product pf
LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.(int)$id_lang.')
WHERE pf.id_product = '.(int)$id_product);
}
return self::$_frontFeaturesCache[$id_product.'-'.$id_lang];
}
public function getFrontFeatures($id_lang)
{
return self::getFrontFeaturesStatic($id_lang, $this->id);
}
public static function getAttachmentsStatic($id_lang, $id_product)
{
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'product_attachment pa
LEFT JOIN '._DB_PREFIX_.'attachment a ON a.id_attachment = pa.id_attachment
LEFT JOIN '._DB_PREFIX_.'attachment_lang al ON (a.id_attachment = al.id_attachment AND al.id_lang = '.(int)($id_lang).')
WHERE pa.id_product = '.(int)($id_product));
}
public function getAttachments($id_lang)
{
return self::getAttachmentsStatic($id_lang, $this->id);
меняем на:
Код:
static public function getProductsProperties($id_lang, $query_result)
{
$resultsArray = array();
foreach ($query_result AS $row)
if ($row2 = Product::getProductProperties($id_lang, $row))
$resultsArray[] = $row2;
return $resultsArray;
}
/*
* Select all features for a given language
*
* @param $id_lang Language id
* @return array Array with feature's data
*/
/* MODIF ON TRIE LES CARACTERISTISQUES PERSO via 01; 02; 03, etc. */
static public function getFrontFeaturesStatic($id_lang, $id_product)
{
$result=Db::getInstance()->ExecuteS('
SELECT name, value, pf.id_feature
FROM '._DB_PREFIX_.'feature_product pf
LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.intval($id_lang).')
LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.intval($id_lang).')
WHERE pf.id_product = '.intval($id_product).' order by name');
$resultsArray = array();
foreach ($result AS $row)
{
$row['name'] = product::hideFeaturePosition($row['name']);
$resultsArray[] = $row;
}
return $resultsArray;
}
static public function hideFeaturePosition($name)
{
return preg_replace('/^[0-9]+./', '', $name);
}
/* FIN MODIF */
public function getFrontFeatures($id_lang)
{
return self::getFrontFeaturesStatic($id_lang, $this->id);
}
static public function getAttachmentsStatic($id_lang, $id_product)
{
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'product_attachment pa
LEFT JOIN '._DB_PREFIX_.'attachment a ON a.id_attachment = pa.id_attachment
LEFT JOIN '._DB_PREFIX_.'attachment_lang al ON (a.id_attachment = al.id_attachment AND al.id_lang = '.intval($id_lang).')
WHERE pa.id_product = '.intval($id_product));
}
public function getAttachments($id_lang)
{
return self::getAttachmentsStatic($id_lang, $this->id);
}