Created
November 5, 2011 00:21
-
-
Save dpdexter/1340855 to your computer and use it in GitHub Desktop.
Promo validation returns false positive on disabled promotions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _validate_promo_code($code){ | |
if($code["enabled"] == 0){ return false; } | |
if($code["uses_per"] > 0){ | |
$cnt = $this->EE->promo_model->get_promo_use_count($code["code"]); | |
if($cnt >= $code["uses_per"]){ | |
return false; | |
} | |
} | |
if(date('U',strtotime($code["start_dt"])) > time()){ | |
return false; | |
} | |
if(time() > date('U',strtotime($code["end_dt"])) && $code["end_dt"] != null){ | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace the _validate_promo_code method in core.brilliant_retail.php with the code above.
File Location:
third_party/brilliant_retail/core/class/core.brilliant_retail.php