Jump to content

Feature problem


Recommended Posts

Hi teams, thanks for your hard working. Now I have a question,and do not know how to solve this.Can you please help me.

For example,I creat following features:
SST-->value is 345---first creat
BBS-->value is 453---second creat
TTK-->value is 456---third creat
AAC-->value is 543--fourth creat

When I update,they will show as following:
TTK: 456
SST:345
BBS:453
AAC:543

But I like it to array who creat first and who show first. as
SST: 345:
BBS:453
TTK:456
AAC:543

I am not English,hope you can understand what I say :-(

Link to comment
Share on other sites

Hi

You can reorder features table on you mysql server :
ALTER TABLE `ps_feature` ORDER BY `id_feature`
ALTER TABLE `ps_feature_product` ORDER BY `id_feature`

Or modify function getFrontFeaturesStatic in classes/product.php

Link to comment
Share on other sites

Hi thanks,i modify the function as following,but it do not work

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).');
}

to following:

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 pf.id_feature');
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...