Ejemplo n.º 1
0
                }
            }
        }
    }
    $pdb->rollback();
    $pdb->autoCommit(true);
    $ACTION = OP_GET_SHIP_ADDR;
} elseif (isset($_POST['f_ship_method']) and $ACTION == OP_PICK_SHIP) {
    if (empty($_POST['f_ship_method'])) {
        $errs[] = "Please choose one of the shipping methods provided";
    } else {
        // we saved our last set of quotes in the session to check for tampering
        $sess::register('shipquotes');
        if (!in_array($_POST['f_ship_method'], array_keys($shipquotes))) {
            trigger_error("Selected shipmethod was not a valid selection", E_USER_ERROR);
        } elseif (!($res = cmShipping::parse_shipmethod($_POST['f_ship_method']))) {
            trigger_error("could not parse the requested ship method", E_USER_ERROR);
        }
        list($ship_method, $ship_total) = $res;
        $SUCCESS = $cart->store(array('ship_total' => $ship_total, 'ship_method' => $ship_method));
        if ($SUCCESS) {
            $sess::unregister('shipquotes');
            // forget those old quotes, for safety
            header("Location: {$_SERVER['PHP_SELF']}?billing\n");
            exit;
        }
    }
} elseif ($ACTION == OP_ADD_BILL) {
    // save the comments on billing/shipping eitheway, its shared
    if (!empty($_POST['f_user_comments'])) {
        $cart->set_user_comment($_POST['f_user_comments']);