Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
Hi
I been adding a custom field to the checkout page in Woocomerce av it worked fine.
But when adding a code to make this new custom field to inserted in the order email it craches my site totally.
Now i just get this message:
Parse error: syntax error, unexpected T_STRING in /home/wentorse/public_html/spatunnan.se/wp-content/themes/vantage-child/functions.php on line 78
Please help :-)
Hi Eric
No worries, this should be an easy fix. Even a tiny error in functions.php will cause this to happen. Do you have FTP access? If so, go to /wp-content/themes/vantage-child/ and download functions.php to your desktop. Then copy the contents here and I’ll take a look at what’s causing that error.
Thanks Eric.
I think we lost line spacing so I’m not sure which was the line causing this. Let’s quickly focus on this last function. Two things:
Question One
Please check the inverted commas in this function. See how in the function above it, the inverted commas are very straight but in this last function they are angled:
Correct inverted commas:
Incorrect inverted commas:
With correct inverted commas, this is how this last function should look:
Question Two
Does My Field match up to the field you’ve added?
Here are two threads discussing this function:
https://gist.github.com/mikejolley/2263203
https://gist.github.com/mikejolley/1547491
Hi Andrew! Thanks for your assistance! I am so impressed over your support!
One detail. In the mail the information in this custom field is the customers social security number coming with a header “My Field:” folowed by thesocial security number.
In witch line do I change “My Field:” to my own header text “Personnummer:” ?
For sure :) Glad to hear we’re making progress.
Looking over the functions file I see what you were trying to do there. Before we proceed and trouble shoot this I thought I’d mention this option:
http://www.woothemes.com/products/admin-custom-order-fields/
http://docs.woothemes.com/document/woocommerce-admin-custom-order-fields/
I know it’s not cheap but it would make this pretty easy.
Perhaps take a look and see if it would do what you require and if the cost is acceptable.
Alternatively I’ll try setup the above in my local child theme and see if I can’t get things working.