The error states that there's a
}
when it wasn't expecting one. This means that for some reason your code wouldn't recognise this as a valid closing bracket, so what part of the code is expecting an opening bracket?
function wooc_extra_register_fields() {?>
This doesn't appear correct, you've not added the
<?php
like you did at the bottom part. This is why the
}
is unexpected, your code doesn't recognise the above as valid PHP.
<?php function wooc_extra_register_fields() {?>