Hey there —
“WP functions” are actually written in PHP (just for clarity on terminology).
I am not familiar with WooCommerce and the function you’ve got, however it probably needs to go into your theme’s functions.php file or a custom plugin file that you’ve deployed on your site. Be very (very!) careful when editing functions.php though – a tiny mistake can bring your whole site down and you won’t be able to get into the admin screens. Always take a backup of the file before editing, and have your FTP access info on hand so you can restore the backup on the server if something goes wrong.
The code you have includes line numbers which will create all sorts of problems. You must have copied it from a site like GitHub. When copying code from the Web, always look for the “raw” link – you need just the text. Those extra numbers will mess you up. You should go back to wherever you found this and copy just the actual function.
Regardless, all of that is just sort of background info. To get you help on whatever you’re trying to implement, you should go to the WooCommerce plugin support page here on wordpress.org http://wordpress.org/support/plugin/woocommerce or use the plugin developer’s support.
Thanks essaysnark.
Yes, I should have removed the line numbers 🙂 I am not ready yet to purchase plugin support, but will soon…until then help would be great
So, I place the function in functions.php, then what do I do?
I am not seeing tutorials on how to use functions from a plugin, just custom functions…
I saw elsewhere that there is a WC object, which I guess I would use to call the function, but as stated above have only worked in java with functions…
Help is much appreciated
Any seen a tutorial on using plugin functions?
Not sure how to do this…