Answer the question
In order to leave comments, you need to log in
How to add header with name in incoming order in woocommerce store?
Hello!
There is a woocommerce store . I've always wondered why there is no heading in front of the name in the order.
How can I add it and preferably without crutches that crash every time the store plugin is updated?
Answer the question
In order to leave comments, you need to log in
I decided in this way, maybe it's a little clumsy, but it works. Styles for the admin panel are needed because, for some reason, with this decision, the first and last names are displayed twice: as it was originally and already with labels.
If there are better solutions, I will note them with pleasure.
add_filter( 'woocommerce_admin_billing_fields', 'custom_admin_billing_fields', 10, 1 );
function custom_admin_billing_fields( $billing_fields ) {
$billing_fields['first_name']['show'] = true;
$billing_fields['last_name']['show'] = true;
return $billing_fields;
}
add_action('admin_head', 'my_custom_fonts');
function my_custom_fonts() {
echo '<style>
#order_data .order_data_column_container .address>p:first-of-type {
display: none;
}
</style>';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question