Hi,
From Yesterday our customers can not send their orders thru the webshop. This error messages is displayed in the checkout?
“Fatal error: Call to undefined method WooCommerce::add_error() in /home/badbanco/public_html/wp-content/themes/vantage-child/functions.php on line 61”
It this something you can help me with?
// Eric
Hi Eric
This is being caused by some code you have placed into your child theme’s functions.php file. If possible please post the content of your child functions file here using the code tags as described below the reply box.
Thanks
Magus
Hi Eric
The issue seems to be the add_error entry in this function
This option has now been deprecated please change this function to
If you are using this option in any other functions you should also change it there
Magus
Hi,
Do you know how I can change this field setting so its not a mandatory field just a optional field?
Eric
Hi Eric
If you do not want this field to be mandatory you could just leave out the above function. This function checks for content, prompting the user to enter something if empty. If you leave out the function the check will not be made, allowing the update to continue even if nothing is in the field.
Magus
Hi,
Can we pick up this thread were we left of? I haven’t had the time or the courage to try to go into this without some more guidance. I would like to take away the mandatory on this field were costumers can add their social security number.
Can you please guide me witch row I should remove or change?
Eric
Hi Eric
Can you send ZIP your child theme, upload it to the Media Library and send me the link so I can see where we are?
Thanks
Hi Andrew,
Do you mean to my WP media library? Is it not something in the child theme’s functions.php file as mentioned above?
I’d ideally like to check your child theme out. Can you send it me? Lots of ways to do it, above was one option. What I left out was, you’d need to access your server via FTP or hosting File Manager, go to /wp-content/themes/ download “vantage-child” to your desktop. ZIP it. Then, to send it to me, upload it to your Media Library and send me the link so I can download it.
This is a private message.
All we need to do is added:
To your custom field.
Ref: http://www.portmanteaudesigns.com/blog/2015/02/04/woocommerce-custom-checkout-fields-email-backend/
I’ve made this change, here is your child theme updated:
https://siteorigin.com/wp-content/uploads/2015/09/vantage-child-eric-02.zip
Ideally just replace your child functions.php with the new one I’ve just sent. I haven’t tested that file live so it’s important you have FTP access ready in case you need to upload the backup functions.php file.
Many thank Adrew & co!
I will try this!
Eric
For sure :)
Hi! I hope you all are fine?! I took courage and time to replace the functions.php file you gave me. But this error message comes:
” Fatal error: Call to undefined method WooCommerce::add_error() in /home/badbanco/public_html/wp-content/themes/vantage-child/functions.php on line 51 “
Hi Eric
Perhaps we can take a step back and find another way to achieve the functionality you’ve tried to add in your child theme functions file. Can you confirm what you’ve added to the child theme functions file in terms of functionality?
The function is in the woocomerce checkout page and their is three different payment ways to chose:
First id by a 20 day invoice after delivery, in that case the customers must fill in this extra added field with their social security number. To be able to do a credit check.
The second alternative is prepayment before dispatch and here is should it not me mandatory to enter their social security number. And its here the error message comes the last three month if costumers don’t enter something in the social security number field. Prior that it worked.
The third payment alternative is: Payment in our store with visa or master card on pickup and without something in written in the social security number field the error message comes.
Ideally we’d find a plugin solution to assist with the above. We do our best to assist and advise with minor custom development tweaks, I think we’ve gone past that normal mark here. Let me take a quick look around and see what I can find.
It’s a premium plugin but at a glance this looks like it would resolve the challenges you’re facing:
http://www.woothemes.com/products/woocommerce-checkout-field-editor/
Here is the documentation for the plugin:
https://docs.woothemes.com/document/checkout-field-editor/
Ok. I will try this. Many thanks for your help
For sure, hopefully it can achieve everything you’re after and more.