Exemple #1
0
    }
}
//add item in shopping cart
if (Input::exists() && Input::get('type') == 'search') {
    $product_code = Input::get('scan_item');
    $return_url = Crytion::decryt64(Input::get("return_url"));
    $inv->add_item($product_code);
    Redirect::to($return_url);
}
//update item
if (Input::exists() && Input::get('type') == 'update') {
    $product_code = Input::get('goods_id');
    $qty = Input::get('goods_qty');
    $discount = Input::get('goods_discount');
    $return_url = Crytion::decryt64(Input::get("return_url"));
    $inv->update_item($product_code, $qty, $discount);
    Redirect::to($return_url);
}
//global discount
if (Input::exists() && Input::get('type') == 'globaldiscount' && Input::get('return_url')) {
    $return_url = Crytion::decryt64(Input::get("return_url"));
    $discount = Input::get('setglobald');
    $inv->discountall($discount);
    Redirect::to($return_url);
}
//payment
if (Input::get('pay-type') != null && Input::get('amount') != null) {
    $return_url = Crytion::decryt64(Input::get("return_url"));
    $inv->payment(Input::get('pay-type'), Input::get('amount'));
    Redirect::to($return_url);
}
Exemple #2
0
if (Input::get('add_item') && Input::get('item') === 'add') {
    $product_code = Input::get('add_item');
    $current_url = Cryption::decryt64(Session::get("current_url"));
    $inv->add_item($product_code);
    Redirect::to($current_url);
} else {
    if (Input::exists() && Input::get('s-item') || Input::get('find-id')) {
        $product_code = Input::get('s-item') == "" ? Input::get('find-id') : Input::get('s-item');
        $current_url = Cryption::decryt64(Session::get("current_url"));
        $inv->add_item($product_code);
        Redirect::to($current_url);
    } else {
        if (Input::get('qty') && Session::exists('products')) {
            $product_code = Input::get('update_item');
            $current_url = Cryption::decryt64(Session::get("current_url"));
            $inv->update_item($product_code, Input::get('qty'));
            Redirect::to($current_url);
        } else {
            if (Input::get('removep') && Session::exists('products')) {
                $code = Input::get('removep');
                $current_url = Cryption::decryt64(Session::get("current_url"));
                $inv->remove_item(Input::get('bac'), $code);
                Redirect::to($current_url);
            } else {
                if (Input::get('detachcart') == 1) {
                    $current_url = Cryption::decryt64(Session::get("current_url"));
                    $inv->emptycart();
                    Redirect::to($current_url);
                } else {
                    if (Input::get('detachall') == 1) {
                        $current_url = Cryption::decryt64(Session::get("current_url"));