Hi @inomi13
Thanks for getting in touch and for using the free version of WaterWoo.
function fetch_custom_checkout_field( $input, $order_id, $product_id ) {
// when we find [ORDER_ID] in a watermark, replace it with the order CPF
$input = preg_replace( '/\[ORDER_ID\]/', $order_id, $input );
return $input;
}
add_filter( 'wwpdf_filter_overlay', 'fetch_custom_checkout_field', 10, 3 );
add_filter( 'wwpdf_filter_footer', 'fetch_custom_checkout_field', 10, 3 );
Use [ORDER_ID] as your shortcode. Put this code in your child theme functions.php file or insert it using the Code Snippets plugin if you don’t know how to edit PHP files.
This code was a really easy “gimme” based on code on our blog, so I shared it for you. Please keep in mind, though, any further troubleshooting or customization of free plugins will be up to you. My plugins are all offered as-is, particularly the free ones. Many people find the plugin doesn’t do *exactly* what they want/need, but with some work, they figure out how to customize using included filter/action hooks. I do not offer free customization of them, nor do I currently have time to contract my services. You can ask for further help with this code at jobs.wordpress.net and I also recommend codeable.io.