Skip to content

Instantly share code, notes, and snippets.

@goranefbl
Last active August 8, 2024 12:14
Show Gist options
  • Select an option

  • Save goranefbl/f566bec448b4408adecde70e1bb964db to your computer and use it in GitHub Desktop.

Select an option

Save goranefbl/f566bec448b4408adecde70e1bb964db to your computer and use it in GitHub Desktop.
<?php
add_action('woocommerce_before_checkout_form', 'check_gens_raf_cookie_and_display_message', 10);
function check_gens_raf_cookie_and_display_message() {
if (isset($_COOKIE['gens_raf'])) {
wc_print_notice('Thank you for using a referral link! Your discount will be applied at checkout.', 'success');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment