Forum Replies Created
- AuthorPosts
marianogi
ParticipantHi, Ally. I don’t know why your code does not work for me, I never get the label value.
I get the value with:
add_filter('quform_post_process_1', function (array $result, Quform_Form $form) {
$data = array(
'provincia' => $form->getValue('quform_1_17')
);
}, 10, 3);
And also this:
function add_option_label_to_value($value, Quform_Element_Multi $element, Quform_Form $form) {
if ($form->config('environment') == 'frontend') {
foreach ($element->getOptions() as $option) {
if ($option['value'] == $value) {
$value = esc_html($option['label']) . ' (' . $value . ')';
}
}
}
return $value;
}
add_filter('quform_get_value_html_1_17', 'add_option_label_to_value', 10, 3);
So why I don’t get this value: esc_html($option[‘label’]) . ‘ (‘ . $value . ‘)’ when I read the value: $data[‘provincia’] ?
I read the the value as if the ‘quform_get_value_html’ code wouldn’t exists.
I don’t know what I am doing wrong. Thank you for your help
marianogi
ParticipantThank you, Ally. It works now
marianogi
ParticipantYou leave me speechless. Believe me, you have the best plugin, support and documentation I ever see, after many years buying dozens of plugins and themes.
Please consider making a multipurpose theme and I’ll be there! 🙂Thank you!!
marianogi
ParticipantThank you!, this is a very useful information to me!. Hope you can make a documentation page soon.
marianogi
ParticipantGreat!! thank you!, about that, can you tell me where to see all that variable combinations? I mean a documentation page or similar where I can learn all that variables. I think I saw another modifier (I don’t know how to call it) to write a date with another date format. I’d like to see all possibilities of it.
Thank you again!
marianogi
ParticipantHi!, thank you!, I thought some “iphorm” hooks were still alive. Your solution worked great.
marianogi
ParticipantHi!, thank you for your fast response and help, as always.
Yes, I am sure 4_69 is the correct ID. And here you can check the form:
https://sercodi.es/empleo-2/
(I send the url like this because the comment cropped the ‘/empleo-2/’ part of the link, I don’t know why.
Let me know if you need credentials to see the backend and my code.
- This reply was modified 2 years, 8 months ago by
marianogi. Reason: URL cropped and not working
marianogi
ParticipantHi again, here I post what I needed to integrate with Pods plugin. Maybe I can help more people with the same need:
add_filter('quform_post_process_1', function (array $result, Quform_Form $form) { $pod_field1 = $form->getValue('quform_1_2'); $pod_field2 = $form->getValue('quform_1_3'); $pod_field3 = $form->getValue('quform_1_4'); $fields = array( 'post_title' => 'item name:' . ' - ' . $pod_field1, 'pod_field1' => $pod_field1, 'pod_field2' => $pod_field2, 'pod_field3' => $pod_field3 ); $new_id = pods( 'pod_name_here' )->add( pods_sanitize ($fields) ); return $new_id; }, 10, 2);
Very easy!
marianogi
ParticipantOh, thank you very much!, that’s the kind of help I needed!!
I always get suprised by your plugin, its complete documentation and your great support. My favourite plugin ever! 🙂
marianogi
ParticipantOMG!!! I can’t believe your support! IT WORKED!!! Thank you very much!!
I know this could be beyond your support posibilites but you choose to help people and spend a lot of time with their issues.
Simply this is my best experience purchasing a plugin in 10 years at Codecanyon. I will tell this in their plugin rating, you really deserve it.
Thank you again!Sincerely,
Marianomarianogi
ParticipantHi!, thank you again for your concern and help.
“if the chart script is getting the data through its own request it might not include the session cookie” -> I agree with you, but I didn’t know that could be possible: to make a call to that script without session variables, in the same server.
“Does it work if you visit the form-desigualdad-API.php directly?” -> yes, “form-desigualdad-API.php” works when I call it directly, but with parameters, of course, not with session variables. That’s why I thought that maybe WordPress is killing the session variables before the API call.“if it’s possible to forward the cookie with the chart script data request”, I think I don’t understand what you mean. If you mean passing the data with parameters like “form-desigualdad-API.php?entryid=X”, that’s exactly what I am doing now, and it works, as I said before. But I don’t like this solution, I prefer to use your class and session variables functionality, so my call is much cleaner (and maybe safer too).
Kind regards,
Mariano- This reply was modified 3 years, 6 months ago by
marianogi. Reason: fix expression error
marianogi
ParticipantI think that maybe it is important to explain the whole workflow:
-Users fill the quform, and it automatically redirects to a results page that shows some charts.
-The chart plugin can get dynamic data from an API URL in JSON, but I need that API URL to be unique to show only the user results, I mean, by his/her entry_id.
-I am resolving this by now with shortcodes, using you session variables between “add_filter(‘quform_post_process_1′” and “add_shortcode(“. So the shortcode returns a customized URL with the entry_id-All this wouldn’t be necessary if the second file could get the session variable the same way the “add_shortcode” does. And I think it would be a bit safer because I don’t like to use variables in the API URL call if they are not necessary.
I hope I have explained it well, thank you again and again.
marianogi
ParticipantHi Ally, thank you again for helping me with this.
I can confirm that the domain doesn’t change at all. Not even the folder changes, both PHP scripts are in the same folder.
I have sent the admin credentials through your feedback form.
Let me explain a bit where is that code:
I create a plugin to handle all this named “QuForm – Personalización” (at ‘form-desigualdad’ folder). The file that stores the session variable is “form-desigualdad.php” and the file that should get it is “form-desigualdad-API.php”. In this file, I have commented all the session code. You can uncomment it to make your tests.
Thank you very much!
marianogi
ParticipantHi, thank you for your super fast response. It does not work for me. I could check that it loads the Quform class because it passes the
if ( ! class_exists('Quform'))
, but after that, I try to get the session and form with$session = Quform::getService('session');
$form = $session->get('formulario');
and it does not pass theif ( ! $form instanceof Quform_Form)
.Could it be that something is destroying your session variables?
Thanks again!
marianogi
ParticipantI solved it by changing the “Scroll offset” value.
- This reply was modified 2 years, 8 months ago by
- AuthorPosts