Exemple #1
0
 public function address_content(Request $request)
 {
     $usermeta = UserMeta::where('user_id', Sentinel::getUser()->id)->where('meta_key', 'address')->first();
     $address = unserialize($usermeta->meta_value);
     $this->data['address'] = $address[$request->id];
     $this->data['province'] = Province::where('id', $this->data['address']['provinsi'])->first();
     $this->data['district'] = District::where('id', $this->data['address']['kecamatan'])->first();
     $this->data['city'] = City::where('id', $this->data['address']['kota'])->first();
     $this->data['weight'] = $request->weight;
     $costs = app('App\\Http\\Controllers\\OrderController')->get_cost($this->data['address']['kota']);
     $cost = json_decode($costs);
     $this->data['cost_data'] = serialize($cost->rajaongkir->results[0]->costs);
     return view('address_content')->with('data', $this->data);
 }
 public function checkout_order()
 {
     $this->data['css_assets'] = Assets::load('css', ['lib-bootstrap', 'style', 'font-awesome', 'color-schemes-core', 'color-schemes-turquoise', 'bootstrap-responsive', 'font-family']);
     $this->data['js_assets'] = Assets::load('js', ['jquery']);
     $this->data['provinces'] = Province::get();
     $this->data['title'] = 'Daftar Pesanan';
     return view('main_layout')->with('data', $this->data)->nest('content', 'order/checkout', array('data' => $this->data));
 }