fix order bug: check flags of eventprice (corrected) instead of pricecategory (wrong)
authorKonrad Rosenbaum <konrad@silmor.de>
Sun, 27 Sep 2015 18:56:51 +0000 (20:56 +0200)
committerKonrad Rosenbaum <konrad@silmor.de>
Sun, 27 Sep 2015 18:56:51 +0000 (20:56 +0200)
www/inc/wext/cart.php

index 718d271..0ac1b9d 100644 (file)
@@ -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