getting Custom field value in contact form 7 in wordpress - wordpress

in my website i have a page that shows the job openings. Each job opening is done it as post. So when you click on a job opening it will goes to the detail page and shows the full details.All the job detail page have a unique job id and it is entering using a custom field in the admin using toolset. Then all the detail page have a contact form also for send there resume.so what i need is when sending the mail i need to pass the job id as an hidden field and it should be shown in the mail.
what i tried is
1
<?php echo do_shortcode( '[contact-form-7 id="983" title="contact 1" job ID="'.get_field( 'job-id' ).'"]' ); ?>
i tried this for getting the custom field value along with the shortcode....
i also tried this
2
[hidden hidden-948 "wpcf-job-id"]
i tried this to get the custom field value in the contact form 7 itself but both the codes didn't work for me .....
is there any way to get the custom field value in contact form 7....
Thanks in advance

You Can use this plugin to add custom fields in contact form 7 form
https://wordpress.org/plugins/advanced-custom-fields-contact-form-7-field/

Related

Adding a Advanced Custom Field to Woocommerce users My Account Page

I am using admin columns together with ACF (advanced custom fields)
in the backend I created a field in ACF for just some text, now with admin columns I made this field viewable in the backend for me to add some text that I want .
Now I want to display this text in the my-account page on the frontend.
now I got this far that i added the snippet code to the account page and that works .
But it's only displaying the DEFAULT value I have filled in in ACF and not the value I have entered in the admin custom column backend.
so to clarify even more in my users backend page i give the user a string of text.
That text needs to be displayed in the frontend on the users account
So all users should have a different string of text. The text I can add using admin columns
thats no problem but its only displaying (echo,printing) this text that I have filled in there to the woocommerce account page is not working.
Again I only get the default result text from ACF there not the text I had put in.
For getting default message the code that I use now is:
<?php echo the_field('ethwallet'); ?>
This is giving me the default message right now. not the result that I entered in the backend.
I realize this is an older question, but I wanted to provide an answer as it has been viewed several hundred times.
To retrieve custom meta data (specifically ACF field data) from a User object you need to pass in the current user ID as a second parameter to the get_field or the_field function.
Like so:
<?php echo get_field( 'ethwallet', 'user_' . get_current_user_id() ); ?>
The way it works is that ACF needs the second parameter formatted as user_X, where X is the actual ID of the user (1, 347, whatever). So we concatenate the string part ('user_') with the actual ID of the logged in user and that forms the full parameter to pass to the_field() or get_field().
P.S. It's a minor detail, but in this case echo the_field(); is redundant because the_field() echoes its values by default. You could likely omit the echo or do echo get_field();

Submit form from Backend in contact form 7

I need help I R & D many contact form plugin's but not found any one working
My requirements are I want contact form to be submitted by Front end as well as backend
[contact-form-7 id="345"]
If I used this above shortcode in backend it display error
Please Help
Is their any way to add new tab on contact form 7 plugin and submit contact form 7 from admin dashboard
Thank You For Help In advance
First of all insert a contact form shortcode into your template file directly. You will need to pass the code into do_shortcode() function.
For Example:
<?php echo do_shortcode('[contact-form-7 id="345"]'); ?>

Generate custom dynamic URL in Contact Form 7 body

I need to add in the contact form body a custom filter. I was reading through the custom code to be written in functions.php but I wasn’t clear on how to use it for my case.
I have the following situation. I have yith plugin which has this code
<?php echo apply_filters( 'yith_wcwl_email_share_body', urlencode( $share_link_url ) ) ?>
This code generates a specific URL that can be shared in social networks and by email. I want to send this URL not through the share function, but as a part of the Contact Form 7.
Can anyone help me implement this code so the dynamically generated url from this code will be sent by email when Contact form 7 is compiled and sent?

CFDB plugin : Preventing Duplicate Submissions from CF7

I have a form where user add his email address, I’m trying to prevent users to enter there email many times. I use "contact form to database plugin" to save email address and export them to excel. while searching on internet I found this solution (link below) but I can’t get it work can you help me please :
https://cfdbplugin.com/?page_id=904
Thanks
I found the solution,
in the line where you put the name of the form you should put the title of the form (line bellow ) :
$formName = 'email_form'; // Change to name of the form containing this field
so, for exemple if we have created with the contact form 7 a form here is the shortcode that we will have :
<?php echo do_shortcode( '[contact-form-7 id="69" title="Email_form" html_name="my_form"]' ); ?>
what I did is I put the value of html_name in the script of CFDB but when I changed to the value of title it works

Woocommerce product form fields

I would like my product page that customers fill 5 text fields and choose 1 field type radio.
So my product page is a form where customers ask a question, fill some information and choose a paid option.
Like this french page => http://www.avocat-bervard.com/paiement-honoraires-consultation-juridique/
Is it possible with Woocommerce ?
If so, can you explain me how ?
Thanks.
You can create nice forms with plugin Ninja Forms :). Its a very cool plugin, with a couple of settings: sending emails, when submitting forms, etc.
It is also supports shortcodes, with this method you can implement your form on every single product page, or even display it in a widget area.
For widget area:
You need to enable shortcodes first in functions.php
add_filter('widget_text', 'do_shortcode');
Then call the shortcode in Appearence - Widgets
For template:
You need to edit the file where you want this form to display, single-product.php, meta.php :) etc.
To insert shortcode in template file you need to use the below code:
<?php echo do_shortcode( $content ) ?>

Resources