I have a plugin installed that adds a unique QR Code to each Woocommerce order. Each time the plugin calls the code in both the woocommerce 'confirmed' email template and the order template it does it like this:
I understand that I cannot display this in toolset content templates or views so I am hoping you can help me to create a little shortcode to get that image url... I am so sorry but I don't know enough php to be able to do this...
I added this shortcode to the woocommerce order template: [func_qr_img]
But... unfortunately, this displays a "There has been a critical error on this website." message as per screenshot attached.
Maybe you need more context? This is the whole php section on 'displaying the code on the order post' in the plugins php file:
Not sure what provides the value for $order but let me know if this helps. If not then you may need to seek assistance from the developers of this code to convert it to a shortcode for you.
Hi Shane
Sorry about that. I should have given you the full code in the first place.
I dropped your code into functions.php but it won't save and explains the error: "Cannot redeclare orderbarcodes_add_order_barcode() (previously declared in wp-content/plugins/pd-orderbarcodes/plugindistrict-orderbarcodes.php:89)"
What do you think?
Ok cool so I removed that first bit from functions.php. Added the shortcode [func_qr_img] to the toolset order post content template and yep it still gives the critical error as per screenshot above... Sorry!
I think it might be best to consult with the authors of the plugin for this code as they are better able to construct a shortcode for this. They will know the full context of the code and what are the core functions that are needed for this to work correctly.