Lukket

Listing search results order by price, asc, dsc

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: order price asc, order asc price, php order search results price, will price, Post properties , div search, code search, select order price asc, switch resultsorder case price descending, order asc rand, listing search results, 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, javascript array com, form array

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

Projekt-ID: #966546

6 freelancere byder i gennemsnit $80 for dette job

evgendob

Please, check PM

$50 USD på 1 dag
(220 bedømmelser)
7.1
jqMike

I can fix it. Please contact me to discuss details.

$180 USD in 2 dage
(73 bedømmelser)
6.9
AStonetech

Please have a look a PMB for more detail.

$50 USD på 1 dag
(145 bedømmelser)
6.6
funniezatee

Work Mantra: +Best Effort  +Task Completion +Time Oriented  (Pls view PM!)

$90 USD in 2 dage
(1 bedømmelse)
1.4
panasenko

I can help you

$30 USD på 1 dag
(0 bedømmelser)
0.0
mdominik86

Hey. I am new to the site. I have 3+ years experience in php, mysql, javscript, jquery, ajax, css and html. Thanks Dominik

$30 USD in 7 dage
(0 bedømmelser)
0.0
ipsilmadras

Dear sir, we can do this listing search results order by price, asc,dsc. kindly visit our sampls [url removed, login to view] regards ipower sol.

$230 USD in 12 dage
(0 bedømmelser)
0.0