Rod Posted October 19, 2009 Share Posted October 19, 2009 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 creatBBS-->value is 453---second creatTTK-->value is 456---third creatAAC-->value is 543--fourth creatWhen I update,they will show as following:TTK: 456SST:345BBS:453AAC:543But I like it to array who creat first and who show first. as SST: 345:BBS:453TTK:456AAC:543I am not English,hope you can understand what I say :-( Link to comment Share on other sites More sharing options...
soju Posted October 19, 2009 Share Posted October 19, 2009 HiYou 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 More sharing options...
Rod Posted October 21, 2009 Author Share Posted October 21, 2009 Hi thanks,i modify the function as following,but it do not workstatic 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 More sharing options...
soju Posted October 21, 2009 Share Posted October 21, 2009 It should work.Check ps_feature/ps_feature_lang tables to see if features are in the right order (sst, bbs, ttk, aac). Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now