Datafeedr Support Forums

Datafeedr Support Forums (http://www.datafeedr.com/forums/index.php)
-   Tips, Tricks & Tutorials (http://www.datafeedr.com/forums/forumdisplay.php?f=66)
-   -   Creating filters that do the work of categories (http://www.datafeedr.com/forums/showthread.php?t=3853)

Eric February 3rd, 2011 03:19 PM

Creating filters that do the work of categories
 
I've noticed a lot of members creating categories that do the work of filters. Below is an example of what I mean where each line is its own category:

Sunglasses
-- Brand
---- Frogskins
---- Oakley
---- Ray Ban

Sunglasses
-- Price Range
---- $50 - $75
---- $75 - $100
---- $100 - $200

Sunglasses
-- Merchant
---- REI
---- Sunglass Hut
---- Zappos

Sunglasses
-- Color
---- Black
---- Green
---- Blue


In this example Brand, Price, Merchant and Color are all categories but are being used as category filters for the parent category Sunglasses.

So what's the big deal? It's only 20 categories... But consider this real example borrowed with permission from a Datafeedr member:

Sunglasses
-- Mens
---- Antix
---- Conduct
---- Crosshair
---- Dispatch
---- Fives
---- Flak Jacket
---- Frogskins
---- Flak Jacket XLJ
---- Fuel Cell
---- Gascan
---- Half Jacket
---- Half Wire
---- Hijinx
---- Holbrook
---- Ice Pick
---- Inmate
---- Jawbone
---- Juliet
---- Jupiter
---- M Frame
---- Minute
---- Monster Dog
---- Nanowire
---- O Rokr Pro
---- Oil Drum
---- Oil Rig
---- Pit Boss
---- Probation
---- Radar
---- Scalpel
---- Sideways
---- Splinter
---- Split Jacket
---- Straight Jacket
---- Thump
---- Tightrope
---- Water Jacket
---- Whisker
---- X-Squared
-- Ladies
---- Commit
---- Abandon
---- Compulsive
---- Correspondent
---- Cover Story
---- Dangerous
---- Deception
---- Discreet
---- Embrace
---- Encounter
---- Enduring
---- Forsake
---- Hinder
---- Impatient
---- Liv
---- Radar
---- Ravishing
---- Restless
---- Taken
---- Trouble


That's 59 categories more than actually needed to be created.

So why is it not a good idea to use categories as filters?

1. It involves lots of duplicate work, creating hundreds of categories and performing just as many searches. Not to mention inputting category titles, descriptions and meta info.

2. But maybe more importantly, it's very hard to maintain. If a merchant modifies their product information just a little, you might end up with too many products you don't want in your categories or with no products at all. If you've created a category for every filter, you would have to edit every single saved search. Ugh!

My proposed solution is to use filters instead of categories. Let's take the 62 category example I mentioned above. In that case, I would have 3 categories and handle the rest of the organization in filters.

Here's how my categories would be structured:

Sunglasses
-- Men's
-- Women's


That's it! Let me show you how to do this.

Step 1

Create the 3 categories and add products to the Men's and Women's categories.





Step 2

Next we are going to create 2 different brand filter widgets. I'm creating 2 different brand filters because I'm guessing that some brands are only for women and some brands are only for men. Plus, it's a useful thing to learn for building other filters.

Go to The Factory > Your Store > VIEWS > WIDGETS > Add a new view

In the new view pop-up box, fill it in like this:



Step 3

Once you've created the new view, you will add a Text module to the view and fill it in with your brands. Here's what my Men's sunglasses brands might be:

HTML Code:

<ul>
<?php if (@$_GET['brand']) { ?>

  <li><a href="[server.url type='fullpage' query='-brand']">[X] Remove brand filter</a></li>

<?php } else { ?>

  <li><a href="[server.url type='fullpage' query='brand=Airlock']">Airlock</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Arnette']">Arnette</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Bolle']">Bolle</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Calvin Klein']">Calvin Klein</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Carrera']">Carrera</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Diesel']">Diesel</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Emporio Armani']">Emporio Armani</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Fatheadz']">Fatheadz</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Giorgio Armani']">Giorgio Armani</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Guess']">Guess</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Gunnar']">Gunnar</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Harley Davidson']">Harley Davidson</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Hugo Boss']">Hugo Boss</a></li>
  <li><a href="[server.url type='fullpage' query='brand=IronMan']">IronMan</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Liberty Sport']">Liberty Sport</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Nautica']">Nautica</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Nike']">Nike</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Oakley']">Oakley</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Prada']">Prada</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Ray-Ban']">Ray-Ban</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Silhouette']">Silhouette</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Skechers']">Skechers</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Smith']">Smith</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Spy']">Spy</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Tag Heuer']">Tag Heuer</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Versace']">Versace</a></li>

<?php } ?>
</ul>

What's the PHP for? Basically, the PHP allows us to see if a brand has already been selected and gives the user an option to "unselect" the brand. Otherwise, once the brand is selected, it's hard to unselect it.

Step 4

Now let's set up the Women's brand filter like this:



Step 5

And paste in the brands for women:

HTML Code:

<ul>
<?php if (@$_GET['brand']) { ?>

  <li><a href="[server.url type='fullpage' query='-brand']">[X] Remove brand filter</a></li>

<?php } else { ?>

  <li><a href="[server.url type='fullpage' query='brand=Anne Klein']">Anne Klein</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Baby Phat']">Baby Phat</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Banana Republic']">Banana Republic</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Benetton']">Benetton</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Bulgari']">Bulgari</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Calvin Klein']">Calvin Klein</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Carrera']">Carrera</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Christian Dior']">Christian Dior</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Dior']">Dior</a></li>
  <li><a href="[server.url type='fullpage' query='brand=DKNY']">DKNY</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Dolce %26 Gabbana']">Dolce &amp; Gabbana</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Fossil']">Fossil</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Hugo Boss']">Hugo Boss</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Modo']">Modo</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Phat Farm']">Phat Farm</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Rodeo']">Rodeo</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Tom Ford']">Tom Ford</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Yves Saint Laurent']">Yves Saint Laurent</a></li>

<?php } ?>
</ul>

One thing to notice here is the Dolce & Gabbana brand. Here we have a special character in the name so we need to escape it by using query='brand=Dolce %26 Gabbana'. That will prevent the ampersand from acting as a parameter separator.

Step 6

Just for fun, I'm going to add a few more filters to really make the navigation powerful. In the following steps, I will add a price filter, merchant filter, keyword (in this case color) filter and a tags (in this case feature) filter.

A picture is worth a 1,000 words and with that... here are some screenshots to show you how I've set up those filters:











Step 7

Now, the last step we need to take is hide the new filters on all pages except on category pages. Additionally, we need to only show men's brands in the Men's category and women's brands in the Women's category. To do all of this hiding and showing, I will use the Widget Context plugin: http://wordpress.org/extend/plugins/widget-context/ You should install this plugin.

Step 8

Once you've updated your store on your blog so that the new views information is available and you've installed and activated Widget Context, you'll need to go to Appearance > Widgets and add the following Datafeedr widgets to your sidebar:
  • Categories
  • Feature Filter
  • Price Filter
  • Merchant Filter
  • Color Filter
  • Men Sunglasses Brand Filter
  • Women Sunglasses Brand Filter

Step 9

Now you need to configure the widget contexts.

Categories - Display on all pages.
Feature Filter, Price Filter, Merchant Filter & Color Filter - "Show on selected" and paste the appropriate URLs into the textarea. Here's an example of the merchant filter:



Men Sunglasses Brand Filter - "Show on selected" and only the men's category URL
Women Sunglasses Brand Filter - "Show on selected" and only the women's category URL



Step 10

Now we need to take care of our <head> info. In this example, I'm going to tweak the <title> tags based on the query string.



In the <head> area I will do something like this for the title:



Basically, it says if a filter has been chosen, display its information in the title. Here's the code for that:

HTML Code:

<title>
  [store.if word="on"][store.get param="word"] | [/store.if]
  [store.if tags="on"][store.get param="tags"] | [/store.if]
  [store.if price="on"]Price is [store.get param="price"] | [/store.if]
  [store.if brand="on"][store.get param="brand"] | [/store.if]
  [store.if merchant="on"][store.get param="merchant"] | [/store.if]
  [category.name] |
</title>
<meta name="description" content="[category.description]" />
<meta name="keywords" content="[category.keywords]" />

Step 11

Now, let's fix the title of the category that appears on the page:



In the template area, I will do something like this:



It's just a modification of what I used in the <title> tags above. Here's the code I used:

HTML Code:

<h2> 
  [category.name]
  [store.if brand="on"] by [store.get param="brand"][/store.if]
  [store.if merchant="on"] sold by [store.get param="merchant"][/store.if]
  [store.if price="on"] priced [store.get param="price"][/store.if]
</h2>

Step 12

Now that we've modified a view, update your store and let's check it out!

STORE HOMEPAGE



PARENT CATEGORY PAGE



MEN'S CATEGORY



WITH BRAND SELECTED



WITH BRAND & COLOR SELECTED



WITH BRAND, COLOR & PRICE SELECTED



WITH BRAND, COLOR, PRICE & MERCHANT SELECTED



WOMEN'S CATEGORY WITH FEATURE & PRICE SELECTED



Hope this helps speed up your store creation!

Eric

Eric February 3rd, 2011 03:26 PM

Here are the code snippets I used in my views:

Price Filter Widget:

HTML Code:

<ul>
<?php if (@$_GET['price']) { ?>

  <li><a href="[server.url type='fullpage' query='-price']">[X] Remove price filter</a></li>

<?php } else { ?>

  <li><a href="[server.url type='fullpage' query='price=-150']">Less than 150</a></li>
  <li><a href="[server.url type='fullpage' query='price=150-300']">150 ~ 300</a></li>
  <li><a href="[server.url type='fullpage' query='price=300-550']">300 ~ 550</a></li>
  <li><a href="[server.url type='fullpage' query='price=550-']">More than 550</a></li>

<?php } ?>
</ul>

Merchant Filter Widget:

HTML Code:

<ul>
<?php if (@$_GET['merchant']) { ?>

  <li><a href="[server.url type='fullpage' query='-merchant']">[X] Remove merchant filter</a></li>

<?php } else { ?>

  <li><a href="[server.url type='fullpage' query='merchant=FramesDirect.com']">FramesDirect.com</a></li>
  <li><a href="[server.url type='fullpage' query='merchant=John Lewis Partnership PLC']">John Lewis Partnership PLC</a></li>
  <li><a href="[server.url type='fullpage' query='merchant=SunglassesUK.com']">SunglassesUK.com</a></li>

<?php } ?>
</ul>

Color Filter Widget:

HTML Code:

<ul>
<?php if (@$_GET['word']) { ?>

  <li><a href="[server.url type='fullpage' query='-word']">[X] Remove color filter</a></li>

<?php } else { ?>

  <li><a href="[server.url type='fullpage' query='word=Black']">Black</a></li>
  <li><a href="[server.url type='fullpage' query='word=Blue']">Blue</a></li>
  <li><a href="[server.url type='fullpage' query='word=Silver']">Silver</a></li>

<?php } ?>
</ul>

Feature Filter Widget:

HTML Code:

<ul>
<?php if (@$_GET['tags']) { ?>

  <li><a href="[server.url type='fullpage' query='-tags']">[X] Remove feature filter</a></li>

<?php } else { ?>

  <li><a href="[server.url type='fullpage' query='tags=eyeglasses']">Eyeglasses</a></li>
  <li><a href="[server.url type='fullpage' query='tags=prescription']">Prescription</a></li>
  <li><a href="[server.url type='fullpage' query='tags=sport']">Sport</a></li>

<?php } ?>
</ul>

Men Sunglasses Brand Filter Widget

HTML Code:

<ul>
<?php if (@$_GET['brand']) { ?>

  <li><a href="[server.url type='fullpage' query='-brand']">[X] Remove brand filter</a></li>

<?php } else { ?>

  <li><a href="[server.url type='fullpage' query='brand=Airlock']">Airlock</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Arnette']">Arnette</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Bolle']">Bolle</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Calvin Klein']">Calvin Klein</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Carrera']">Carrera</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Diesel']">Diesel</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Emporio Armani']">Emporio Armani</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Fatheadz']">Fatheadz</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Giorgio Armani']">Giorgio Armani</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Guess']">Guess</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Gunnar']">Gunnar</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Harley Davidson']">Harley Davidson</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Hugo Boss']">Hugo Boss</a></li>
  <li><a href="[server.url type='fullpage' query='brand=IronMan']">IronMan</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Liberty Sport']">Liberty Sport</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Nautica']">Nautica</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Nike']">Nike</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Oakley']">Oakley</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Prada']">Prada</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Ray-Ban']">Ray-Ban</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Silhouette']">Silhouette</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Skechers']">Skechers</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Smith']">Smith</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Spy']">Spy</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Tag Heuer']">Tag Heuer</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Versace']">Versace</a></li>

<?php } ?>
</ul>

Women Sunglasses Brand Filter Widget:

HTML Code:

<ul>
<?php if (@$_GET['brand']) { ?>

  <li><a href="[server.url type='fullpage' query='-brand']">[X] Remove brand filter</a></li>

<?php } else { ?>

  <li><a href="[server.url type='fullpage' query='brand=Anne Klein']">Anne Klein</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Baby Phat']">Baby Phat</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Banana Republic']">Banana Republic</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Benetton']">Benetton</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Bulgari']">Bulgari</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Calvin Klein']">Calvin Klein</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Carrera']">Carrera</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Christian Dior']">Christian Dior</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Dior']">Dior</a></li>
  <li><a href="[server.url type='fullpage' query='brand=DKNY']">DKNY</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Dolce %26 Gabbana']">Dolce &amp; Gabbana</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Fossil']">Fossil</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Hugo Boss']">Hugo Boss</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Modo']">Modo</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Phat Farm']">Phat Farm</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Rodeo']">Rodeo</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Tom Ford']">Tom Ford</a></li>
  <li><a href="[server.url type='fullpage' query='brand=Yves Saint Laurent']">Yves Saint Laurent</a></li>

<?php } ?>
</ul>

CATEGORY PAGE > Default View > View <head> Elements:

HTML Code:

<title>
  [store.if word="on"][store.get param="word"] | [/store.if]
  [store.if tags="on"][store.get param="tags"] | [/store.if]
  [store.if price="on"]Price is [store.get param="price"] | [/store.if]
  [store.if brand="on"][store.get param="brand"] | [/store.if]
  [store.if merchant="on"][store.get param="merchant"] | [/store.if]
  [category.name] |
</title>
<meta name="description" content="[category.description]" />
<meta name="keywords" content="[category.keywords]" />

CATEGORY PAGE > Default View >Text Module:

HTML Code:

<!-- Category Name -->
<h2>  [category.name]
[store.if brand="on"] by [store.get param="brand"][/store.if]
[store.if merchant="on"] sold by [store.get param="merchant"][/store.if]
[store.if price="on"] priced [store.get param="price"][/store.if]</h2>
<!-- /Category Name -->


ayorofrance February 3rd, 2011 04:13 PM

Hi Eric,

This is a massive time saver - thank you sooo much for writing this up....

I have just converted my 115 sub-categories to a filter... 30 mins work instead of 5 hours of brainlessly clicking 'New Category' - brilliant :-)

A couple of questions:

I prefer to have category pages still for the main categories... this allows me show descriptions for each brand, which helps with SEO... However all my sub-categories will be converted to filters...

1. In my store I will end up with around 100 filters, which are brand specific. Do you recommend that I create one filter widget per brand and add 100 widgets to the side bar or would it make better sense to have a huge chunk of code in one master brand filter widget, which populates a drop down box depending on which category is active?

2. I think there is an issue with filter keys of less than 4 characters, so your Sky brand filter will not work unless you can tweak the MySQL .ini file - which you can't on shared hosting... Do you have any ideas on how to get around this?

3. Is it possible to use AND and OR on the word filter? For instance for one filter I have two possible ways of spelling the keyword, but I would like both keywords to be in the same filter. This would also allow you potentially to build out your example above with a second level 'Model' filter, so you could first select 'Ray Ban' then afterwards 'Wayfarer' to narrow down the model within the brand.

In case anyone is interested this is the code I use to create a drop down box instead of a list:
Code:

<form method="get">
  <select name="word" onchange='this.form.submit()'>

    <option value="Option 1"<?php if (@$_GET['word']=='Option 1') {echo ' selected="selected"';}?>>Option 1</option>
    <option value="Option 2"<?php if (@$_GET['word']=='Option 2') {echo ' selected="selected"';}?>>Option 2</option>

  </select>
  <input type="submit" value="Go" class="dfsbmt" />
</form>
 
<?php if (@$_GET['word']) { ?>
  <p><a href="[server.url type='fullpage' query='-word']">[X] Remove Filter</a></p>
<?php } ?>


Eric February 3rd, 2011 06:33 PM

Hi
Quote:

Originally Posted by ayorofrance (Post 17626)
This is a massive time saver

Glad to hear that!

Quote:

Originally Posted by ayorofrance (Post 17626)
1. In my store I will end up with around 100 filters, which are brand specific. Do you recommend that I create one filter widget per brand and add 100 widgets to the side bar or would it make better sense to have a huge chunk of code in one master brand filter widget, which populates a drop down box depending on which category is active?

The latter makes the most sense. Anytime you find yourself repeating the same thing over and over and over again (ie. creating 100 filters and adding 100 widgets to your sidebar), there is probably a better way.

Quote:

Originally Posted by ayorofrance (Post 17626)
2. I think there is an issue with filter keys of less than 4 characters, so your Sky brand filter will not work unless you can tweak the MySQL .ini file - which you can't on shared hosting... Do you have any ideas on how to get around this?

This is one of the drawbacks of this method. Modifying the MySQL's sysvar_ft_min_word_len option is the real work around.

Quote:

Originally Posted by ayorofrance (Post 17626)
3. Is it possible to use AND and OR on the word filter? For instance for one filter I have two possible ways of spelling the keyword, but I would like both keywords to be in the same filter. This would also allow you potentially to build out your example above with a second level 'Model' filter, so you could first select 'Ray Ban' then afterwards 'Wayfarer' to narrow down the model within the brand.

I don't believe that is possible...

Eric

digitalcow February 15th, 2011 01:49 PM

thanks for the guide Eric, very useful.

Have a question re the filters though. Would it be possible to return the filter options on the search results page? I ticked the search option in the plugin but nothing appeared so I assume that's only for the default WP search

Eric February 15th, 2011 02:01 PM

Sure, why not? Just add the path to your search page (store/search*) in the Widget Context section:


badm00n February 18th, 2011 11:32 AM

Hi Eric - thanks for this tutorial. Are the tags, brand and other parameters already recognized by the system? What if I wanted to filter by style? Sending 'style=boot' for example did nothing.

Eric February 18th, 2011 11:36 AM

Quote:

Originally Posted by badm00n (Post 18098)
Are the tags, brand and other parameters already recognized by the system?

Yes, these are specific fields in the database.

feri February 21st, 2011 04:38 PM

Can we make two filters independently of each other that use query=word (searching the product description)?

Eric February 21st, 2011 04:39 PM

Quote:

Originally Posted by feri (Post 18212)
Can we make two filters independently of each other that use query=word (searching the product description)?

No, this is not possible.

feri February 21st, 2011 05:25 PM

Thanks. Is this something that can be possibly added as a future feature?

I am not a programmer, but I think that if we can append price, or tag to the word query, we could possibly add another word query too.

Eric February 21st, 2011 05:36 PM

Quote:

Originally Posted by feri (Post 18219)
but I think that if we can append price, or tag to the word query, we could possibly add another word query too.

This is already possible:

http://www.datafeedr.com/docs/item/173

feri February 21st, 2011 05:49 PM

Thanks. I read the page a few times already but I think I did not find the answer I was looking for :) I will ask again, maybe we do not understand each other. :)

I have a category of products and I want to filter it by:
A) color (blue, green, etc)
B) shape (cross, flower, etc)
C) material (white gold, yellow gold, etc)
each of these things are in the products description.

Is this possible to filter A+B+C together, thus narrowing the search results step-by-step?

Eric February 21st, 2011 06:47 PM

Quote:

Originally Posted by feri (Post 18221)
Is this possible to filter A+B+C together, thus narrowing the search results step-by-step?

That's how I understood your question the first time and this is not possible.

feri February 22nd, 2011 01:46 PM

If your setup does not work at it should when you want to display widgets on specific categories try this - thanks Eric:

Edit the Widget Context Plugin's php file:

1) change this
PHP Code:

$current_url $this->get_current_url(); 

to this:
PHP Code:

$current_url $wp->request

2) Change this:
PHP Code:

    function check_widget_visibility($vis_settings = array()) {
        global 
$paged

To This:
PHP Code:

function check_widget_visibility($vis_settings = array()) {
        global 
$paged$wp

3) in your widgets URL filtering settings use these settings:
store/category/houses*

There is NO dash at the end...

Good luck! and thanks to Eric!

grooves1200 February 26th, 2011 01:41 PM

How can I get these widget filters to appear in a left-hand column instead of the right-hand sidebars you show above?

Eric February 26th, 2011 04:38 PM

Quote:

Originally Posted by grooves1200 (Post 18372)
How can I get these widget filters to appear in a left-hand column instead of the right-hand sidebars you show above?

That's completely related to your theme and how it handles widgets. You can move the Datafeedr widgets (or any WP widget) into any area the theme defines as a 'widget' area.

isler45 March 8th, 2011 02:24 PM

I am making a site selling phone and tablet cases and accessories. I just started it and want to get this right before I go too far. As of right now I have it structured with all categories and sub categories.

Example:

Motorola
-Motorola Xoom
--Motorola Xoom Cases
--Motorola Xoom Covers
--Motorola Xoom Skins

I am going to continue to do this for any new devices that come out. Is there a downside to doing this besides the time factor? Because eventually I would like to rank for the keywords that are my sub categories and build links to the pages. I won't be able to do that using the filter method right?

Also is there a way to not display products for a category that only has sub categories in it any no products?

For example if you click on motorola it shows products before you pick a sub category.

http://www.phoneandtabletcases.com

Thanks

Eric March 8th, 2011 02:34 PM

Quote:

Originally Posted by isler45 (Post 18692)
I am going to continue to do this for any new devices that come out. Is there a downside to doing this besides the time factor? Because eventually I would like to rank for the keywords that are my sub categories and build links to the pages. I won't be able to do that using the filter method right?

I think you are on the right track using categories and not filters.

Quote:

Originally Posted by isler45 (Post 18692)
Also is there a way to not display products for a category that only has sub categories in it any no products?

Yes, you can select "Do not display sub-category products" here: The Factory > Your Store > VIEWS > CATEGORY PAGE > Default > View menu > View Properties.

isler45 March 8th, 2011 02:46 PM

Great. Thanks

euroads May 26th, 2011 10:04 AM

How do you remove the filters from the product detail page?

Eric May 26th, 2011 10:06 AM

Quote:

Originally Posted by euroads (Post 20988)
How do you remove the filters from the product detail page?

You can use the Widget Context plugin to control which pages display the filters and which do not.

I usually set up my Widget Context to exclude by URL and put in this:

store/product*

Eric

multibuys September 26th, 2011 06:31 AM

Hi Eric, is there a way to have a master list of merchants and then only display the merchants that have products in a category without setting up a separate list of merchants for each category?

Thanks,

Simon

Eric September 26th, 2011 06:37 AM

Hi

Not without doing it all manually.

Eric

meinehandtasche October 14th, 2011 04:33 AM

Hi Eric,

thanks for this great tutorial - it was a big help! :-)

One little question still remains:

Is there a way to add the category name right next to the link "[X] Remove brand filter"?

The result shold be something like this:
"[X] Remove brand filter: #mybrand#"


Thanks,
Oliver

meinehandtasche October 14th, 2011 04:52 AM

show only brands with products on brand filter
 
I forgot my second question...

2) If a user clicks on a brand filter where no products are available the page doesn't show any products.
I have a list of about 20 brands for each main category (like "Men Sungalsses"). This can be frustrating for users clicking through the brands and some of them are empty.
Is there a way that only brands are displayed if products are available?

Thanks,
Oliver

meinehandtasche October 14th, 2011 06:02 AM

filter: combining a queries
 
Some merchants list their products either in english or another language like german.
Can I combine a query e.g. for a color filter like that?
'word=Black OR Schwarz OR Negro'

<li><a href="[server.url type='fullpage' query='word=Black']">Black</a></li>

Eric October 14th, 2011 08:03 AM

Hi
Quote:

Originally Posted by meinehandtasche (Post 24836)
Is there a way to add the category name right next to the link "[X] Remove brand filter"?

The result shold be something like this:
"[X] Remove brand filter: #mybrand#"

You could try doing something like
HTML Code:

[X] Remove <?php echo strip_tags($_GET['brand']); ?>
Quote:

Originally Posted by meinehandtasche (Post 24837)
Is there a way that only brands are displayed if products are available?

No, this would be a true faceted search and currently it's not supported.

Quote:

Originally Posted by meinehandtasche (Post 24839)
Some merchants list their products either in english or another language like german.
Can I combine a query e.g. for a color filter like that?
'word=Black OR Schwarz OR Negro'

<li><a href="[server.url type='fullpage' query='word=Black']">Black</a></li>

I don't think this is possible.

Eric

meinehandtasche October 14th, 2011 08:25 AM

Quote:

Originally Posted by Eric (Post 24842)
You could try doing something like
HTML Code:

[X] Remove <?php echo strip_tags($_GET['brand']); ?>

c

that worked :-) Thank you!

Quote:

---Quote (Originally by meinehandtasche)--- Some merchants list their products either in english or another language like german.
Can I combine a query e.g. for a color filter like that?
'word=Black OR Schwarz OR Negro'

<li><a href="[server.url type='fullpage' query='word=Black']">Black</a></li>
---End Quote---
I don't think this is possible.
If this doesn't work, can I export all products from shop to a Excel or CSV file in order to manually add e.g. the english color name and then import it back to the shop?
Would my editing be overwriten with the next update from my merchants?

Oliver

Eric October 14th, 2011 08:27 AM

Hi

Yes, it will be overwritten. If you want to modify your product information, it's best to do that in the Factory and not on your site.

http://www.datafeedr.com/videos?vide...rc=yt#videotop

Eric

meinehandtasche October 18th, 2011 08:49 AM

Quote:

Originally Posted by Eric (Post 24844)
Hi

Yes, it will be overwritten. If you want to modify your product information, it's best to do that in the Factory and not on your site.

http://www.datafeedr.com/videos?vide...rc=yt#videotop

Eric

When I use the color filter described in your video tutorial I noticed that the color of some merchants' products do not show up.
Therefore I wanted to edit the 'field' color in the factory but couldn't find it.
Where can I find this field and update it for all my products or how can I solve this?

Thanks, Oliver

Eric October 18th, 2011 09:28 AM

Hi

There is no field named "color". Most networks don't provide this field in their data feeds and if they do, most merchants don't fill in the field.

Eric

GadgetStylist October 25th, 2011 06:51 PM

Hi Eric

The filters stuff works great on one of my sites but I'm trying to replicate it on a new site and the 'Remove filter' link isn't working. It just reloads the same page:

http://will2k.co.uk/snowboards/?brand=Lib%20Tech

Is there something I need to do to fix this or is this no longer compatible with the latest plugin update?

Thanks

Chris

Eric October 25th, 2011 07:24 PM

Quote:

Originally Posted by GadgetStylist (Post 25294)
Hi Eric

The filters stuff works great on one of my sites but I'm trying to replicate it on a new site and the 'Remove filter' link isn't working. It just reloads the same page:

http://will2k.co.uk/snowboards/?brand=Lib%20Tech

Is there something I need to do to fix this or is this no longer compatible with the latest plugin update?

Thanks

Chris

There seems to be a bug. We are looking into this and we'll update you when it's fixed.

GadgetStylist October 26th, 2011 04:57 AM

Thanks Eric. Really appreciate your fast response times.

Chris

Eric October 26th, 2011 07:38 AM

Hi

This should be fixed now. You will need to upgrade the plugin to the newest version to get it to work.

Eric

GadgetStylist October 26th, 2011 07:53 PM

Hi Eric

That's fixed thank you.

I am having a different issue with Widget Context though. I can't seem to get it to 'target by URL' reliably so I can't set category specific filters and I also can't hide or 'move' my Store Category list below the Filters once someone has selected a category.

http://will2k.co.uk/

My store has a chopped down URL structure and some hyphenated folders. Could either of these be causing an issue?

Thanks

Chris

Eric October 26th, 2011 11:37 PM

Hi Chris

I don't know... It seems to work for me, but I didn't develop the plugin.

Eric

GadgetStylist October 27th, 2011 04:52 AM

Hi Eric

I've followed your instructions to the letter and tried multiple variations of the url string but to no avail.

Could you share a live example of stores that are successfully using the Widget Context plugin and would it be possible to share the exact strings you are currently, successfully using in the URL box?

Thanks

Chris

Eric October 27th, 2011 09:06 AM

1 Attachment(s)
Hi

I set up a Widget Context here: http://yoga-blocks.co/store/category...o-yoga-blocks/

I documented the process in this video: http://www.datafeedr.com/videos?vide...rc=yt#videotop

Eric

On a side note, the background image you are using on your site is over 2MB! That's huge and will affect your SEO efforts negatively. It shouldn't be that large. I optimized the image for your (attached below) so that the file size is a lot smaller and will load way faster.


All times are GMT -5. The time now is 02:30 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.