alix32 Posted January 10, 2011 Share Posted January 10, 2011 Hi, I have duplicated products accross several categories. I just installed the "Specials in Categories List" however the products show as many times as they have been duplicated. Would you know how I could fix the code so that each product would show once only? Here are the instructions I followed: Step 1: Using the Admin tool create a "Specials" category at the top level of the categories tree. Do NOT put any products in this category!!!! Make a note of the category id number. You can find this out by clicking on the Specials link and looking at the URL in your browser where it says "......index.php?cPath=xx&....." the xx is the category id. +++++++++++++++++++++++++++++++ Step 2: Open up \catalog\index.php in your editor At line 15 immediately after: require('includes/application_top.php'); add: // Flag for SPECIALS category - change this number to your specials category id number if ($cPath == 30) { change 30 to xx from your URL $AHspecials = 1; } +++++++++++++++++++++++++++++++ Step 3: at about line 186 find: } else { // show the products in a given categories immediately after } else { add: if ($AHspecials == 1) { // We show all specials $listing_sql = "select " . $select_column_list . " p.products_id, pd.short_desc, 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 s.status = '1' and p.products_id = p2c.products_id and p.products_id = s.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "'"; } else { +++++++++++++++++++++++++++++++++ Step 4: at about line 199 immediately after } } add: } +++++++++++++++++++++++++++++++++ save \catalog\index.php. Step 5: Add specials to your site by using the Admin tool "Catalog, Specials" Do NOT put any products in the Special category using "Catalog, Categories / Products" they will not show!!!! Thanks for your help!! Quote Link to comment Share on other sites More sharing options...
Par2Pro Posted June 21, 2012 Share Posted June 21, 2012 Hey Alix, Just wondering if you ever got a fix for this as I am having the same problem. Thanks in advance :) 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.