Jump to content
Sign in to follow this  
dreamscape

Group / Category Specials

Recommended Posts

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?


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites

thats not even close to what I was asking


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites

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.


-------------------------------------------------------------------------------------------------------------------------

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.

Share this post


Link to post
Share on other sites

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.


-------------------------------------------------------------------------------------------------------------------------

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.

Share this post


Link to post
Share on other sites

I figured I'd probably have to come up with something myself... thanks for the head start though wizards.


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites

I got a dropdown box in place to select either all categories "TOP", or a specific top category or sub-category:

drop_down_box.jpg

 

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)...


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites

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'] . "'");


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites

i'm seeing the birth of a new contribution??? :D whooo hooooooo

 

emiliano


patagonia, argentina

Share this post


Link to post
Share on other sites
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...


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

I know this is an old thread, but did anybody work this out?

 

ie. what is the SQL query for sub-categories?

 

thanks

 

Jen


I haven't lost my mind - I have it backed up on disk somewhere.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×