Forums › Forums › Search & Filter Pro › CF7 and S&F – form action
- This topic has 19 replies, 3 voices, and was last updated 5 years, 7 months ago by
Anonymous.
-
Anonymous(Private) July 23, 2019 at 5:08 pm #217063
I have added custom results to shortcode contact form 7 in a loop. As soon as have something filtered under the cf7 fields filling I get an error.
In this case, form action=”” CF7 is filled with S&F data:
form action="/?sfid=505&sf_action=get_data&sf_data=results&_sfm_car_type=comfort&_sfm_car_price=1200+10000#wpcf7-f280-o1"
Any solution.
ThanksRoss Moderator(Private) July 29, 2019 at 3:36 pm #217453Hi Arthur
It looks like contact form 7 inherits the vars from our searches, this is probably for compatibility with other plugins but in this case it seems to have an adverse effect.
You can modify the CF7 action urls, and remove the vars you don’t want, like this:
add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url'); function wpcf7_custom_form_action_url($url){ $url = remove_query_arg( "_sfm_sortingtesting", $url ); $url = remove_query_arg( "_sfm_min_val", $url ); return $url; }
In this case, in my tests, I remove
_sfm_sortingtesting
and_sfm_min_val
from the CF7 action URLs.Let me know how you get on.
Thanks
Ross Moderator(Private) August 1, 2019 at 12:47 pm #217771Hi Arthur
Considering contact form 7 has a form, and S&F has a form, I’m a little confused as to which forms you are referring to!
Can you explain which form works and doesn’t work? And is this still referencing the homepage you linked before? 🙂
Thanks
-
AuthorPosts