From fb2700933961d33548b908f423ea5341f09e46c2 Mon Sep 17 00:00:00 2001 From: Kevin Adametz Date: Fri, 14 Aug 2020 18:32:41 +0200 Subject: [PATCH] cart responsive, Checkout from cart --- .idea/workspace.xml | 46 ++- .../Controllers/User/CustomerController.php | 2 + app/Http/Controllers/User/OrderController.php | 94 ++----- app/Http/Controllers/Web/CardController.php | 5 + .../Controllers/Web/CheckoutController.php | 155 +++++++--- app/Http/Middleware/Checkout.php | 9 +- app/Models/ShoppingInstance.php | 3 +- app/Models/ShoppingUser.php | 5 + app/Services/HTMLHelper.php | 11 + app/Services/Util.php | 4 +- app/Services/Yard.php | 33 +-- ...195012_create_shopping_instances_table.php | 2 + ..._23_161530_create_shopping_users_table.php | 6 + .../views/admin/customer/_edit.blade.php | 3 + resources/views/web/templates/card.blade.php | 266 +++++++++++------- .../views/web/templates/checkout.blade.php | 120 +++++++- .../web/user/layouts/application.blade.php | 56 ---- 17 files changed, 501 insertions(+), 319 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5005720..2471186 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,32 +5,23 @@ - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + - + @@ -612,21 +606,21 @@ - + - + - + - - + + diff --git a/app/Http/Controllers/User/CustomerController.php b/app/Http/Controllers/User/CustomerController.php index f1affca..5149c49 100755 --- a/app/Http/Controllers/User/CustomerController.php +++ b/app/Http/Controllers/User/CustomerController.php @@ -90,6 +90,7 @@ class CustomerController extends Controller if(old('switcher-without-email') === 'true'){ $step = 1; $shopping_user->same_as_billing = true; + $shopping_user->faker_mail = true; $billing_email = time()."@faker-mivita.care"; } } @@ -170,6 +171,7 @@ class CustomerController extends Controller } } + $data['faker_mail'] = isset($data['faker_mail']) ? true : false; $data['has_buyed'] = isset($data['has_buyed']) ? true : false; $data['subscribed'] = isset($data['subscribed']) ? true : false; //subscribed can only true when has_buyed ist active diff --git a/app/Http/Controllers/User/OrderController.php b/app/Http/Controllers/User/OrderController.php index 946d8e7..d763507 100755 --- a/app/Http/Controllers/User/OrderController.php +++ b/app/Http/Controllers/User/OrderController.php @@ -5,8 +5,11 @@ namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\Product; use App\Models\ShippingCountry; +use App\Models\ShoppingInstance; use App\Models\ShoppingOrder; use App\Models\ShoppingUser; +use App\Models\UserHistory; +use App\Services\Util; use App\User; use Auth; use Request; @@ -113,7 +116,6 @@ class OrderController extends Controller } public function payment($for, $id=null){ - $data = Request::all(); $user = User::find(Auth::user()->id); @@ -131,79 +133,39 @@ class OrderController extends Controller return back()->withErrors($validator)->withInput(Request::all()); } - if($for === 'me'){ - if(Request::get('switchers-comp-product')) { - $product = Product::find(Request::get('switchers-comp-product')); - Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, ['image' => '', 'slug' => $product->slug, 'weight' => 0]); - } + do { + $identifier = Util::getToken(); + } while( ShoppingInstance::where('identifier', $identifier)->count() ); + $data['is_from'] = 'user_order'; + $data['is_for'] = $for; + $data['shopping_user_id'] = $id; + unset($data['quantity']); + unset($data['_token']); - } - // Yard::instance('shopping')->destroy(); + ShoppingInstance::create([ + 'identifier' => $identifier, + 'user_shop_id' => 1, //is first faker shop for buy intern + 'auth_user_id' => Auth::user()->id, + 'payment' => 2, //Berater Shop + 'subdomain' => url('/'), + 'country_id' => Yard::instance('shopping')->getShippingCountryId(), + 'shopping_data' => $data, + 'back' => url()->previous(), - return back()->withInput(Request::all()); - - if($for === 'ot' && $id){ - dd($data); - - } + ]); + Yard::instance('shopping')->store($identifier); - Yard::instance('shopping')->destroy(); - $product = Product::find(Request::get('switchers-package-wizard')); - $showAboOptions = false; - if(Request::get('abo_options')){ - $showAboOptions = true; - $user->abo_options = true; - $user->save(); - } + //add to DB + $path = route('checkout.checkout_card', ['identifier'=>$identifier]); + UserHistory::create(['user_id' => $user->id, 'action'=>'user_order_payment', 'status'=>1, 'product_id'=>null, 'identifier'=>$identifier, 'abo_options'=>0]); + //$path = str_replace('http', 'https', $path); + return redirect()->secure($path); - if($product && $product->active && $product->show_at == 3){ - //set membership product - $image = ""; - if($product->images->count()){ - $image = $product->images->first()->slug; - } - - - //set onboarding products - if(Request::get('products_on_board')){ - foreach (Request::get('products_on_board') as $product_on_board_id){ - $product_on_board = Product::find($product_on_board_id); - $image = ""; - if($product_on_board->images->count()){ - $image = $product_on_board->images->first()->slug; - } - Yard::instance('shopping')->add($product_on_board->id, $product_on_board->getLang('name'), 1, $product_on_board->price, ['image' => $image, 'slug' => $product_on_board->slug, 'weight' => $product_on_board->weight]); - } - } - - do { - $identifier = Util::getToken(); - } while( ShoppingInstance::where('identifier', $identifier)->count() ); - - ShoppingInstance::create([ - 'identifier' => $identifier, - 'user_shop_id' => 1, //is first faker shop for buy intern - 'auth_user_id' => Auth::user()->id, - 'payment' => 4, //Berater Wizard - 'subdomain' => url('/'), - 'country_id' => Yard::instance('shopping')->getShippingCountryId(), - - ]); - Yard::instance('shopping')->store($identifier); - //add to DB - $path = route('checkout.checkout_card', ['identifier'=>$identifier]); - UserHistory::create(['user_id' => $user->id, 'action'=>'wizard_payment', 'status'=>1, 'product_id'=>$product->id, 'identifier'=>$identifier, 'abo_options'=>$showAboOptions]); - //$path = str_replace('http', 'https', $path); - return redirect()->secure($path); - - } - - \Session()->flash('alert-error', "Fehler beim Produkt"); - return back(); } private function checkShoppingCountry($for, $id=null){ + $country_id = null; if($for === 'me'){ $user = User::find(\Auth::user()->id); diff --git a/app/Http/Controllers/Web/CardController.php b/app/Http/Controllers/Web/CardController.php index c945f08..0dacd10 100755 --- a/app/Http/Controllers/Web/CardController.php +++ b/app/Http/Controllers/Web/CardController.php @@ -101,12 +101,17 @@ class CardController extends Controller $identifier = Util::getToken(); } while( ShoppingInstance::where('identifier', $identifier)->count() ); + $data = []; + $data['is_from'] = 'shopping'; + ShoppingInstance::create([ 'identifier' => $identifier, 'user_shop_id' => $user_shop->id, 'payment' => 1, 'subdomain' => url('/'), 'country_id' => Yard::instance('shopping')->getShippingCountryId(), + 'shopping_data' => $data, + 'back' => url()->previous(), ]); Yard::instance('shopping')->store($identifier); diff --git a/app/Http/Controllers/Web/CheckoutController.php b/app/Http/Controllers/Web/CheckoutController.php index cf44410..b432ba1 100755 --- a/app/Http/Controllers/Web/CheckoutController.php +++ b/app/Http/Controllers/Web/CheckoutController.php @@ -37,31 +37,117 @@ class CheckoutController extends Controller public function checkout(){ + // dd("back"); // $user_shop = Util::getUserShop(); + $shopping_data = Yard::instance('shopping')->getYardExtra('shopping_data'); + + $is_from = isset($shopping_data['is_from']) ? $shopping_data['is_from'] : 'shopping'; + $is_for = isset($shopping_data['is_for']) ? $shopping_data['is_for'] : false; + $shopping_user = null; + + if($shopping_data && $is_from !== 'shopping'){ + //$shopping_user_id = isset($shopping_data['shopping_user_id']) ? $shopping_data['shopping_user_id'] : false; + $shopping_user = $this->shoppingUserAuthData($is_from, $is_for, $shopping_data); + + }elseif($is_from === 'shopping') { + $shopping_user = new ShoppingUser(); + $shopping_user->is_for = $is_for; + $shopping_user->is_from = $is_from; + } + + + if(Request::get('selected_country')){ - Yard::instance('shopping')->setShippingCountryWithPrice(Request::get('selected_country')); + //Yard::instance('shopping')->setShippingCountryWithPrice(Request::get('selected_country'), $is_for); }else{ + $shopping_user->billing_state = Yard::instance('shopping')->getShippingCountryId(); + $shopping_user->shipping_state = Yard::instance('shopping')->getShippingCountryId(); // $ShippingCountry = ShippingCountry::where('country_id', 1)->first(); // $selected_country = $ShippingCountry->id; } + if(!$this->getPayments('shopping_user_id') && Util::getAuthUser()){ - $user = Util::getAuthUser(); - $user->email; - $shopping_user = new ShoppingUser(); - $shopping_user->auth_user_id = $user->id; - $shopping_user->billing_salutation = $user->account->salutation; - $shopping_user->billing_company = $user->account->company; - $shopping_user->billing_firstname = $user->account->first_name; - $shopping_user->billing_lastname = $user->account->last_name; - $shopping_user->billing_address = $user->account->address; - $shopping_user->billing_address_2 = $user->account->address_2; - $shopping_user->billing_zipcode = $user->account->zipcode; - $shopping_user->billing_city = $user->account->city; - $shopping_user->billing_country_id = $user->account->country_id; - $shopping_user->billing_phone = $user->account->phone; - $shopping_user->billing_email = $user->email; - $shopping_user->accepted_data_checkbox = 1; + //$user->email; + + // $shopping_user->save(); + // $this->putPayments('shopping_user_id', $shopping_user->id); + }else{ + //$shopping_user = ShoppingUser::findOrNew($this->getPayments('shopping_user_id')); + } + + if(Util::getAuthUser()){ + $shopping_user->abo_options = Util::getUserHistoryValue('abo_options'); + //$shopping_user->save(); + } + + if($shopping_user->same_as_billing === NULL){ + $shopping_user->same_as_billing = true; + } + $data = [ + 'is_from' => $is_from, + 'is_for' => $is_for, + 'user_shop' => Util::getUserShop(), + 'shopping_user' => $shopping_user, + 'shopping_mode' => Util::getUserShoppingMode(), + ]; + return view('web.templates.checkout', $data); + } + + private function shoppingUserAuthData($is_from, $is_for, $data = []){ + + $user = Util::getAuthUser(); + $shopping_user = new ShoppingUser(); + $shopping_user->auth_user_id = $user->id; + + $shopping_user->billing_salutation = $user->account->salutation; + $shopping_user->billing_company = $user->account->company; + $shopping_user->billing_firstname = $user->account->first_name; + $shopping_user->billing_lastname = $user->account->last_name; + $shopping_user->billing_address = $user->account->address; + $shopping_user->billing_address_2 = $user->account->address_2; + $shopping_user->billing_zipcode = $user->account->zipcode; + $shopping_user->billing_city = $user->account->city; + $shopping_user->billing_country_id = $user->account->country_id; + $shopping_user->billing_phone = $user->account->phone; + $shopping_user->billing_email = $user->email; + $shopping_user->faker_mail = false; + $shopping_user->accepted_data_checkbox = 1; + $shopping_user->is_for = $is_for; + $shopping_user->is_from = $is_from; + //Lieferadresse + if($is_from === 'user_order'){ + if(isset($data['shopping_user_id']) && $data['is_for'] === 'ot'){ + $s_user = ShoppingUser::findOrFail($data['shopping_user_id']); + $shopping_user->billing_salutation = $s_user->billing_salutation; + $shopping_user->billing_company = $s_user->billing_company; + $shopping_user->billing_firstname = $s_user->billing_firstname; + $shopping_user->billing_lastname = $s_user->billing_lastname; + $shopping_user->billing_address = $s_user->billing_address; + $shopping_user->billing_address_2 = $s_user->billing_address_2; + $shopping_user->billing_zipcode = $s_user->billing_zipcode; + $shopping_user->billing_city = $s_user->billing_city; + $shopping_user->billing_country_id = $s_user->billing_country_id; + $shopping_user->billing_phone = $s_user->billing_phone; + $shopping_user->billing_email = $s_user->billing_email; + $shopping_user->faker_mail = $s_user->faker_mail; + $shopping_user->shopping_user_id = $data['shopping_user_id']; + $shopping_user->member_id = $s_user->member_id; + } + + $shopping_user->same_as_billing = false; + $shopping_user->shipping_salutation = isset($data['shipping_salutation']) ? $data['shipping_salutation'] : ''; + $shopping_user->shipping_company = isset($data['shipping_company']) ? $data['shipping_company'] : ''; + $shopping_user->shipping_firstname = isset($data['shipping_firstname']) ? $data['shipping_firstname'] : ''; + $shopping_user->shipping_lastname = isset($data['shipping_lastname']) ? $data['shipping_lastname'] : ''; + $shopping_user->shipping_address = isset($data['shipping_address']) ? $data['shipping_address'] : ''; + $shopping_user->shipping_address_2 = isset($data['shipping_address_2']) ? $data['shipping_address_2'] : ''; + $shopping_user->shipping_zipcode = isset($data['shipping_zipcode']) ? $data['shipping_zipcode'] : ''; + $shopping_user->shipping_city = isset($data['shipping_city']) ? $data['shipping_city'] : ''; + $shopping_user->shipping_country_id = isset($data['shipping_state']) ? $data['shipping_state'] : ''; + $shopping_user->shipping_phone = isset($data['shipping_phone']) ? $data['shipping_phone'] : ''; + + }else{ $shopping_user->same_as_billing = $user->account->same_as_billing; $shopping_user->shipping_salutation = $user->account->shipping_salutation; $shopping_user->shipping_company = $user->account->shipping_company; @@ -73,29 +159,28 @@ class CheckoutController extends Controller $shopping_user->shipping_city = $user->account->shipping_city; $shopping_user->shipping_country_id = $user->account->shipping_country_id; $shopping_user->shipping_phone = $user->account->shipping_phone; - $shopping_user->save(); - $this->putPayments('shopping_user_id', $shopping_user->id); - }else{ - $shopping_user = ShoppingUser::findOrNew($this->getPayments('shopping_user_id')); - } - if(Util::getAuthUser()){ - $shopping_user->abo_options = Util::getUserHistoryValue('abo_options'); - $shopping_user->save(); } - if($shopping_user->same_as_billing === NULL){ - $shopping_user->same_as_billing = true; - } - $data = [ - 'user_shop' => Util::getUserShop(), - 'shopping_user' => $shopping_user, - 'shopping_mode' => Util::getUserShoppingMode(), - ]; - return view('web.templates.checkout', $data); + return $shopping_user; } public function checkoutFinal(){ + + $data = Request::all(); + + if(isset($data['selected_country']) && $data['selected_country'] === 'change'){ + + if(Request::get('same_as_billing')){ + Yard::instance('shopping')->setShippingCountryWithPrice($data['billing_state'], $data['is_for']); + }else{ + Yard::instance('shopping')->setShippingCountryWithPrice($data['shipping_state'], $data['is_for']); + } + return back()->withInput(Request::all()); + + } + + dd('ads'); $rules = array( 'billing_salutation' => 'required', 'billing_firstname'=>'required', @@ -299,8 +384,6 @@ class CheckoutController extends Controller private function makeShoppingUser($data){ - $data['same_as_billing'] = isset($data['same_as_billing']) ? true : false; - $data['same_as_billing'] = isset($data['same_as_billing']) ? true : false; $data['same_as_billing'] = isset($data['same_as_billing']) ? true : false; $data['accepted_data_checkbox'] = isset($data['accepted_data_checkbox']) ? true : false; diff --git a/app/Http/Middleware/Checkout.php b/app/Http/Middleware/Checkout.php index 7d572ac..6e24735 100755 --- a/app/Http/Middleware/Checkout.php +++ b/app/Http/Middleware/Checkout.php @@ -36,10 +36,17 @@ class Checkout \Session::put('auth_user', $shopping_instance->auth_user); } } + if($shopping_instance->back){ + \Session::put('back_link', $shopping_instance->back); + } Yard::instance('shopping')->destroy(); //restore yard Yard::instance('shopping')->restore($request->route('identifier')); - Yard::instance('shopping')->setShippingCountryWithPrice($shopping_instance->country_id); + + Yard::instance('shopping')->putYardExtra('shopping_data', $shopping_instance->shopping_data); + $is_for = isset($shopping_instance->shopping_data['is_for']) ? $shopping_instance->shopping_data['is_for'] : 'ot'; + Yard::instance('shopping')->setShippingCountryWithPrice($shopping_instance->country_id, $is_for); + ShoppingInstance::where('identifier', $request->route('identifier'))->delete(); $request->route()->forgetParameter('identifier'); diff --git a/app/Models/ShoppingInstance.php b/app/Models/ShoppingInstance.php index 7675005..3dc0c31 100644 --- a/app/Models/ShoppingInstance.php +++ b/app/Models/ShoppingInstance.php @@ -43,9 +43,10 @@ class ShoppingInstance extends Model protected $table = 'shopping_instances'; + protected $casts = ['shopping_data' => 'array']; protected $fillable = [ - 'identifier', 'user_shop_id', 'auth_user_id', 'payment', 'subdomain', 'country_id' + 'identifier', 'user_shop_id', 'auth_user_id', 'payment', 'subdomain', 'country_id', 'shopping_data', 'back' ]; public function user_shop() diff --git a/app/Models/ShoppingUser.php b/app/Models/ShoppingUser.php index b0d1b14..9835af1 100644 --- a/app/Models/ShoppingUser.php +++ b/app/Models/ShoppingUser.php @@ -129,6 +129,7 @@ class ShoppingUser extends Model 'billing_country_id', 'billing_phone', 'billing_email', + 'faker_mail', 'accepted_data_checkbox', 'same_as_billing', 'shipping_salutation', @@ -145,6 +146,9 @@ class ShoppingUser extends Model 'subscribed', 'notice', 'mode', + 'is_for', + 'is_from', + 'shopping_user_id', 'wp_order_number', 'wp_order_date', ]; @@ -152,6 +156,7 @@ class ShoppingUser extends Model protected $casts = [ 'notice' => 'array', 'is_like' => 'bool', + 'faker_mail' => 'bool', 'accepted_data_checkbox' => 'bool', 'same_as_billing' => 'bool', 'has_buyed' => 'bool', diff --git a/app/Services/HTMLHelper.php b/app/Services/HTMLHelper.php index 65a7558..9e886c1 100644 --- a/app/Services/HTMLHelper.php +++ b/app/Services/HTMLHelper.php @@ -317,4 +317,15 @@ class HTMLHelper } return $ret; } + + public static function getOptionRange($select, $from=1, $to=50){ + $values = range($from, $to); + $ret = ""; + foreach ($values as $value){ + $attr = ($value == $select) ? 'selected="selected"' : ''; + $ret .= '\n'; + } + return $ret; + + } } \ No newline at end of file diff --git a/app/Services/Util.php b/app/Services/Util.php index 2e2df87..14ea9c8 100644 --- a/app/Services/Util.php +++ b/app/Services/Util.php @@ -181,7 +181,9 @@ class Util if(\Session::has('user_shop')){ if(\Session::has('user_shop_domain')){ - + if(\Session::has('back_link')){ + return \Session::get('back_link'); + } if(self::getUserPaymentFor() === 3){ return \Session::get('user_shop_domain')."/user/membership"; } diff --git a/app/Services/Yard.php b/app/Services/Yard.php index b9c1f90..591de1f 100644 --- a/app/Services/Yard.php +++ b/app/Services/Yard.php @@ -21,25 +21,26 @@ class Yard extends Cart private $shipping_is_for; private $ysession; private $yinstance; + private $shopping_data = []; public function __construct(SessionManager $session, Dispatcher $events) { $this->ysession = $session; $this->yinstance = sprintf('%s.%s', 'cart', 'shipping_extras'); - if($this->getShippingExtra('shipping_price')){ - $this->shipping_price = (float) ($this->getShippingExtra('shipping_price')); + if($this->getYardExtra('shipping_price')){ + $this->shipping_price = (float) ($this->getYardExtra('shipping_price')); } - if($this->getShippingExtra('shipping_tax')){ - $this->shipping_tax = (float) ($this->getShippingExtra('shipping_tax')); + if($this->getYardExtra('shipping_tax')){ + $this->shipping_tax = (float) ($this->getYardExtra('shipping_tax')); } - if($this->getShippingExtra('shipping_country_id')){ - $this->shipping_country_id = $this->getShippingExtra('shipping_country_id'); + if($this->getYardExtra('shipping_country_id')){ + $this->shipping_country_id = $this->getYardExtra('shipping_country_id'); } - if($this->getShippingExtra('shipping_is_for')){ - $this->shipping_is_for = $this->getShippingExtra('shipping_is_for'); + if($this->getYardExtra('shipping_is_for')){ + $this->shipping_is_for = $this->getYardExtra('shipping_is_for'); } @@ -62,14 +63,14 @@ class Yard extends Cart return config('cart.tax'); } - public function putShippingExtra($key, $value){ + public function putYardExtra($key, $value){ $content = $this->getYContent(); $content->put($key, $value); $this->ysession->put($this->yinstance, $content); } - public function getShippingExtra($key){ + public function getYardExtra($key){ $content = $this->getYContent(); if ($content->has($key)){ return $content->get($key); @@ -116,10 +117,10 @@ class Yard extends Cart public function setShippingCountryWithPrice($shipping_country_id, $shipping_is_for = 'ot') { $this->shipping_country_id = $shipping_country_id; - $this->putShippingExtra('shipping_country_id', $shipping_country_id); + $this->putYardExtra('shipping_country_id', $shipping_country_id); $this->shipping_is_for = $shipping_is_for; - $this->putShippingExtra('shipping_is_for', $shipping_is_for); + $this->putYardExtra('shipping_is_for', $shipping_is_for); $this->calculateShippingPrice(); @@ -160,10 +161,10 @@ class Yard extends Cart $this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2); $this->shipping_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2); - $this->putShippingExtra('shipping_price', $this->shipping_price); - $this->putShippingExtra('shipping_tax_rate', $this->shipping_tax_rate); - $this->putShippingExtra('shipping_tax', $this->shipping_tax); - $this->putShippingExtra('shipping_price_net', $this->shipping_price_net); + $this->putYardExtra('shipping_price', $this->shipping_price); + $this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate); + $this->putYardExtra('shipping_tax', $this->shipping_tax); + $this->putYardExtra('shipping_price_net', $this->shipping_price_net); } } diff --git a/database/migrations/2019_02_21_195012_create_shopping_instances_table.php b/database/migrations/2019_02_21_195012_create_shopping_instances_table.php index a23f237..e84126c 100644 --- a/database/migrations/2019_02_21_195012_create_shopping_instances_table.php +++ b/database/migrations/2019_02_21_195012_create_shopping_instances_table.php @@ -20,6 +20,8 @@ class CreateShoppingInstancesTable extends Migration $table->unsignedTinyInteger('payment'); $table->unsignedInteger('country_id'); $table->string('subdomain'); + $table->text('shopping_data')->nullable(); + $table->string('back'); $table->primary(['identifier']); diff --git a/database/migrations/2019_02_23_161530_create_shopping_users_table.php b/database/migrations/2019_02_23_161530_create_shopping_users_table.php index f9dab52..152d91d 100644 --- a/database/migrations/2019_02_23_161530_create_shopping_users_table.php +++ b/database/migrations/2019_02_23_161530_create_shopping_users_table.php @@ -33,6 +33,7 @@ class CreateShoppingUsersTable extends Migration $table->unsignedInteger('billing_country_id'); $table->string('billing_phone')->nullable(); $table->string('billing_email')->nullable(); + $table->boolean('faker_mail')->default(false); $table->unsignedSmallInteger('orders')->nullable()->default(1); @@ -59,6 +60,11 @@ class CreateShoppingUsersTable extends Migration $table->char('mode', 4)->nullable(); + $table->char('is_for', 2)->nullable(); + $table->string('is_from', 10)->nullable(); + $table->unsignedInteger('shopping_user_id')->index()->nullable(); + + $table->unsignedInteger('wp_order_number')->nullable(); $table->timestamp('wp_order_date')->nullable(); diff --git a/resources/views/admin/customer/_edit.blade.php b/resources/views/admin/customer/_edit.blade.php index 045767e..f75d384 100644 --- a/resources/views/admin/customer/_edit.blade.php +++ b/resources/views/admin/customer/_edit.blade.php @@ -255,6 +255,8 @@ @if($isView === 'customer-add') {{ Form::hidden('billing_email_1', $billing_email) }} {{ Form::hidden('billing_email-confirm_1', $billing_email) }} + {{ Form::hidden('faker_mail', $shopping_user->faker_mail) }} +
@@ -271,6 +273,7 @@
{{ Form::text('billing_email', $shopping_user->billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email')) }} + faker_mail
diff --git a/resources/views/web/templates/card.blade.php b/resources/views/web/templates/card.blade.php index da208b6..4888edd 100644 --- a/resources/views/web/templates/card.blade.php +++ b/resources/views/web/templates/card.blade.php @@ -12,7 +12,7 @@
-

Warenkorb

+

Warenkorb

-
+
+ +

Du hast {{ Yard::instance('shopping')->count() }} Artikel in Deinem Warenkorb

+ -

Du hast {{ Yard::instance('shopping')->count() }} Artikel in Deinem Warenkorb

@if(Yard::instance('shopping')->content()->count()) @@ -130,101 +205,90 @@
- -
- - - - - - - - - - - - +
+
- @foreach(Yard::instance('shopping')->content() as $row) +
- @php($product = \App\Models\Product::find($row->id)) -
- - - - - - - - - @endforeach - -
ProduktPreisAnzahlSumme#
- @if($row->options->has('image')) - - @else - - @endif - - - {{ $row->name }} -
Inhalt: {{ $product->contents }}
-
Art.-Nr.: {{ $product->number }}
-
Lieferzeit: 1-3 Werktage
-
-
- {{ $row->price() }} € -
{{$product->getBasePriceFormattedFull()}}
-
inkl. {{ number_format($row->taxRate, 0)}}% MwSt.
-
- - -
{{ $row->subtotal() }} €
-
-
-
- - {{--
- - - -
- - Produkt - - Preis - Anzahl -
- - - @foreach(Yard::instance('shopping')->content() as $row) - @php($product = \App\Models\Product::find($row->id)) - +
- - -
{{ $row->subtotal() }}
-
× {{ $row->price() }} €
-
+ + + @foreach(Yard::instance('shopping')->content() as $row) + @php($product = \App\Models\Product::find($row->id)) + +
+ + + +
+
+
+ {{ $row->name }} +
Inhalt: {{ $product->contents }}
+
Art.-Nr.: {{ $product->number }}
+
Lieferzeit: 1-3 Werktage
+ + +
+ +
+
{{ $row->price() }} €
+
{{$product->getBasePriceFormattedFull()}}
+
inkl. {{ number_format($row->taxRate, 0)}}% MwSt.
+ +
+ +
+
+ +
+
+ {{ $row->subtotal() }} € +
+ +
+
+
+
- @endforeach -
--}} - Warenkorb löschen - + @endforeach + + + Warenkorb löschen +
{!! Form::close() !!} @@ -233,25 +297,15 @@
- -
+
@if(Yard::instance('shopping')->content()->count())

Warenkorb Summe

-
+
@@ -264,8 +318,8 @@
Versandland:
- + {!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId(), false) !!}
diff --git a/resources/views/web/templates/checkout.blade.php b/resources/views/web/templates/checkout.blade.php index 71ffe4b..235662d 100644 --- a/resources/views/web/templates/checkout.blade.php +++ b/resources/views/web/templates/checkout.blade.php @@ -98,6 +98,17 @@ display: none; } + select.form-control:not([size]):not([multiple]) { + height: 38px; + color: #6f6f6f; + font-weight: 600; + } + + .info-small { + font-size: 0.8em; + font-style: italic; + } +
@@ -135,7 +146,11 @@
- {!! Form::open(['url' => route('checkout.checkout_card_final'), 'class' => 'row clearfix', 'id'=>'']) !!} + {!! Form::open(['url' => route('checkout.checkout_card_final'), 'class' => 'row clearfix', 'id'=>'checkout_card_final']) !!} + + {!! Form::hidden('selected_country') !!} + {!! Form::hidden('is_for', $shopping_user->is_for) !!} + {!! Form::hidden('is_from', $shopping_user->is_from) !!} @if (\Session::has('elv-managemandate')) @@ -243,11 +258,12 @@
- - + {!! HTMLHelper::getCountriesForShipping($shopping_user->billing_state) !!} + Bei der Änderung des Versandlandes werden die Versandkosten neu berechnet.
@@ -398,11 +414,12 @@
- - + {!! HTMLHelper::getCountriesForShipping($shopping_user->shipping_state) !!} + Bei der Änderung des Landes werden die Versandkosten neu berechnet.
@@ -681,9 +698,6 @@

Sind alle Deine Angaben vollsätndig ausgefüllt, klicke auf "Jetzt kaufen" und Du wist zu unserem Zahlungsanbieter weitergeleitet, die Verbindung wird ist SSL verschlüsselt.

- - -
@@ -697,4 +711,90 @@ +@endsection + +@section('scripts') + + + + + + @endsection \ No newline at end of file diff --git a/resources/views/web/user/layouts/application.blade.php b/resources/views/web/user/layouts/application.blade.php index 0cd7ae2..a33723a 100644 --- a/resources/views/web/user/layouts/application.blade.php +++ b/resources/views/web/user/layouts/application.blade.php @@ -78,63 +78,7 @@ @yield('scripts') - {{--