pordoeb Posted February 4, 2006 Share Posted February 4, 2006 Hi, i want to integrate the enable/disable categories contrib to work well in the Google XML Sitemap Feed by Chemo. I change the function GenerateCategorySitemap from $sql = "SELECT categories_id as cID, date_added, last_modified as last_mod FROM " . TABLE_CATEGORIES . " ORDER BY parent_id ASC, sort_order ASC, categories_id ASC"; to $sql = "SELECT categories_id as cID, date_added, last_modified as last_mod FROM " . TABLE_CATEGORIES . " where categories_status = '1' ORDER BY parent_id ASC, sort_order ASC, categories_id ASC"; and it worked well. But now i want to make changes to the function GenerateProductSitemap, not to display products from disabled categories. I change from $sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered FROM " . TABLE_PRODUCTS . " WHERE products_status='1' ORDER BY products_ordered DESC"; to $sql = "SELECT p.products_id as pID, p.products_date_added as date_added, p.products_last_modified as last_mod, p.products_ordered FROM " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " cd where p.products_status='1' and cd.categories_status = '1' ORDER BY p.products_ordered DESC"; but it doesnt work in anyway. Anyone an idea? lg pordoeb Quote Link to comment Share on other sites More sharing options...
boxtel Posted February 4, 2006 Share Posted February 4, 2006 Hi, i want to integrate the enable/disable categories contrib to work well in the Google XML Sitemap Feed by Chemo. I change the function GenerateCategorySitemap from $sql = "SELECT categories_id as cID, date_added, last_modified as last_mod FROM " . TABLE_CATEGORIES . " ORDER BY parent_id ASC, sort_order ASC, categories_id ASC"; to $sql = "SELECT categories_id as cID, date_added, last_modified as last_mod FROM " . TABLE_CATEGORIES . " where categories_status = '1' ORDER BY parent_id ASC, sort_order ASC, categories_id ASC"; and it worked well. But now i want to make changes to the function GenerateProductSitemap, not to display products from disabled categories. I change from $sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered FROM " . TABLE_PRODUCTS . " WHERE products_status='1' ORDER BY products_ordered DESC"; to $sql = "SELECT p.products_id as pID, p.products_date_added as date_added, p.products_last_modified as last_mod, p.products_ordered FROM " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " cd where p.products_status='1' and cd.categories_status = '1' ORDER BY p.products_ordered DESC"; but it doesnt work in anyway. Anyone an idea? lg pordoeb you need to add the relation table product_to_categories in there as that table connects products to their categories. Quote Treasurer MFC Link to comment Share on other sites More sharing options...
pordoeb Posted February 5, 2006 Author Share Posted February 5, 2006 you need to add the relation table product_to_categories in there as that table connects products to their categories. :blush: Thanks for the hint, now its working :) lg pordoeb Quote 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.