Skip to content

Instantly share code, notes, and snippets.

@dpdexter
Created November 5, 2011 00:21
Show Gist options
  • Save dpdexter/1340855 to your computer and use it in GitHub Desktop.
Save dpdexter/1340855 to your computer and use it in GitHub Desktop.
Promo validation returns false positive on disabled promotions
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;
}
@dpdexter
Copy link
Author

dpdexter commented Nov 5, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment