Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

making a manufacturers inactive


211655

Recommended Posts

please backup your mysql database and all of the files before making any changes

 

you could add a field to the productss table in the database and call it 'allow' make it int(1) so it is either a 1 or a 0

 

the idea would be to check this on(1) or off(0) to display / not display

id make 1 the default! - else you will have lots of changing to do later

 

then you would need to edit the displaying of the products so they do not display products that have allow = 0(index.php)

 

these lines i believe (need to edit the where clauses and the select clauses)

red stuff is changed from my code-please fit it into your code do not paste all of this code as i have modified mine to suit my site....but they should be very similar

 

 

----START CODE

 

// We are asked to show only a specific category

 

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, .products_price1,p.products_price2,p.products_price3,p.products_price4,p.product

s_price1_qty,p.products_price2,p.products_price3_qty,p.products_price4_qty,p.prod

ucts_qty_blocks, p.products_tax_class_id, p.allow 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 . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p.allow = '" . (int)1 . "'"; } else {

 

// We show them all

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, .products_price1,p.products_price2,p.products_price3,p.products_price4,p.product

s_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_price4_qty,p.

products_qty_blocks, p.products_tax_class_id, p.allow IF(s.status, .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 . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.allow = '" . (int)1 . "'";

}

 

----END CODE

 

You then have to replicate this code on the other similar queries below... but pasting examples of them here would take up tons of space and you just need to add the same bits as above.

 

there are four in total i believe including the two above and they are all pretty similar with one or two slight differences.

 

once you have done that then you need to change the info in the database to decide which products are shown and which are not. its up to you how you do this but i guess the simplest way would be to run a mysql query when you need to show/hide products from a certain manufacturer.

 

update products set allow = '0' where manufacturers_id = 'm/f_id_here';

 

thats it run that when you need it and it should work

or you could create an admin function for this but it seems like a waste of time if you are doing it only a few times per year.

 

any probs let me know...

always here to offer some useless advice....

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...