READ FIRST: This code needs to be added at the end of the functions.php file. If you are familiar with editing functions.php, feel free to continue reading. If you haven’t done this before, adding this code in the wrong place might bring the site down and the only way to access it is by editing functions.php file again via FTP. Feel free to contact us if you need help!
If you want to write text on the checkout screen to customers coming through a referral link, add the code below to the functions.php file:
add_action('woocommerce_before_checkout_form', 'my_custom_message');
function my_custom_message() {
if ( isset($_COOKIE['gens_raf']) ) {
wc_print_notice( __('This is my custom message'), 'notice' );
}
}
Depending on your theme, customers should see something along the lines of what’s shown in the image below.