Order Service
--
-
- - Order Service - -
-
+
- + Order Service + +
diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index eb1503f..624a84f 100644 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -40,9 +40,7 @@ class OrderController extends Controller public function submit(Request $request) { - Validator::make($request->all(),[ - 'product_id'=>'required|exists:ab_product,id', - ]) + Validator::make($request->all(),['product_id'=>'required|exists:ab_product,id']) // Reseller ->sometimes('account_id','required|email',function($input) use ($request) { return is_null($input->account_id) AND is_null($input->order_email_manual); @@ -63,15 +61,13 @@ class OrderController extends Controller // Check we have the custom attributes for the product $options = $po->orderValidation($request); - if ($request->input('order_email_manual')) - { + if ($request->input('order_email_manual')) { $uo = User::firstOrNew(['email'=>$request->input('order_email_manual')]); // If this is a new client - if (! $uo->exists) - { + if (! $uo->exists) { // @todo Make this automatic - $uo->site_id = config('SITE')->id; + $uo->site_id = config('SITE')->site_id; $uo->active = FALSE; $uo->firstname = ''; $uo->lastname = ''; @@ -83,12 +79,11 @@ class OrderController extends Controller } // If we have a new account. - if (is_null($request->input('account_id'))) - { + if (is_null($request->input('account_id'))) { $ao = new Account; //$ao->id = Account::NextId(); // @todo Make this automatic - $ao->site_id = config('SITE')->id; + $ao->site_id = config('SITE')->site_id; $ao->country_id = config('SITE')->country_id; // @todo This might be wrong $ao->language_id = config('SITE')->language_id; // @todo This might be wrong $ao->currency_id = config('SITE')->currency_id; // @todo This might be wrong @@ -102,15 +97,15 @@ class OrderController extends Controller $so = new Service; // @todo Make this automatic - $so->site_id = config('SITE')->id; + $so->site_id = config('SITE')->site_id; $so->product_id = $request->input('product_id'); $so->order_status = 'ORDER-SUBMIT'; $so->orderby_id = Auth::id(); $so->model = get_class($options); - if ($options->order_info) - { + if ($options->order_info) { $so->order_info = $options->order_info; + unset($options->order_info); } diff --git a/app/Traits/OrderServiceOptions.php b/app/Traits/OrderServiceOptions.php index e7b4148..24781b4 100644 --- a/app/Traits/OrderServiceOptions.php +++ b/app/Traits/OrderServiceOptions.php @@ -43,7 +43,7 @@ trait OrderServiceOptions $o->forceFill(array_undot($x)); // @todo Make this automatic - $o->site_id = config('SITE')->id; + $o->site_id = config('SITE')->site_id; return $o; } diff --git a/resources/views/theme/frontend/metronic/order.blade.php b/resources/views/theme/frontend/metronic/order.blade.php index 2229619..d9496c7 100644 --- a/resources/views/theme/frontend/metronic/order.blade.php +++ b/resources/views/theme/frontend/metronic/order.blade.php @@ -1,263 +1,267 @@ -@extends('layouts.app') +@extends('metronic::layouts.app') @section('htmlheader_title') - {{ trans('message.home') }} + Order Service @endsection @section('main-content') -