Exemple #1
0
    $inv->emptycart();
    Redirect::to($return_url);
}
if (Input::get('check')) {
    $get = DB::getInstance()->get('tbl_goods', array('goods_id', '=', Input::get('check')));
    if ($get->count() == 0) {
        echo 0;
    } else {
        echo 1;
    }
}
//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');