You are here:  » adding new field

Support Forum



adding new field

Submitted by Raxstar on Sat, 2011-04-30 11:24 in

hi dave

I want to add a new field "sub-category" which i have available in a particular feed, and i want it to display that information on sidebar filter results as "by type" instead of "by category" in list form. so when i click a particular category the product page displays all the products and in the sidebar filter results should appear like this

By merchant:

By Type:

By brand:

By price:

i have read the topic http://www.pricetapestry.com/node/3094 in which the first step is to create two new field using dbmod.php. In the above case i don't know how many new field should i create. can you please help me.

cheers
raxstar

Submitted by support on Sun, 2011-05-01 09:46

Hi raxstar,

It sounds like you only need to add one new field - e.g. subcategory (I would suggest type but it may cause MySQL reserved word conflict) - so your dbmod.php will add field_subcategory to the feeds table and subcategory to the products table.

Once that's in place, then it would simply be a case of changing the title "By Category" to "By Type" in your sidebar filter code (html/searchresults.php) and replacing each instance of "category" with "subcategory", and that should do the trick..

Cheers,
David.
--
PriceTapestry.com

Submitted by Raxstar on Sun, 2011-05-01 14:12

hi

i understand the above concept but i would like to know what function does "By Category" in search result
filter mod actually do. Does it shows other related categories.

cheers
Raxster

Submitted by support on Sun, 2011-05-01 15:31

Hi Raxster,

Not related categories, it acts purely as a filter; so by selecting one you can narrow down your result to the selected category...

Cheers,
David.
--
PriceTapestry.com

Submitted by Raxstar on Sun, 2011-05-01 17:41

I have two field in my datafeed

1. Category_name
2. sub_category

the first one is generally used for category field and i also wanted to add new field "sub_category". I
want to use the information from sub_category at sidebar search filter in "by category" mod.

for eg
category_name = carparts
sub_category = engine parts, cylinder head, oil pump, brake parts

I do the necessary changes in the .csv datafeed to make sure that all the sub_categories have related category
name.

so when i click the category_name in the side bar filter it should show the related sub-categories
to narrow down to desired selection. This method is useful in niche price comparison websites

can you please tell me how to go about it.

thanks
raxstar

Submitted by support on Sun, 2011-05-01 17:52

Hi raxstar,

There are quite a few steps towards this, first of all, please follow the instructions above regarding adding the subcategory field to your site. Once this is in place if you could email me your current config.advanced.php, search.php and html/searchresults.php i'll look into the code for you.

Please note that I only have limited Internet access this Bank Holiday weekend but I will be back in the office as normal first thing Tuesday AM.

Cheers,
David.
--
PriceTapestry.com

Submitted by Raxstar on Mon, 2011-05-02 08:49

hi dave

I have emailed the files

cheers
Raxstar