• Resolved calabronelampa

    (@calabronelampa)


    Hi,
    i added a new Checkbox about ” Marketing Policy ” and it works, but i want that this field will be added to the template email.

    I found the template to edit, but i don’t know how is the name of this checkbox field.

    Any suggestion ?

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • @calabronelampa well, have you stored your check box field value?

    Anyway for better help can you please share the exact modifications that you made, basically the checkbox field, where you actually put it and where you store it’s value. Without knowing these we can not guides you properly.

    Thread Starter calabronelampa

    (@calabronelampa)

    Hi,
    yes.

    Here i added the checbox field into the Vendor Setting > Section ” Vendor Registration “.

    I need the checkbox submit field should be print into template ” admin-new-vendor-account.php”. Here an example.

    Thank u.

    Thread Starter calabronelampa

    (@calabronelampa)

    Hi,
    i try to add this code on email template

    <p><?php printf( __( "Consenso del marketing: %s", 'dc-woocommerce-multi-vendor'), $user_object->wcmp_vendor_fields[0][value] ); ?></p>

    it doesn’t work.

    How can i take the new field and print it ?

    Thread Starter calabronelampa

    (@calabronelampa)

    Hi,

    i tried to add new field by function here the code.

    add_action('wcmp_vendor_register_form', 'wcmp_vendor_register_form_fields');
    
    function wcmp_vendor_register_form_fields() {
        ?>
    
        <p>        <label>test<br/>
                <input type="checkbox" name="marketing" id="marketing"/>
            </label>
        </p>
    <?php
    
    }

    I created new field on table ” wp_users ” name field ” CheckMarketing ” type ” boolean ”

    then i added this code that i found on the forum

    add_action('after_register_wcmp_vendor', 'vendor_registration_formdata_save');
    
    function vendor_registration_formdata_save($user_id) {
    
    if (isset($_POST['marketing'])) {
    			
    	$valore = 0;
                     
            }else
    		{
    			$valore = 1;
    		}
    		wp_update_user( array( 'ID' => $user_id, 'CheckMarketing' => $valore ) ); 
    }

    Can u help me to understand what is wrong ?

    @calabronelampa When a vendor registers via the registration form, we save all the details provided by them via the form, in their user_meta. So, now you have to fetch the details from their own user_id.

    After fetching the details, display them in the email.

    hi
    I did not understand. Do I have to activate the two modules to work?

    Thread Starter calabronelampa

    (@calabronelampa)

    Hi,
    thanks for the answer.

    Anyway im trying to find the field stored into wp_usermeta or wp_users tables but i can’t find it.

    Is it possible to know that exactly table ?

    I need just to find it to exexute query on template email

    Thanks.

    Thread Starter calabronelampa

    (@calabronelampa)

    HI,
    I found meta_value fields into wp_usermeta:

    a:1:{i:0;a:3:{s:5:”value”;s:2:”on”;s:5:”label”;s:9:”marketing”;s:4:”type”;s:8:”checkbox”;}}

    it contains my checkbox field, now the question is:

    Where should i find the user’s checked ?

    Thanks.

    Plugin Author Purnendu Dash

    (@purnendu)

    Hello

    You can get all the registration form data from the user_meta named “wcmp_vendor_fields”, a sample code for you, whic returns the data as an array

    
    $vendor_application_data = get_user_meta($user_id, 'wcmp_vendor_fields', true);
    

    Kindly let us know if you need any further clarification.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to show new field into new vendor account email’ is closed to new replies.