Is it possible to edit the order in which the product Features appears in the Data Sheet?
Example: In Admin I have the follow Features availble (in this order):
Height
Width
Depth
Weight
Size
Diameter
Form
Length
When I put in values for Height, Size, Diameter and Form they appear in this order in the Shop:
Size
Height
Form
Diameter
Why? And is it possible to edit this? Btw, using 1.1 Final.
Example: In Admin I have the follow Features availble (in this order):
Height
Width
Depth
Weight
Size
Diameter
Form
Length
When I put in values for Height, Size, Diameter and Form they appear in this order in the Shop:
Size
Height
Form
Diameter
Why? And is it possible to edit this? Btw, using 1.1 Final.
By the look of it (from my example above), the order of appearance of Features in the Shop is just haphazard. That seems odd, doesn't it? Is there perhaps some way of controlling this by the order in which one introduces the features in Admin? But it doesn't look like that either...
This is a quick hack to organize your features(in de same way you organize your categories):
Edit file classes/Product.php
Replace:
With:
Now your can organize your features by putting the position in front of it, followed by a dot
For example:
01.Feature1
02.Feature2
Edit file classes/Product.php
Replace:
/*
* Select all features for a given language
*
* @param $id_lang Language id
* @return array Array with feature's data
*/
static public function getFrontFeaturesStatic($id_lang, $id_product)
{
return 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));
}
With:
/*
* Select all features for a given language
*
* @param $id_lang Language id
* @return array Array with feature's data
*/
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` ASC');
/* Modify SQL result */
$resultsArray = array();
foreach ($result AS $row)
{
$row['name'] = preg_replace('/^[0-9]+\./', '', $row['name']);
$resultsArray[] = $row;
}
return $resultsArray;
}
Now your can organize your features by putting the position in front of it, followed by a dot
For example:
01.Feature1
02.Feature2
can someone help.. using this method in classes/product.php function getAttributesGroups to sort attributes and groups with '##.' prefixes, but unable to strip the numbers for display as im not familiar with this whole 'al.' syntax so i dont know what to change 'name' to to strip it
From 1266808397:
can someone help.. using this method in classes/product.php function getAttributesGroups to sort attributes and groups with '##.' prefixes, but unable to strip the numbers for display as im not familiar with this whole 'al.' syntax so i dont know what to change 'name' to to strip it
u can try this module ...
http://www.presto-ch...der.html#idTab5
it works fine ...
This way doesnt work for me ...
it works for the Categories but doesnt work in features ...
im using persian version of prestashop ...
i think the problem is caused by this but as i said i have no problem with sorting categories with this way ...
i tried english titles and persian both,
This no longer works in latest version (1.3.x)
I use:
But no luck. The numbers stay visible. Weird though as I checked with the categories and that is still using the same code (and does work ;) )
Any idea's?
I use:
/*
* Select all features for a given language
*
* @param $id_lang Language id
* @return array Array with feature's data
*/
static public function getFrontFeaturesStatic($id_lang, $id_product)
{
return 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);
}
But no luck. The numbers stay visible. Weird though as I checked with the categories and that is still using the same code (and does work ;) )
Any idea's?
Hello,
don't work for me. i use 1.3 version
The prefix appear and filter order doesn't work...
my code
help me please...
thx
don't work for me. i use 1.3 version
The prefix appear and filter order doesn't work...
my code
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` ASC');
/* Modify SQL result */
$resultsArray = array();
foreach ($result AS $row)
{
$row['name'] = preg_replace('/^[0-9]+\./', '', $row['name']);
$resultsArray[] = $row;
}
return $resultsArray;
}
help me please...
thx
I just found another discussion talking about the same problem
http://www.prestasho...aracteristiques
However, they had a better UI presentation
by using:
FRUIT.01.Appellation
FRUIT.02.Origine
FRUIT.03….
AUTO.01.Puissance fiscale
AUTO.02.Nombre de portes
AUTO.03….
into:
FRUIT
Origine
Appellation
[…]
AUTO
Puissance fiscale
Nb de portes
[…]
Can someone help? Please
http://www.prestasho...aracteristiques
However, they had a better UI presentation
by using:
FRUIT.01.Appellation
FRUIT.02.Origine
FRUIT.03….
AUTO.01.Puissance fiscale
AUTO.02.Nombre de portes
AUTO.03….
into:
FRUIT
Origine
Appellation
[…]
AUTO
Puissance fiscale
Nb de portes
[…]
Can someone help? Please
Here is the code for the 1.3 version, copy the code and replace the old one if you don't want to make mistake (don't forget to back up the old code if something goes wrong)
http://www.prestasho...racteristiques/
http://www.prestasho...racteristiques/
ChiniStore, la boutique de Produit High Tech et Gadgets de marque Chinoise (Tablette PC, MP4...)
ChiniTech, l'actualité Geek et High Tech venue de Chine
ChiniTech, l'actualité Geek et High Tech venue de Chine
From 1272017876:
This no longer works in latest version (1.3.x)
I use:
But no luck. The numbers stay visible. Weird though as I checked with the categories and that is still using the same code (and does work ;) )
Any idea's?
I use:
/*
* Select all features for a given language
*
* @param $id_lang Language id
* @return array Array with feature's data
*/
static public function getFrontFeaturesStatic($id_lang, $id_product)
{
return 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);
}
But no luck. The numbers stay visible. Weird though as I checked with the categories and that is still using the same code (and does work ;) )
Any idea's?
You didn't change all the code
return Db::getInstance()->ExecuteS(' is still there/Mats
I'm on 1.4.3 if nothing else is stated. My blog about using PrestaShop http://mohsart-prest...p.blogspot.com/ (I'm a n00b myself, so much is very basic)
NOTE! When I say "change xxx" I usually mean what is described here
My shop: http://mohsart.se
NOTE! When I say "change xxx" I usually mean what is described here
My shop: http://mohsart.se
Has anybody been able to get this to work on 1.3.2.3 or 1.3.3?
I've tried the code from this thread, as well as the code over on the French thread, and its not stripping out the numbers.
I really don't even need to have the features listed in a custom order, just listed in the order I entered them in!
Can anyone help please?
I've tried the code from this thread, as well as the code over on the French thread, and its not stripping out the numbers.
I really don't even need to have the features listed in a custom order, just listed in the order I entered them in!
Can anyone help please?
Hi,
Im using v.1.3.3 and it worked fine for me.
It is just on my localhost at the moment so I hope it doesnt change when I upload it to my main server.
Im using v.1.3.3 and it worked fine for me.
It is just on my localhost at the moment so I hope it doesnt change when I upload it to my main server.
Check out my gig on fiverr. A detailed SEO report. I will analyse your site and provide a detailed report for you to follow to improve your ranking and traffic.
http://fiverr.com/in...of-your-website
http://fiverr.com/in...of-your-website
I've managed to get this working on the front end. Has anyone managed to get the ordering to work in the BO? If so, can you share your code, please?
Hi,
I think this code will only order the front end and not it the BO. Although im not 100% on that so someone correct me if im wrong!
I think this code will only order the front end and not it the BO. Although im not 100% on that so someone correct me if im wrong!
Check out my gig on fiverr. A detailed SEO report. I will analyse your site and provide a detailed report for you to follow to improve your ranking and traffic.
http://fiverr.com/in...of-your-website
http://fiverr.com/in...of-your-website




Back to top









