Guest Posted December 1, 2007 Share Posted December 1, 2007 Someone did for sppc // We show them all // BOF Separate Pricing Per Customer --last query changed for mysql 5 compatibility if ($status_product_prices_table == true) { // original, no need to change for mysql 5 $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } else { // either retail or no need to get correct special prices -- changed for mysql 5 $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } // end else { // either retail... // EOF Separate Pricing per Customer Quote Link to comment Share on other sites More sharing options...
Kestas Posted December 7, 2007 Share Posted December 7, 2007 Hi, I needed the similar thing. You only need to modify the $listing_sql at index.php that was modified by this contrib. Find this $listing_sql = "select distinct " . $select_column_list . " p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and " . $cat_Search . ""; And replace with this $listing_sql = "select distinct " . $select_column_list . " p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, cat.categories_id as catid, cat.categories_image, catd.categories_id as catd_id , catd.categories_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " cat, " . TABLE_CATEGORIES_DESCRIPTION . " catd left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and " . $cat_Search . " and cat.categories_id = p2c.categories_id and catd.categories_id = p2c.categories_id and catd.language_id = '" . (int)$languages_id . "' "; This will add the categorie name and image. You can remove the other id's since i only used them for checking. not working for me :( got error on index.php: 1054 - Unknown column 'p.manufacturers_id' in 'on clause' select count(distinct p.products_id) as total from products_description pd, products p, categories cat, categories_description catd left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '4' and (p2c.categories_id = '50' or p2c.categories_id = '51' or p2c.categories_id = '52' or p2c.categories_id = '53' or p2c.categories_id = '21') and cat.categories_id = p2c.categories_id and catd.categories_id = p2c.categories_id and catd.language_id = '4' Quote Kestas Link to comment Share on other sites More sharing options...
djp120 Posted January 3, 2008 Share Posted January 3, 2008 Hi...Great Contribution.... One problem i'm having, when I click through to the product information page (product_info.php) and then click the back button (not the browser back button), the sub-category header does not revert back...instead the sub-category header is the product header... ..Any Ideas? Thanks, Quote Link to comment Share on other sites More sharing options...
Rachael w. Posted January 3, 2008 Author Share Posted January 3, 2008 Hi...Great Contribution.... One problem i'm having, when I click through to the product information page (product_info.php) and then click the back button (not the browser back button), the sub-category header does not revert back...instead the sub-category header is the product header... ..Any Ideas? Thanks, Can you pm me your site so I can see exactly what your experiencing? Quote Link to comment Share on other sites More sharing options...
ReavtiveMicro.com Posted February 4, 2008 Share Posted February 4, 2008 Thought someone would find this useful. I need some working Back Buttons for my new Subcategories, but could find any code out there that worked. Here's some code that works pretty well. Back Back Button v1.0 Enjoy! Henry www.ReactiveMicro.com Quote Henry ReactiveMicro.com Link to comment Share on other sites More sharing options...
itsjust Posted March 7, 2008 Share Posted March 7, 2008 Nice contribution :) . I do seem to have one problem though. The manufacturer filter dropdown does not show if i am in a category with other categories in it (ex: DVD movies) it does show if there are no more categories to go to (ex: Action). On the picture that are in the contribution this seems to work for you! Any idea why mine doesn't? thanks Quote Link to comment Share on other sites More sharing options...
itsjust Posted March 7, 2008 Share Posted March 7, 2008 I think i found the problem, but not the solution. I tried to put some products from the action category to the DVD movies category, and that made the manufacturer filter dropdown show up. But if I use the filter it only shows the products that are in the DVD movies category and not its subcategories. So the problem seems to be that the filter only search the current category and not its subcategories for manufacturer information. Any idea for a solution Quote Link to comment Share on other sites More sharing options...
Rachael w. Posted April 9, 2008 Author Share Posted April 9, 2008 It has just been brought to my attention that verison 1.01 had an error in the code which resulted in a tep-get error. This was due to some extra info I had hard coded to my test site that was added to the instructions accidentally. I've updated the instructions in Version 1.02 to avoid the tep_get error in product_listing.php. I've uploaded a full package with instructions. http://www.oscommerce.com/community/contributions,5351 Quote Link to comment Share on other sites More sharing options...
mrgreg Posted February 8, 2009 Share Posted February 8, 2009 Hi folks and thanks Racheal for the contrib... :blink: Noob question: Is anybody aware of a clever but simple way to restore (perhaps "continue to display" is a better way to put it) the 'new products module' functionality at the top category and perhpas even sub-category product display levels? Thanks Quote Link to comment Share on other sites More sharing options...
neoschaos Posted August 3, 2009 Share Posted August 3, 2009 This is exactly what i have been looking for! hours of searching... I LOVE whoever came up with his.. But i have a problem.. I already have the Show Sold Out Items installed. At http://addons.oscommerce.com/info/4884 Both that and this one want the same part of code changed in the index.php file to different things. :( I really need to use both of these for what im trying to do. But im not good with php at all. Most of it looks alien to me. Im shocked i have gotten as far as i have. Can anyone help me out with this? Somekind of work around from someone who knows way more about what they are doing than i do. I would gladly send over a few bucks via paypal for the help of whoever could solve this for me. Thanks alot for at least reading. (Fingers crossed) Quote Link to comment Share on other sites More sharing options...
Allyt Posted June 5, 2010 Share Posted June 5, 2010 Hi, I needed the similar thing. You only need to modify the $listing_sql at index.php that was modified by this contrib. Find this $listing_sql = "select distinct " . $select_column_list . " p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and " . $cat_Search . ""; And replace with this $listing_sql = "select distinct " . $select_column_list . " p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, cat.categories_id as catid, cat.categories_image, catd.categories_id as catd_id , catd.categories_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " cat, " . TABLE_CATEGORIES_DESCRIPTION . " catd left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and " . $cat_Search . " and cat.categories_id = p2c.categories_id and catd.categories_id = p2c.categories_id and catd.language_id = '" . (int)$languages_id . "' "; This will add the categorie name and image. You can remove the other id's since i only used them for checking. Sorry to join this thread so late but I hope you can help me. Is there any way to achieve the above display of products in sub categories all on one page but only show 1 product in each of the sub categories? Any help you can give me would be much appreciated. Thanks Ally Quote Link to comment Share on other sites More sharing options...
ken0306 Posted July 5, 2011 Share Posted July 5, 2011 Nice contribution, but I can't get the manufacture filter works under main category, the filter only shows under subcategory. anyone knows how to fix it? ken Quote Link to comment Share on other sites More sharing options...
Psytanium Posted March 31, 2013 Share Posted March 31, 2013 this addon works on 2.3.1 also. did someone find a solution to display the manufacturer filter? i can't believe the default OSC dont have such important feature. Thx mate! 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.