Home › Forums › Jevelin Theme › First/Last name not set in the checkout form
Home › Forums › Jevelin Theme › First/Last name not set in the checkout form
Email for testing: [email protected]
Password: in the private field
Site: https://cbdfactum.com
When you put a product into the shopping cart and try to check out and log in, then the first & last name fields are not set.
I tested it without any additional plugins. It doesn’t appear, so the plugins shouldn’t be the reason.
Did I misunderstand something that it is not set or should it be set with the first & last name from the account?
Hi @CBDFactum,
I hope you are well today and thank you for your question.
This is WooCommerce plugin related question so please contact the plugin support to resolve it.
Best regards,
Shufflehound team
Solution for this topic
I confirm it has nothing to do with your theme. I present here the solution so it is available for others. The code has to be placed in functions.php:
function populate_specific_checkout_field($input, $key ) {
global $current_user;
switch( $key ) {
case 'billing_first_name':
case 'shipping_first_name':
// return the first name
return $current_user->first_name;
case 'billing_last_name':
case 'shipping_last_name':
// return the last name
return $current_user->last_name;
}
}
add_filter('woocommerce_checkout_get_value', 'populate_specific_checkout_field', 15, 2 );Awesome great to see you got that resolved.
Please advise if you have more questions.
Have a fantastic day!
If you need services beyond standard support, we've got your back!
If you'd prefer not to handle the installation yourself or need help getting started, we'll set everything up for you.
We'll help you rearrange sections, adjust spacing, and modify the page structure to fit your needs.
More complex styling changes, theme option modifications, and third-party integrations.
If you need something that's not included in the theme, we can code it for you.
Web design services to create custom sections, pages, and blocks for your theme, plus graphics and visualizations.
Full website builds, custom theme development, or plugin creation from scratch.
We'll provide a clear quote based on what you need. No hidden fees.