Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

What Function Changes The Slider Value In Filters? Rate Topic   - - - - -

 
  • bebopboy
  • Advanced Member
  • Trial users
  • Join Date: 04-Feb 20
  • 77 posts

Posted 07 July 2020 - 06:13 AM #1

Hi, so what happens right now is that in the 'Price' filter, there are input fields for minimum and maximum and also a slider. If you put a price in the input field lower than the minimum, then it the system will treat it as the minimum. Conversely if you put a price in the input field higher than the maximum, then the system will treat it as the maximum.

 

What I want to do is put a notification, that warns users that their input is lower/higher than the minimum/maximum for this filter. And to do that I need to know which function takes the input field and then converts it from the actual input field value to the lowest minimum. Which function is that in?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20765 posts

Posted 07 July 2020 - 01:58 PM #2

Check the fn_filter_process_ranges function (app/functions/fn.catalog.php)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • bebopboy
  • Advanced Member
  • Trial users
  • Join Date: 04-Feb 20
  • 77 posts

Posted 07 July 2020 - 02:49 PM #3

Hi, yes I found that function but it seems that actual values of the sliders/fields are already converted to the minimum before then. Because at the top of that function I tried printing the content of $selected_filters and when I changed the value to lower than the minimum, the value in $selected_filters was already the minimum. 

 

Does the system detect that the value is lower and then convert it to the lowest minimum option available at an earlier point before using that function? 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20765 posts

Posted 08 July 2020 - 05:52 AM #4

Looks like this function is called several times in the fn_get_filters_products_count function. So you should debug and find where the $selected_filters array is filled


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)