You are here:  » Once again the categories


Once again the categories

Submitted by Peter on Fri, 2006-10-13 13:29 in

Yes i know, it´s an old topic, but...

i read the treads an i thought to myself following.

If i made new SQL Tables for each Top-Category for example:
Computer
Health and Beauty
Erotic
...

Then i can search by category, like your code in another tread. But it´s only possible to search by the Top-Categories.

So, now my idea:
If i had in my "normal" database for example:

Computer > Mouse
Computer > Keybord
Computer > Others > Printer

Isn´t it possible to search by category with "WHERE"

I don´t know the code exactly:

$sql = 'SELECT * FROM `products` WHERE `name` LIKE CONVERT(_utf8 \'NAME VARIABLE HERE\' USING latin1) COLLATE latin1_swedish_ci AND `category` = CONVERT(_utf8 \'CATEGOROY VARIABLE HERE\' USING latin1) COLLATE latin1_swedish_ci';

Then in a drop down field spezified the categories.

I tried this directly in MySQL and it works. It´s also possible to use the LIKE Variable for 'category' but it takes a long time to search.

I only know the code to search in MySQL, but i don´t know how to script a search field :)

Thanks for your help David

Submitted by Peter on Sun, 2006-10-15 11:56

Hello David,

i see that you answer the other questions. Thats why i think you didn´t read my post and i write again.

Thank you, Peter

Submitted by support on Sun, 2006-10-15 12:02

Hello Peter,

It should be possible to do something, but first of all, how do you want to import your top level categories when you import a feed? Are you going to specifiy a single top level category for each feed?

Cheers,
David.

Submitted by Peter on Sun, 2006-10-15 14:54

Thanks David for your fast answer.

I change the categories after the feed import. Eighter with category mapping, or with the 'setcat.php' where i can change the category name for each product.
If the merchant have no different product categories, the top level categoroy will import with the feed.

So i think the best way is to make a new table for top level category and this will filled with the feed. I know this is not easy, but in this case the users can search by the merchant categories as before and by top level category as new.

Sorry for my bad english. I hope you understand what i mean.

Thank you, Peter

Submitted by support on Sun, 2006-10-15 19:55

Hello Peter,

Are you aware that a search string can be formatted as follows:

category:Electronics:Foo

This will search for all products matching "Foo" with the category "Electronics". For example, a link to the Price Tapestry demo site:

PCMCIA Accessories

Would you like to create a drop down box on the search form where the user can select the category?

That can be done, the code is very similar to this code for selecting the merchant:

http://www.pricetapestry.com/node/573

I can modify that for category if that is what you want to do....

Apologies if I have misunderstood you...

Cheers,
David.

Submitted by Peter on Sun, 2006-10-15 22:09

Hello David,

this code for merchant is wat i whant for category.

But is it possible to register the feeds with two different categories?
One for the merchant categories and
one for my own categories
I mean:
A new table in MySQL
and
a new field in register_step2.php (my category)- this i will show on my site with a link like the normal category.
---------
If this is to tricky, i do it with the option "Extras", but then the question... Can i link this as the normal categories?
I mean:
The feed (.CSV) looks like:
Name
Description
IMG
Deeplink
Price
MyCategory
MerchantCategory
Brand

Then i register the feed, without merchant category.
After that i use the option "Extras" and make a description field for the merchant category and import it again.

But this new description field should be a link like MyCategory. If a user click on this link, all products in this category should be shown.
I don´t need a extra page for the categories, i only whant to link it.

I hope you understand what i mean :)

thanks, peter
MyCategory