Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can I show only one manufacturer on index.php ?


petercascio

Recommended Posts

Ok, answering your question, try doing the following:

 

backup (very important to restore it later) the /catalog/includes/boxes/manufacturers.php

 

Now, locate this code (most likely to be the very first line of code):

 

$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");

 

and replace it with:

 

$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = ****ID**** order by manufacturers_name");

 

Replace the ****ID**** with the id of the only manufacturer you would like to show.

 

I hope this work... feedback is strongly appreciated.

 

Best,

Hey!!... I still need help with this http://www.oscommerce.com/forums/index.php?showtopic=309208. Please, take a look on it.

Link to comment
Share on other sites

Ok.

 

Backup and open your cataog/includes/modules/new_products.php

 

Around Line 21 Find :

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { 

 

The next line should be something like the following:

 

 $new_products_query = tep_db_query(" THIS IS THE SELECT STATEMENT");  

 

So THIS IS THE SELECT STATEMENT is what you want to modify. As long as I have modified this earlier, I cannot post my own select statement, because would not be of any help. But try to do the following (not so elegant, but easy to do):

 

1. Add a WHERE condition

 

Find the "where" inside the sql query. You probably have something like:

 

 $new_products_query = tep_db_query(" [....] where products_status = '1' [....]");  

 

Introduce somewhere inside the conditions of the sql query: and p.manufacturers_id = *****ID*****

Maybe you want to do it this way:

 

 $new_products_query = tep_db_query(" [....] where products_status = '1' and p.manufacturers_id = *****ID***** [....]");  

 

That should be ok.

 

Let me know if it worked.

 

Regards,

Hey!!... I still need help with this http://www.oscommerce.com/forums/index.php?showtopic=309208. Please, take a look on it.

Link to comment
Share on other sites

Ok.

 

Backup and open your cataog/includes/modules/new_products.php

 

Around Line 21 Find :

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { 

 

The next line should be something like the following:

 

 $new_products_query = tep_db_query(" THIS IS THE SELECT STATEMENT");  

 

So THIS IS THE SELECT STATEMENT is what you want to modify. As long as I have modified this earlier, I cannot post my own select statement, because would not be of any help. But try to do the following (not so elegant, but easy to do):

 

1. Add a WHERE condition

 

Find the "where" inside the sql query. You probably have something like:

 

 $new_products_query = tep_db_query(" [....] where products_status = '1' [....]");  

 

Introduce somewhere inside the conditions of the sql query: and p.manufacturers_id = *****ID*****

Maybe you want to do it this way:

 

 $new_products_query = tep_db_query(" [....] where products_status = '1' and p.manufacturers_id = *****ID***** [....]");  

 

That should be ok.

 

Let me know if it worked.

 

Regards,

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...