close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

I would like to create a search that allows my subscribers to search by price ranges.

Thread began 6/21/2017 5:18 pm by Daniel | Last modified 6/24/2017 12:18 pm by Ray Borduin | 2285 views | 14 replies |

Daniel

I would like to create a search that allows my subscribers to search by price ranges.

I've created a search parameter with drop down menus that allows a search of price ranges. I have two fields that have prices in them "costoutdor" and "costindor". They are currently set to "No Space Fee" "$25.00 or less" " "$50.00 or less" etc for each field. And then I've set the results page to provide for that search. What I would like to do is to be able to exclude shows that have a 0.00 dollar amount. The way that should work is that if I set the "$25.00 or less" or whatever the amount it should actually be "$25.00 or less (but greater than 1.00)" When I select "No Space Fee" it should then exclude all shows with any amount.

As an example, if I were to set the "Cost Indoor" to "$25.00 or less" and set the "Cost Outdoor" to "No Space Fee" then I should see results where the indoor fee is greater than $1.00 but equal to or less than $25.00. I shouldn't see any outdoor only shows. And of course the reverse should be true if I were to set the "Cost Outdoor" to "$25.00 of less" and set the "Cost Indoor" to "No Space Fee" then I should see results there the outdoor fee is grater than $1.00 but equal to or less that $25.00. I would want the other selections to reflect a similar response.

I've included the pages as attachments here and I'd appreciate your help accomplishing that!

Sign in to reply to this post

Ray BorduinWebAssist

You never want the search to return free shows? If that is the case then you can just add WHERE PRICE > 0 to the recordset directly on the results page.

Sign in to reply to this post
Did this help? Tips are appreciated...

Daniel

That didn't seem to work... but maybe I put the conditional statement in the wrong place

What I wanted to accomplish was that if the subscriber didn't select anything then of course all shows are returned. If they were to select "No Space Fee" for the outdoor shows and for example "$50.00 or less" for the indoor shows what would be returned in the results page would be only those shows with an indoor fee greater than $1.00 and equal to or less than $50.00. The shows with 0.00 for the indoor fee and 0.00 for the outdoor fee would be excluded from the results page. Of course the same would go for the reverse selecting "No Space Fee" for the indoor show shows would exclude all indoor only shows and limit the results to outdoor shows with a fee => $1.00 and ,= $50.00. Am I thinking correctly?

Attached Files
allshows2_results-with no free shows.php
Sign in to reply to this post

Ray BorduinWebAssist

I see. That would require a little bit of hand coding. Try adding this after line 56.

php:
if (isset($_GET['costoutdor']) && $_GET['costoutdor']) {

  $WADbSearch1->addComparison("costoutdor","1","AND",">=",1);
}
if (isset($_GET['costindor']) && $_GET['costindor']) {
  $WADbSearch1->addComparison("costindor","1","AND",">=",1);
}
Sign in to reply to this post
Did this help? Tips are appreciated...

Daniel

Didn't work

I inserted that code after Line 56 and when I ran the search it had no content on the results page

Attached Files
allshows2_results-with no free shows-2.php
Sign in to reply to this post

Ray BorduinWebAssist

What does it say if you add this after:

echo($WADbSearch1->whereClause);

That should show the resulting where clause and could help me figure out where I went wrong.

Sign in to reply to this post
Did this help? Tips are appreciated...

Daniel

I'll be back in about two hours

Hello Ray... I'll try it as soon as I get back. I've got to go to an appointment in a few minute.

Sign in to reply to this post

Daniel

I had a couple of minutes so I thought I'd give your clause a try... Here is what I got

AND (showbegin >= "2017-06-22 00:00:00") AND (costoutdor <= '0') AND (costindor <= '200') AND (costoutdor >= 1) AND (costindor >= 1)

Sign in to reply to this post

Daniel

Did you get the response from the code

Hi Ray... were you able to decipher anything from the code that echo statement returned?

Dan

Sign in to reply to this post

Ray BorduinWebAssist

I updated the code. Try the new version.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...