Skip to content

Commit

Permalink
Merge pull request #34 from ReferralCandy/jasonn/fix-issue-32
Browse files Browse the repository at this point in the history
added check if rc_referrer_id cookie exists
  • Loading branch information
jsnullarc authored Apr 21, 2020
2 parents 943859d + 204314a commit 8d96b1c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion includes/class-wc-referralcandy-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
}
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion woocommerce-referralcandy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8d96b1c

Please sign in to comment.