Exemplo n.º 1
0
     $mainframe->redirect("index.php?option=com_caddy&action=checkout");
     break;
 case "allconfirm":
     $errors = checkerrors();
     $cfg = new sc_configuration();
     if ($errors == 0) {
         $cart = new cart2();
         $mycart = $cart->readCart();
         $ship['enabled'] = $cfg->get('shippingenabled');
         if ($ship['enabled']) {
             $ship['region'] = JRequest::getVar('shipRegion');
             $ship['cost'] = fshipping::calculateShipCost(fshipping::getTotalPointsFromCart($mycart), $ship['region']);
         }
         // store the order first
         $order = new orders();
         $orderid = $order->store_new_order($mycart, $ship);
         $usePayPal = $cfg->get("usepaypal");
         if ($usePayPal == 1) {
             $gateway = $cfg->get("pgclassname");
             if ($gateway != "") {
                 // check the gateway filename
                 if (!class_exists($gateway)) {
                     $pgpath = dirname($mainframe->getPath('class'));
                     $pgfile = $pgpath . DS . $gateway . ".class.php";
                     // filename should look like "scpaypal.class.php"
                     if (!file_exists($pgfile)) {
                         echo "The classname you provided in the configuration does not correspond to a known file ({$pgfile})";
                         break;
                     }
                     require_once $pgfile;
                 }