Using WordPress to make a “Product Search” type navigation drilldown

This is somewhat of a follow-up to a question I asked some time ago: https://wordpress.stackexchange.com/questions/11088/trying-to-design-nice-category-drilldown-with-one-held-taxonomy-and-a-repeatabl

I’ve sort of got a better idea of what I want, but only a vague idea of how to accomplish it and I was hoping to get some feedback.

Read More

I’m going to be using wordpress as a CMS. Instead of posts with blog-type info, I’d be making Products with a number of shared properties (which I’d assign to taxonomies). I want to create a good search/navigation area for people to be able to find the Product Info/Review that they want. Really something like New Egg (www.newegg.com) has when you try and find a piece of computer equipment you want. Were you go in and start in say the Processor category, and then you can drilldown to what you want. All the posts with the 3GHZ taxonomy. The Search box would adjust then to show all those posts and the remaining taxonomies you could drill down by, socket type, AMD/Intel etc… and have it hold on to those properties as you pass through.

I know I can use either cookies or a session to hold the values as I pass down through them, but not entire sure how to approach the rest of the code.

I’m looking for any open source examples I might be able to look through where this has been done before that would help me develop something like this for my site.

Thanks in advance!

Related posts

Leave a Reply

1 comment

  1. There’s a way to set custom post-type search. I can only head you in the right direction and answer the first part of your question. The other part about COOKIES you’ll have to review php documentation.

    Also, I don’t know exactly what the other $_REQUEST variables you may have set for your custom post type.

    But here’s a technique on how you can hidden input fields to set various post/get/request values.

    I.E. Here is how you set which custom post type:

    <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
    <input type="text" name="s" id="s" value="Enter keywords ..." onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/><br />
    <select name="post_type">
        <option value="">Choose Category:</option>
        <option value="">All Categories</option>
        <option value="post_type_a">Post Type A</option>
        <option value="post_type_b">Post Type B</option>
         <option value="post_type_c">Post Type C</option>
    </select><br />
    <input type="submit" id="searchsubmit" value="Search Help" />
    

    Thus when you submit the value the search will add $_REQUEST['post_type'] to your search.

    You can also do this with a hidden form:

    <input type="hidden" name="post_type" value="your_post_type" />
    

    and have javascript dynamically change the value of above field.

    More on this:

    So potentially you could just add another hidden field to limit your search with javascript etc.

    Hope that helped!