enhbat Posted January 31, 2003 Share Posted January 31, 2003 In cieto Featured Products 1.5, featured products don't belong to their categories. I selected few products as "featured" from one category, but these products appear in all top-level and sub category's "featured products" box. How do I solve this problem? My site is at http://www.msm.mn Quote Link to comment Share on other sites More sharing options...
dreamscape Posted January 31, 2003 Share Posted January 31, 2003 does anyone know what happened to Emiliano?? awhile back I pointed out quite a few issues with v1.5 and helped him solve them too... he said in a couple days he'd issue an update with all he fixes/enhancements we came up with... he never did and I haven't seen him since. if no one knows what happened to him, do u think it'd be OK if I put the updated version up? Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
emiliano Posted February 2, 2003 Share Posted February 2, 2003 after many time i'm here again.. could you send me your code? so i could add it to the new version of the contribution (files are cleaner now...) cheers emiliano Quote patagonia, argentina Link to comment Share on other sites More sharing options...
dreamscape Posted February 2, 2003 Share Posted February 2, 2003 hey emiliano... good to see you back... I posted the fix for the specials price here: http://www.oscommerce.com/forums/viewtopic.php...atured+products also we posted alot of the fixes in this thread: http://www.oscommerce.com/forums/viewtopic.php...atured+products the categories fix was never posted... let me look a second here and see what I did to fix it. Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
dreamscape Posted February 2, 2003 Share Posted February 2, 2003 emiliano, this is my catalog/modules/featured.php file. it contains the categories fix. but it doesn't pull the short descriptions since I am using part of the normal description... I would put it back in, but I am not good with SQL queries across multiple tables. catalog/modules/featured.php <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License Featured Products Listing */ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FEATURED); if(FEATURED_PRODUCTS_DISPLAY == true) { ?> <!-- body //--> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeadingSub">Featured Products</td> </tr> <tr> <td> <?php $featured_products_category_id = $new_products_category_id; if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) { // We are not in category depth; we are on the main page $featured_products_query_raw = "select p.products_id, pd.products_name, pd.products_shortdescription, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS; //and f.status = '1' } else { // We are in category depth; pull the featured from the category by random $featured_products_query_raw = "select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS; //and f.status = '1' } $featured_products_query = tep_db_query($featured_products_query_raw); while ($featured_products = tep_db_fetch_array($featured_products_query)) { $featured_products['products_name'] = tep_get_products_name($featured_products['products_id']); $featured_products['products_description'] = tep_get_products_description($featured_products['products_id']); $featured_products_array[] = array('id' => $featured_products['products_id'], 'name' => $featured_products['products_name'], 'description' => $featured_products['products_description'], 'image' => $featured_products['products_image'], 'price' => $featured_products['products_price'], 'specials_price' => $featured_products['specials_new_products_price'], 'tax_class_id' => $featured_products['products_tax_class_id'], 'manufacturer' => $featured_products['manufacturers_name']); } require(DIR_WS_MODULES . FILENAME_FEATURED_PRODUCTS); ?> </td> </tr> </table> <?php } else // If it's disabled, then include the original New Products box { include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); } ?> Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
dreamscape Posted February 2, 2003 Share Posted February 2, 2003 well there were a couple errors in above... and I put the short descriptions back in incase I would want to use them in the future... here is the correct /catalog/includes/modules/featured.php <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License Featured Products Listing */ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FEATURED); if(FEATURED_PRODUCTS_DISPLAY == true) { ?> <!-- body //--> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeadingSub">Featured Products</td> </tr> <tr> <td> <?php $featured_products_category_id = $new_products_category_id; if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) { // We are not in category depth; we are on the main page $featured_products_query_raw = "select p.products_id, pd.products_name, pd.products_description, pd.products_shortdescription, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS; //and f.status = '1' } else { // We are in category depth; pull the featured from the category by random $featured_products_query_raw = "select distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_shortdescription, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS; //and f.status = '1' } $featured_products_query = tep_db_query($featured_products_query_raw); while ($featured_products = tep_db_fetch_array($featured_products_query)) { // $featured_products['products_name'] = tep_get_products_name($featured_products['products_id']); // $featured_products['products_description'] = tep_get_products_description($featured_products['products_id']); $featured_products_array[] = array('id' => $featured_products['products_id'], 'name' => $featured_products['products_name'], 'description' => $featured_products['products_description'], 'shortdescription' => $featured_products['products_shortdescription'], 'image' => $featured_products['products_image'], 'price' => $featured_products['products_price'], 'specials_price' => $featured_products['specials_new_products_price'], 'tax_class_id' => $featured_products['products_tax_class_id'], 'manufacturer' => $featured_products['manufacturers_name']); } require(DIR_WS_MODULES . FILENAME_FEATURED_PRODUCTS); ?> </td> </tr> </table> <?php } else // If it's disabled, then include the original New Products box { include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); } ?> Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
xmlrookie Posted February 2, 2003 Share Posted February 2, 2003 how do you make it align in column style? Quote Link to comment Share on other sites More sharing options...
dreamscape Posted February 2, 2003 Share Posted February 2, 2003 how do you make it align in column style? use the other featured products contribution (just called featured products v1.3 I think)... it shows them in columns... this one uses only one per row b/c it also shows decriptions with the items... would be kinda crowded to do a column like layout with it. Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
xmlrookie Posted February 2, 2003 Share Posted February 2, 2003 how do you make featured products box looks like this http://www.quicklyshop.com/shop/default.php thanks Quote Link to comment Share on other sites More sharing options...
CC Posted February 2, 2003 Share Posted February 2, 2003 Thats just all done in html. Just recreate the features.php page in /modules and add the html for it. CC. Quote Link to comment Share on other sites More sharing options...
emiliano Posted February 2, 2003 Share Posted February 2, 2003 working on it.. :idea: emiliano Quote patagonia, argentina Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.