Forums › Forums › Search & Filter Pro › Getting value from url
- This topic has 45 replies, 2 voices, and was last updated 8 years, 2 months ago by Anonymous.
-
Anonymous(Private) July 21, 2016 at 10:47 am #51786
Hello,
I would like to get a part of the url that S&F creates to dynamically fill my ACF so that the price corresponds with the selected options. Is this possible?
For example the url is:
sft_arrangementstype=dineren+italiaans-menu
And I’d like to get the part that has
dineren
anditaliaans-menu
.Trevor(Private) July 21, 2016 at 11:18 am #51797You need to check this pages out:
http://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/
If a function looks about right, search the forum for threads that might show examples.
Anonymous(Private) July 21, 2016 at 2:29 pm #51817Hello Trevor,
This looks like a script that would work, I guess.
How do I use this?function filter_function_name($input_object, $sfid) { if($input_object['name']=='_my_field_name') { //udpate this field before rendering } return $input_object; } add_filter('sf_input_object_pre', 'filter_function_name', 10, 2);
Anonymous(Private) July 21, 2016 at 3:02 pm #51821So, that’s way over my head.
Maybe this is a simpler question, I’ve searched the forms, couldn’t find any answers.How do I echo the checked=”checked” values?
this and similar codes don’t do the trick.
<?php if( isset($_POST['_sft_arrangementstype']) && is_array($_POST['_sft_arrangementstype']) ) { foreach($_POST['_sft_arrangementstype'] as $fruit) { // eg. "I have a grapefruit!" echo "I have a {$fruit}!"; // -- insert into database call might go here } // eg. "apple, grapefruit" $fruitList = implode(', ', $_POST['_sft_arrangementstype']); // -- insert into database call (for fruitList) might go here. }?>
Trevor(Private) July 21, 2016 at 3:34 pm #51829In this thread, the OP wanted to do that:
https://support.searchandfilter.com/forums/topic/how-to-style-the-search-data/
-
AuthorPosts