sbmk1957 Posted November 20, 2012 Posted November 20, 2012 Hi all I have seen a few posts on this but no solution ... running 2.3.3 and 95% of the producting listings show the size attribute correclty ...and 5% dont which is pretty annoying. products_attributes DB have them in acsending order although not neccessarliy consecutive ... tried deleting and redoing a few still not correct. If i had some hair i would pull it out. any ideas ? Thanks in advance Steve
Guest Posted November 20, 2012 Posted November 20, 2012 DUPLICATE POST. SEE YOUR OTHER POST AND CROSS POSTING IS NOT PERMITTED IN THIS FORUM
sbmk1957 Posted November 20, 2012 Author Posted November 20, 2012 sorry ... i cant see the first one after 30 minutes and thought i had screwed up ... and i still cant see it
sbmk1957 Posted November 20, 2012 Author Posted November 20, 2012 :Can someone post a link to the other post ... i cant see it at all :( steve
MrPhil Posted November 20, 2012 Posted November 20, 2012 You posted it in 3.x Support. http://www.oscommerce.com/forums/topic/390354-attributes-sort-order/ If you click on your name at the upper right, and then on "My Content", you'll see all your posts. As this would be the right place for 2.3 support... can you give an example of the problem?
sbmk1957 Posted November 20, 2012 Author Posted November 20, 2012 hi sorry ... damn noobies cant do anything right can we.. click me if you do a search on 1170 ... it shows size option 200*300 first .. next one the same.. next one the different again ... then the rest of that catergory is correct (160*230 then 200*300 then 240*330) cant see whats wrong anywhere or how to fix it :( Thanks for looking Steve
MrPhil Posted November 20, 2012 Posted November 20, 2012 A "*" is not numeric, of course, so the sort would be strictly alphabetical. Is there any evidence that it's sorting strictly on alphabetical order? Or not sorting at all (accidental order)? In alphabetical order, "1000" would come before "200", while in numerical order, it would be reversed.
sbmk1957 Posted November 20, 2012 Author Posted November 20, 2012 Hi.. and thanks for the respsonse in products_info.php there is this $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); im a noob and dont understand these calls - but it seems the product attribute(size has 5 variations in my case) ..and its being sorted by the name of the attribute...not the variables contained in that attribute. seems like having a list of different brands of cars under the heading cars... and sort it by the heading cars... not a lot will happen :-/ I think i need to call from table Product_Options_Values ... product_options_vales_name and sort on that .. . i think thats what needs to be done ... now if i only knew how to do it ! Steve
MrPhil Posted November 21, 2012 Posted November 21, 2012 I haven't used product options, but from reading the code in product_info.php it appears to do this: Heading "Available Options" loop through product options names (the query you printed) for each product option name (e.g., "color" or "size") alphabetically sorted loop through product option values for this name UNSORTED output the name and value sets It would appear that the second (inner) loop for the values within a product name are unsorted. Find this code: $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); try adding a sort: $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pov.products_options_values_name"); This will sort alphabetically, not necessarily numerically.
sbmk1957 Posted November 21, 2012 Author Posted November 21, 2012 You, Sir, are worth more money :-) thats done the trick .. Thanks so much for taking the time to help out Steve
MrPhil Posted November 21, 2012 Posted November 21, 2012 Yeah, that's what I keep telling my boss... glad it worked!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.