tasup
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced Custom Fields: Extended] ACF Form Submit Button HTML disappearingHi,
thanks for the quick response. I’m talking about ACFE Form!
Here is a screenshot of my configuration:
https://web.tresorit.com/l/E3ISV#bu1XOjajzeZtZ3NlixWbFAUnfortunately it disappears after save. I didn’t have problems with the plugin on other sites. I tried to disable Divi already but it didn’t make any differences.
Thanks!
PS: I like the new Form layout! Very cool with the Actions in the first tab!
Hi bengriff64,
is this form of you supposed to be for new users? Are your users created after the checkout?
If this is the case you need to add the fields with the ‘user_register’ hook manually. If there is no existing user during the checkout the form won’t do anything.
add_action('user_register', 'add_user_meta_after_registration', 10, 1 ); function add_user_meta_after_registration( $user_id ) { $children_repeater = $_POST['acf']['field_5eb42c8079c7a']; //Get the field from $_POST (note that you need the field key here) if (isset($children_repeater)){ update_field('field_5eb42c8079c7a', $children_repeater, 'user_' . $user_id); //Update the field with the ACF funtion 'update_field'. If you pass in a repeater it will create the right structure for you! } }
I hope this helps!
Kind regards.
For anybody wondering how I solved this at the moment:
add_action( 'woocommerce_after_checkout_validation', 'validate_children', 10, 2); function validate_children($fields, $errors ){ //Validate children repeater in checkout $repeater = $_POST['acf']['field_5eb42c8079c7a']; if (!is_null($repeater)) { if (!$repeater) $errors->add( 'validation', 'You must create one child at least.' ); } } }
I chose to get the ACF field from $_POST and validate it with custom conditions. When there is an error I just add it to $errors.
Thanks for your help!
Thank you for the info! I will look into that.
All the best with your plugin, I really love it. It is hassle free and intuitive ??Cheers
Hi,
unfortunately not.
I will try if I can integrate the fields with vanilla acf_form or just the fields and see if this is still happening. I will let you know what my results are.
Cheers
Hi,
thanks for coming back to me.
– It’s a JS error
– It’s happening on the checkout page
– it is logged by checkout.min.js
Unable to fix malformed JSON – checkout.min.js:1:9995– The ajax call is wc-checkout. It seems that I’m getting back html-data:
<h2>überprüfung fehlgeschlagen</h2><ul><li>Es muss mindestens ein Kind ausgew?hlt werden.</li></ul>
– When I remove field groups or set them as not required the error is not there anymore, but unfortunately I need the fields to be required.
Please let me know if you have any questions.
Regards
thanks for the response. This redirection is already taking place because I configured it in the page settings for restricted access. Nevertheless, when the user clicks on the “Register Button” which is provided by the Login Form the redirection info gets lost because he is leaving the login site. So the redirection sucessfully works when the user logs in, but not when he wants to create a new account.
Regards
Hi,
thanks for the quick reply.
Yes, I’ve seen that and it’s great when there is a fixed redirection after registration.I will describe the process better:
There are two landing pages for users, Registration and Submission.On the registration page the user can click several buttons and, depending on the button, create a user account with a different role (‘Parent’, ‘Child’ etc.)
On the submission page a user can click on a button and he might or might not (depending on the button) need a user to submit a form. So I would redirect him to the login if he needs a user. He can register from there and should come back to the form he wanted to submit…
I hope this is clear ??
Hi!
Thanks for the quick response – I totally missed this setting. Nevertheless it still shows the message (I’m testing with Firefox).
Any ideas on that? I might dig into the ACF JS documentation otherwise, maybe there is something to find.
Your plan for the integrations sounds amazing. I really love your work and I bet the next features will be amazing ??
Regards
EDIT:
This is how I added the form with the WC hook.add_action( 'woocommerce_after_order_notes', 'checkout_participants_field' ); function checkout_participants_field( $checkout ) { echo '<div><h2>' . __('Participants') . '</h2>'; acfe_form('checkout-participants'); echo '</div>'; }
- This reply was modified 4 years, 7 months ago by tasup.
HI Dario,
I’m sorry it took me so long to come back to you.
Thank you, my output says “Shortcode exists” but it is still not displaying. What can I provide to you for further help?
Best wishes
EDIT:
It seems to have to do something with is_main_query(). Post Grid’s content is not in the main_query by default. Do you have any workaround in mind?- This reply was modified 4 years, 8 months ago by tasup.
Hi Dario,
no worries!
Yes I have seen this already, but no success!
We used the “DP Portfolio Pro” plugin with Divi before:
https://diviplugins.com/documentation/portfolio-posts-pro/custom-content/I used this filter to display custom content and also echo the shortcode in PHP – everythiing works fine with this plugin.
Due to organisational issues we want to use Post Grid, but I had no success displaying the YASR shortcode. I used the interface described in the video (the Layout editor) but also tried returning custom PHP as a content for the grid. Nothing worked so far.
EDIT:
Dario, I tried to check if the SC exists:if ( shortcode_exists( '[yasr_visitor_votes]' ) ) { echo "The shortcode exists";}
it returns always false – any ideas?
- This reply was modified 4 years, 8 months ago by tasup.