I am using WooCommerce Subscription and One Page Checkout plugins.
I am able to unset billing first name and last name (and even set ‘required’ attribute to false
, so both fields are successively removed from my One page checkout.
But when I fill all other fields and I place order, it displays a validation error notice: "Billing First Name and Last Name are required" and I am not really sure how to solve this problem?
Maybe it has been set again from some functions or so? How I can solve this?
3
Answers
I have solved the issue already. The root cause is because one plugin always required Billing First Name and Last Name so I use this tip below to passby the problem:
I included this code into function.php of the theme:
So now your first name and your last name is always set as 'newSubscriber', it will pass the validation and now you hide it from dislaying using css:
}
paste these css into appearance -> Theme-> yourtheme-> additional css and save it.
So now everything would work as charm. Hope it would help somebody struggling with the problem.
Have you tried removing it manually via child function.php as below?
To remove billing first name and last name without any issues in checkout page, try to use the following instead:
Code goes in functions.php file of the active child theme (or active theme). Tested and works…
It should works with One Page Checkout plugin too.