From: Konrad Rosenbaum Date: Sun, 27 Sep 2015 18:56:51 +0000 (+0200) Subject: fix order bug: check flags of eventprice (corrected) instead of pricecategory (wrong) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=c72f845ef79b6806d219b6d528dbd5a2c5592614;p=web%2Fkonrad%2Fsmoke.git fix order bug: check flags of eventprice (corrected) instead of pricecategory (wrong) --- diff --git a/www/inc/wext/cart.php b/www/inc/wext/cart.php index 718d271..0ac1b9d 100644 --- a/www/inc/wext/cart.php +++ b/www/inc/wext/cart.php @@ -232,14 +232,16 @@ class WOCartOrder extends WOCartOrderAbstract $ret=false; continue; } - //check that we have the right to sell this category - if(!array_key_exists($pcid,$pcat)) - $pcat[$pcid]=$session->checkFlags(WTpricecategory::getFromDB($pcid)->flags); - if(!$pcat[$pcid]){ - $tick->setstatus(WOCartTicket::Invalid); - $ret=false; - continue; - } + //check that we have the right to sell this category for this event + if(!array_key_exists($evid,$pcat)) + $pcat[$evid]=array(); + if(!array_key_exists($pcid,$pcat[$evid])) + $pcat[$evid][$pcid]=$session->checkFlags($tick->geteventprice()->getflags()); + if(!$pcat[$evid][$pcid]){ + $tick->setstatus(WOCartTicket::Invalid); + $ret=false; + continue; + } //set the price $tick->setprice($evprice[$evid][$pcid]); //check enough seats for event