dreamscape Posted February 13, 2003 Share Posted February 13, 2003 does anyone know if there is already a contrib to put entire categories on special (say 20% off) without having to do it one product at a time?? I've searched through the contribs and came up empty handed... any idea how one might implement this if there isn't a contribution? Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
gdfwilliams Posted February 13, 2003 Share Posted February 13, 2003 http://www.oscommerce.com/community/contri...ions,700/page,8 http://www.oscommerce.com/community/contri...ions,834/page,8 http://www.oscommerce.com/community/contri...ions,122/page,8 Quote Link to comment Share on other sites More sharing options...
dreamscape Posted February 13, 2003 Author Share Posted February 13, 2003 thats not even close to what I was asking Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
wizardsandwars Posted February 13, 2003 Share Posted February 13, 2003 Hey, Joshua, If you are unable to find a contribution to do this, I can give you an SQL query that can do it easily. Let me know. Quote ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
wizardsandwars Posted February 13, 2003 Share Posted February 13, 2003 OK, while I've got a quick second, here's what I was thinking. INSERT INTO specials SELECT "", products_id, products_price *.90 as specials_new_products_price, NULL, NULL, NULL, NULL, 1 as status FROM products t0, products_to_categories t1, categories_description t2 WHERE t0.products_id = t1.products_id AND t1.categories_id = t2.categories_id AND t2.categories_name = SOMETHING Of course, the 'products_price *.90' represents a 10% discount off of the regular price, and the 'SOMETHING' represents a category name. Also, this will create duplicate entries if you already have somehting in that category that is on special. The result of duplicates is that the special will show up twice. I'm sure that with very little development, this query can be put into a php script, with a dropdown for the category, and a input text box for the price. You could also automaticaly delete any specials in the table that are in that category before doing this inset. Anyway, I hope this helps. Quote ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
dreamscape Posted February 13, 2003 Author Share Posted February 13, 2003 I figured I'd probably have to come up with something myself... thanks for the head start though wizards. Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
dreamscape Posted February 14, 2003 Author Share Posted February 14, 2003 I got a dropdown box in place to select either all categories "TOP", or a specific top category or sub-category: I am having some trouble with the query though if a category is selected, with how to deal with the categories and parent categories (say I select books, there are actually no products in books in the database, but there are products in its sub categories... how to match them up)... Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
dreamscape Posted February 14, 2003 Author Share Posted February 14, 2003 the following SQL works if you are on a top level category, but not if you select a sub-category or select "top" (the entire catalog): $new_special_insert_query = tep_db_query("select p.products_id, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $HTTP_POST_VARS['cat_id'] . "'"); Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
emiliano Posted February 14, 2003 Share Posted February 14, 2003 i'm seeing the birth of a new contribution??? :D whooo hooooooo emiliano Quote patagonia, argentina Link to comment Share on other sites More sharing options...
dreamscape Posted February 14, 2003 Author Share Posted February 14, 2003 i'm seeing the birth of a new contribution??? :D whooo hooooooo emiliano maybe if I can get the SQL query worked out to where it inserts all products under a certain category... right now I can only get top level categories to work... I am still trying to figure out how to allow subcategories, and the entire catalog to work... then just a simple way to delete the specials from a category (the query here is simple, just a matter of finding a place to integrate it into the interface) frankly I am really surprised no-one has done this yet... Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
HaggisBoy Posted February 25, 2003 Share Posted February 25, 2003 thats not even close to what I was asking SORRY, SORRY, SORRY to do this but I just had to say that this is the FUNNIEST thing I have read on this forum so far!!!! LOL. Quote Link to comment Share on other sites More sharing options...
JenRed Posted May 25, 2003 Share Posted May 25, 2003 I know this is an old thread, but did anybody work this out? ie. what is the SQL query for sub-categories? thanks Jen Quote I haven't lost my mind - I have it backed up on disk somewhere. Link to comment Share on other sites More sharing options...
Guest Posted May 25, 2003 Share Posted May 25, 2003 there's a contib to set prices by category - should give you a clue 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.
Note: Your post will require moderator approval before it will be visible.