Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Creating Search Results from a drop down list

 

 


Liz1001
User

Mar 29, 2008, 5:36 PM

Post #1 of 10 (1037 views)
Shortcut
Creating Search Results from a drop down list Can't Post

Hi There;
I have read all the info on searching and other posts on using search, but am still having problem understanding what I need to do. I have created a search page that has a drop down list of products. I want to be able to make it so that when someone selects one of the items from the drop down list it will output all the cities that carry that product. Then on the results page, I want the cities to be hyper linked to a page that display all the clients in that city.

Sorry, I am still pretty new at php and feel like I know enough only to get me into trouble, I am sure this is possible. Thanks for any help


Dave
Staff / Moderator


Mar 31, 2008, 10:06 AM

Post #2 of 10 (1003 views)
Shortcut
Re: [Liz1001] Creating Search Results from a drop down list [In reply to] Can't Post

Hi Liz, Welcome to the forums! :)

We can help you with that. A few questions first:

Have you created any sections editors or html mockups for the website pages yet or are you just getting started?

So the site will have sections for: products, cities, and clients?

Is there a max limit on the number cities a product or client will be in? If we knew there was going to be a max of say 5 cities, we could create an editor for products and clients and then have 5 pulldown fields for cities.

Let me know how many cities there needs to be and we'll figure something out.

Dave Edis - Senior Developer
interactivetools.com


Liz1001
User

Mar 31, 2008, 10:29 AM

Post #3 of 10 (1002 views)
Shortcut
Re: [Dave] Creating Search Results from a drop down list [In reply to] Can't Post

Hi Dave - thanks for helping me out, I figured out some of the things like creating a form with a pull down list that sends the product chosen to a second page. http://www.therichlawncompany.com/?page_id=51

Where I am having a problem is only listing on the second page the actual cities that have that product chosen.

Then I am not sure how to make it so that when you click on the city it shows a page with all the dealers. I have contacted the consulting team for help and will be happy to work with them (and pay for time) to resolve this as it is pretty specific to my situation so not sure if the forum is the right place?

Oh and to add more fun to the situation the whole thing is integrated into WordPress. :)


(This post was edited by Liz1001 on Mar 31, 2008, 10:31 AM)


Liz1001
User

Mar 31, 2008, 10:40 AM

Post #4 of 10 (998 views)
Shortcut
Re: [Liz1001] Creating Search Results from a drop down list [In reply to] Can't Post

Dave - sorry I did not really answer your questions:

Have you created any sections editors or html mockups for the website pages yet or are you just getting started?

Yes, the sections are created.

So the site will have sections for: products, cities, and clients?

I just need to output cities that stock a certain product then display the clients in that city.

Is there a max limit on the number cities a product or client will be in?

There are a max # of products, but infinite cities.
Likewise there are more than one clients in a city


Dave
Staff / Moderator


Mar 31, 2008, 4:38 PM

Post #5 of 10 (980 views)
Shortcut
Re: [Liz1001] Creating Search Results from a drop down list [In reply to] Can't Post

So, each dealer will only be in one city right? If you had a section for "dealers" you could have a field for "City" (which could actually be a list field that loads the city names from the city section. That you could list all the dealers in a specific city with an url like this:

dealerList.php?city=Vancouver

Then, for your city section, you could have a textbox that listed all the products or product numbers (one per line) then you could list all the cities a product was available in with an url like this:

cityList.php?product_keyword=pasta

Does that make sense? Give that a try and let me know how it goes (or let me know if you need more details!) :)

Dave Edis - Senior Developer
interactivetools.com


Liz1001
User

Apr 29, 2008, 10:49 PM

Post #6 of 10 (778 views)
Shortcut
Re: [Dave] Creating Search Results from a drop down list [In reply to] Can't Post

Hi Dave;

If I understand your message, I think am trying to work it from a different angle. I have a list of products that when one is selected, shows the list of cities, the city when clicked, shows a list of dealers in that city. But I have some problems with the search results.

I have a page where you can search for a product from a drop down list http://www.therichlawncompany.com/?page_id=72

Problems I am having:
1. The results page shows the city name multiple times, not sure how to fix that. Here is the code:

Code
    <h1>Dealers City List Viewer</h1> 
<?php foreach ($listRows as $record): ?>
<a href="http://www.therichlawncompany.com/?page_id=53&city_match=<?php echo $record['city'] ?>"><?php echo $record['city'] ?></a><br/>
<hr/>
<?php endforeach ?>


2. Then the cities are actually displaying all the records for that city, not just the ones that have the product that was selected. So I need to edit the code so that only the cities with that product show.

I opened a support ticket back in early March to help with this, I think it was Jake that was helping me, but can not find the emails from him, so not quite sure.

Thanks for any help, I thought we had it working but the client entered the data and that is when I realized there was a problem.
Liz


Dave
Staff / Moderator


Apr 30, 2008, 9:00 AM

Post #7 of 10 (756 views)
Shortcut
Re: [Liz1001] Creating Search Results from a drop down list [In reply to] Can't Post

Hi Liz,

How are your sections setup? Do you have a separate section for products, cities, and dealers or are they all combined?

Let me know a bit more information about how it's setup and we'll help you get it all fixed up for you. :)

Dave Edis - Senior Developer
interactivetools.com


Liz1001
User

Apr 30, 2008, 3:53 PM

Post #8 of 10 (741 views)
Shortcut
Re: [Dave] Creating Search Results from a drop down list [In reply to] Can't Post

I have one Section called Dealers and that has the fields for name, city, state etc and then we used check lists for the products. Each product has 'product_code' or 'no' as the option. If they carry the product then the product_code is selected if not then they leave it blank or check 'no' - checking or un-checking 'no' does not seem to make a difference.

I really appreciate your help, it is giving me sleepless nights :)


Dave
Staff / Moderator


May 1, 2008, 10:31 AM

Post #9 of 10 (711 views)
Shortcut
Re: [Liz1001] Creating Search Results from a drop down list [In reply to] Can't Post

Hi Liz,

That one's a little tricky, but I think I have an idea on how to make it work the way you want. Try this:


Code
<h1>Dealers City List Viewer</h1>  
<?php foreach ($listRows as $record):
if ($record['city'] == @$lastCity) { continue; } // only list cities once
$lastCity = $record['city'];

?>
<a href="http://www.therichlawncompany.com/?page_id=53&city_match=<?php echo $record['city'] ?>"><?php echo $record['city'] ?></a><br/>
<hr/>
<?php endforeach ?>


I saw you took the page offline. Is there a test url we can use while figuring this out? If you're in a rush on this feel free to email me CMS and FTP login directly at dave@interactivetools.com and I can help you get it fixed faster.

Let me know if the above code helps!

Dave Edis - Senior Developer
interactivetools.com


(This post was edited by Dave on May 1, 2008, 10:31 AM)


Liz1001
User

May 2, 2008, 8:23 AM

Post #10 of 10 (693 views)
Shortcut
Re: [Dave] Creating Search Results from a drop down list [In reply to] Can't Post

Dave, thanks that worked great, now we only have one city showing. I still have dealers showing up when they do not carry the product, so will email you directly for that,

Thank You
Liz

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4