Created
April 26, 2017 17:08
-
-
Save gohanman/188d5530e65e4f968ac2ae3b898010aa to your computer and use it in GitHub Desktop.
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
switch ($infoW["minType"]) { | |
case "Q": // must purchase at least X | |
case "Q+": // must purchase more than X | |
case "Q-": // must purchase at least one, no more than X | |
$minQ = "select case when sum(ItemQtty) is null | |
then 0 else sum(ItemQtty) end | |
" . $this->baseSQL($transDB, $coupID, 'upc'); | |
$minR = $transDB->query($minQ); | |
$minW = $transDB->fetch_row($minR); | |
$validQtty = $minW[0]; | |
if ($infoW['minType'] == 'Q+' && $validQtty <= $infoW["minValue"]) { | |
return $this->errorOrQuiet(_('coupon requirements not met'), $quiet); | |
} elseif ($infoW['minType'] == 'Q' && $validQtty < $infoW['minValue']) { | |
return $this->errorOrQuiet(_('coupon requirements not met'), $quiet); | |
} elseif ($infoW['minType'] == 'Q-' && $validQtty < 1) { | |
return $this->errorOrQuiet(_('coupon requirements not met'), $quiet); | |
} | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment