I gang

Listing search results order by price, dsc, asc

In the [url removed, login to view]

When i select “Price Ascending” its working but its loading all properties on to page. For example when i search Arizona then select “Price Ascending” from selection its not ordering properties at Arizona its loading all properties on page then ordering by “Price Ascending”.

Thanks

you can see live at [url removed, login to view]

[url removed, login to view]

<div id="resultsorder" style="">

<form name="formorder" method="POST" action="<?php bloginfo('url'); ?>/?page_id=<?php echo $wp_searchpageid; ?>">

<select name="resultsorder" onChange="[url removed, login to view]();">

<option>Order</option>

<option>Date Descending</option>

<option>Date Ascending</option>

<option>Price Descending</option>

<option>Price Ascending</option>

<option>Random</option>

</select>

</form>

</div>

----------

[url removed, login to view]

----------

if($resultsorder) {

//get value from order dropdown on search results page

$resultsorder = $resultsorder;

} else {

$resultsorder = get_option('wp_searchorder');

}

switch ($resultsorder) {

case "Price Descending":

$metakey = 'price_value';

$order = 'DESC';

$orderby = 'meta_value_num';

break;

case "Price Ascending":

$metakey = 'price_value';

$order = 'ASC';

$orderby = 'meta_value_num';

break;

case "Date Descending":

$metakey = '';

$order = 'DESC';

$orderby = 'date';

break;

case "Date Ascending":

$metakey = '';

$order = 'ASC';

$orderby = 'date';

break;

case "Random":

$metakey = '';

$order = '';

$orderby = 'rand';

break;

}

if (!empty($_ids) && !$alllistings) {

$wpq = array ('post_type' => 'listing', 'meta_key' => $metakey, 'orderby' => $orderby, 'order' => $order, 'post__in' => $_ids, 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => 9999 );

} elseif (empty($_ids) && !$alllistings) {

// $_ids array is empty because search got no results

// $_ids array will be empty if page is an "All Listings" page. Don't run this code if is All Listings because All Listings will show all listings. This code will display "no results found"

$wpq = array ('post_type' =>'listing', 'meta_key' => $metakey, 'orderby' => $orderby, 'order' => $order, 'post__in' => array('0'),'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => 9999);

} elseif ($alllistings) {

// This is an All Listings page, so show all results

$wpq = array ('post_type' =>'listing', 'paged' => $paged, 'meta_key' => $metakey, 'orderby' => $orderby, 'order' => $order, 'post_status' => 'publish', 'posts_per_page' => 9999);

}

$listing = new WP_Query($wpq);

Færdigheder: Javascript, MySQL, PHP, WordPress

Se mere: php search results asc, order price asc, will price, post properties, div search, listing search results, order dsc, page listing, order, live action, desc, arizona, dropdown select, javascript url example, search results php, dropdown search form, display url javascript, switch order, array form, form array, javascript array post, name empty, php post array, php post value, submit loading

Om arbejdsgiveren:
( 0 bedømmelser ) Didim, Turkey

Projekt-ID: #964778

Tildelt til:

phpjquery

PHP Expert here. Please check PMB.

$75 USD på 1 dag
(19 bedømmelser)
3.1

7 freelancere byder i gennemsnit $135 for dette job

samypogs

Easy job sir. Let me handle this.

$150 USD in 0 dage
(7 bedømmelser)
3.9
vanecgs

please see PM

$100 USD in 2 dage
(2 bedømmelser)
3.5
Sohag07Hasan

please check your pm!

$50 USD in 7 dage
(5 bedømmelser)
3.3
betatesting

Hi, lets get it done. -regards

$150 USD in 2 dage
(2 bedømmelser)
2.3
msundarsingh

We are a team with expertise in deveopment projects.Kindly share with us the project details and requirements. Looking forward to your response Regards M.Sundar

$220 USD in 10 dage
(0 bedømmelser)
0.0
yashpalkadam

!!!!GREETINGS!!!!! From PHP experts. READY TO WORK. CHECK ur PMB

$200 USD in 5 dage
(0 bedømmelser)
0.0