Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.0
Something big is coming for marketplace admins… MultiVendorX 5.0 is almost here. Are you ready?
Be the first to explore all the game-changing features!
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

View Categories

Add first name and last name field in vendor registration form

Simply add the below code in the functions.php file of the current theme to add the “First name” and “Last name” in the vendor registration form and retrieve those details.

add_action('mvx_vendor_register_form', 'mvx_vendor_register_form_fields');
function mvx_vendor_register_form_fields() {
?>
<p>
<label>First Name<br/>
<input type="text" name="first_name" id="first_name" class="input" value="" size="25" tabindex="30" />
</label>
</p>
<p>
<label>Last Name<br/>
<input type="text" name="last_name" id="last_name" class="input" value="" size="25" tabindex="40" />
</label>
</p>
<?php
}
add_action('mvx_after_register_vendor', 'vendor_registration_formdata_save');
function vendor_registration_formdata_save($user_id) {
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['first_name'])) {
update_user_meta($user_id, 'first_name', sanitize_text_field($_POST['first_name']));
}
if (isset($_POST['last_name'])) {
update_user_meta($user_id, 'last_name', sanitize_text_field($_POST['last_name']));
}
}
}

Leave a Reply

Shopping Cart
Scroll to Top