Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Specials in Categories List


alix32
 Share

Recommended Posts

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!!

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...