my script should do this:
Check if there is a $startprice and $endprice for a product. Those variables are checked against the $price that is the product’s price.
The user is able to add both ($startprice and $endprice) or just one of them or nothing of them.
- In the case that he adds only the
$startprice, the $price must be
bigger than this. - In the case that he adds only the
$endprice, the $price must be smaller
than this. - In the case that he adds both, the
$price must be between of them. - In the case that he does not add
anything, the script will show all
the results.
If the data satisfies the statements, it will show the product’s list. In all cases the product’s list code is the same.
*What I did until now is this but I can’t continue it correctly.
The product’s price is named $price and I can get it correctly for each product.
<?php
$startprice = $_GET['startprice'];
$endprice = $_GET['endprice'];
// this is the between code and it's the only I know how to do...
if (($startprice <= $price) && ($endprice >= $price)) { ?>
<h2> <a href="<?php the_permalink(); ?>"> <strong> <?php the_title(); ?> </strong></a></h2>
<? } ?>
Your question is not clear. But just try this from what I understood..