*

BabyDunk

  • ****
  • 161 posts
[Bug] Patricia's price slider
« on: August 03, 2016, 05:56:29 PM »
Hello

i see that when the price slider is set at free. that the search function does not just select the free listings but rather all listings.


cheers
Chris
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

BabyDunk

  • ****
  • 161 posts
Re: [Bug] Patricia's price slider
« Reply #1 on: August 05, 2016, 01:56:36 AM »

Hello again

i am trying to use what SmaRteY shared on osclass forum but im not sure which params i need to get in order for this function to work. i dont know if this will even be able to pull the params from the slider script.

http://forums.osclass.org/tips-and-tricks/howto-add-a-search-checkbox-in-search_sidebar-form-for-searching-only-free-ads/msg118646/#msg118646

Code: [Select]
//Returns the set value of the amount-max search parameter
function SearchFreeOnly() {
return (Params::getParam('sPriceMax'));
}

//Add the search condition to search only Free ads
function AddSearch_FreeOnly($params) {
if(isset($params['sPriceMax'])) {
//Only add search parameter if set to true
if($params['sPriceMax']) {
$mSearch = Search::newInstance();
$mSearch->addConditions(sprintf("%st_item.i_price = 0", DB_TABLE_PREFIX));
}
}
}
//Add our new search condition to the search conditions used by Osclass
osc_add_hook('search_conditions', 'AddSearch_FreeOnly');
« Last Edit: August 05, 2016, 02:02:15 AM by BabyDunk »
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

MB Themes

Re: [Bug] Patricia's price slider
« Reply #2 on: August 05, 2016, 09:05:14 AM »
@BabyDunk
I think you are trying to overkill this. You have min & max price here, I would try to use it.
- when click on "only free", hide price slider (jQuery) and set min & max price to 0 (jQuery)
- when unchecked, show price slider (jQuery) and set min & max price to original (jQuery)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BabyDunk

  • ****
  • 161 posts
Re: [Bug] Patricia's price slider
« Reply #3 on: August 05, 2016, 11:09:23 AM »
Hi Frosticek :)

i just like the idea of deleting the freebie category and use the search to display all freebies from each category .. it would have been nice to have it all incorporated into the price slider  but if its going to have to take a check box to do, then i'm sure i could live with that also.


Thanks
« Last Edit: August 05, 2016, 07:07:27 PM by BabyDunk »
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D