PDA

View Full Version : Shop by price infobox



michael_s
02-08-2009, 11:00 AM
While i was integrating this contribution i thought why making it so complicated while the functionality is allready in the advanced_search?

I rewrote what i needed and it appears to be limited to a few extra lines in the search box (which is already there). I attached the resulting search.php box, language items you will have to do yourselves.

This is what i added:

$price_ranges = array(
array('max' => 10),
array('min' => 10, 'max' => 20),
array('min' => 20));



$info_box_contents[] = array(
'align' => 'center',
'text' => '' . BOX_SEARCH_TEXT2 . '');
$info_box_contents[] = array('text' => tep_draw_separator('pixel_trans.gif', '100%', '5'));
for ($index=0; $index 'center',
'text' => '' . '€' . number_format($price_ranges[$index]['min'], 0) . ' ' . BOX_SEARCH_TO . ' €' . number_format($price_ranges[$index]['max'], 0) . ' (http://www.oscmax.com/forums/' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'pfrom=' . $price_ranges[$index]['min'] . '&pto=' . $price_ranges[$index]['max'], 'NONSSL') . ')
');
} else if(isset($price_ranges[$index]['min']) && !isset($price_ranges[$index]['max'])) {
$info_box_contents[] = array(
'align' => 'center',
'text' => '' . BOX_SEARCH_FROM2 . ' €' . number_format($price_ranges[$index]['min'], 0) . ' (http://www.oscmax.com/forums/' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'pfrom=' . $price_ranges[$index]['min'], 'NONSSL') . ')
');
} else if(!isset($price_ranges[$index]['min']) && isset($price_ranges[$index]['max'])) {
$info_box_contents[] = array(
'align' => 'center',
'text' => '' . BOX_SEARCH_TO2 . ' €' . number_format($price_ranges[$index]['max'], 0) . ' (http://www.oscmax.com/forums/' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'pto=' . $price_ranges[$index]['max'], 'NONSSL') . ')
');
}
}

and that's it....!


More... (http://addons.oscommerce.com/info/1276)