diff --git a/includes/class-wc-referralcandy-integration.php b/includes/class-wc-referralcandy-integration.php index 837e8fc..202cdd6 100644 --- a/includes/class-wc-referralcandy-integration.php +++ b/includes/class-wc-referralcandy-integration.php @@ -151,7 +151,7 @@ public function add_referrer_id($post_id) { try { if (in_array(get_post($post_id)->post_type, ['shop_order', 'shop_subscription'])) { // prevent admin cookies from automatically adding a referrer_id; this can be done manually though - if (is_admin() == false) { + if (is_admin() == false && isset($_COOKIE['rc_referrer_id'])) { update_post_meta($post_id, 'rc_referrer_id', $_COOKIE['rc_referrer_id']); } } diff --git a/readme.txt b/readme.txt index da2c392..17f0150 100644 --- a/readme.txt +++ b/readme.txt @@ -72,6 +72,9 @@ We maintain a list of FAQs on our [help page](http://help.referralcandy.com/)! == Changelog == += 2.2.3 = +* Fixed issue where the plugin uses the `rc_referrer_id` cookie even if non-existent + = 2.2.2 = * Fixed failing code for logging API requests diff --git a/woocommerce-referralcandy.php b/woocommerce-referralcandy.php index 730da4b..7d86691 100644 --- a/woocommerce-referralcandy.php +++ b/woocommerce-referralcandy.php @@ -6,7 +6,7 @@ * Author: ReferralCandy * Author URI: http://www.referralcandy.com * Text Domain: woocommerce-referralcandy - * Version: 2.2.2 + * Version: 2.2.3 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by