Forum Moderators: coopster

Message Too Old, No Replies

Random Script Help...

This is a big one...

         

Brian07002

12:47 am on Jun 9, 2005 (gmt 0)

10+ Year Member



Hi all,

I am looking for a 'pumped up version' of your average Featured Product script found on many online shops...

I want the script to rotate products (along with the associated description, title, price etc..). But I must be able to control the script so that I can choose what category images I want to be displayed through the category id. The end result would be so that I could choose what categories images would be displayed. Only I must be able to specify multiple category id's because my site has subcategories.

For example: (If it was christmas time)

The script would rotate images from my christmas category & associated subcategories that I would choose from an admin panel...

I do appreciate all help offered!

-Brian

freeflight2

1:22 am on Jun 9, 2005 (gmt 0)

10+ Year Member



the easiest way is to define a category like this:

CREATE TABLE Category (
id int,
name varchar(255)
);

CREATE TABLE Items (
category_id int,
...
);

and then you would load these categories like this:
id=1 name=/
id=2 name=/holidays/
id=3 name=/holidays/christmas/
id=4 name=/holidays/christmas/for_women/
id=5 name=/holidays/christmas/for_women/parfumes
etc.

then you can select item from a category, sub categories and even their sub categories like this:

SELECT * FROM Items as i,Category as c WHERE c.name like '/holidays/%' AND c.id=i.category_id ORDER BY RAND();

==> to get everything under '/holidays/'

SELECT * FROM Items as i,Category as c WHERE c.name like '/holidays/christmas/for_women/%' AND c.id=i.category_id ORDER BY RAND();

==> to only show items for women

Brian07002

4:40 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Hi,

Thank you for your reply. But could I ask a more detailed question regarding this? I don't want to distract you from your work, but if you have some time, the question involves a shopping cart already in place, I am trying to work from what they give...I'm 100% positive that it can be accomplished, but your way would involve me in have to create more than what is needed...But I stumped in creating it. Any help is greatly appreciated.

-Brian