From c4ed6b39db8b5c9a399aab3353ffd75df15c424d Mon Sep 17 00:00:00 2001 From: Kevin Adametz Date: Tue, 8 Sep 2020 19:22:07 +0200 Subject: [PATCH] Erweiterungen / Korrekturen Beraterbestellungen --- .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/workspace.xml | 65 +++--- app/Http/Controllers/CustomerController.php | 9 + app/Http/Controllers/SalesController.php | 8 +- app/Http/Controllers/ShippingController.php | 3 + .../Controllers/User/CustomerController.php | 11 +- app/Http/Controllers/User/OrderController.php | 122 +++++++--- .../Controllers/Web/CheckoutController.php | 29 +-- app/Models/ShippingCountry.php | 5 + app/Models/ShippingPrice.php | 2 +- app/Models/ShoppingOrderItem.php | 1 + app/Services/HTMLHelper.php | 8 + app/Services/Yard.php | 34 +++ ...06_004849_create_shipping_prices_table.php | 1 + ...3724_create_shopping_order_items_table.php | 5 + public/js/iq-shopping-cart.js | 38 +-- resources/lang/de/navigation.php | 2 +- .../views/admin/customer/_detail.blade.php | 12 +- .../views/admin/customer/_edit.blade.php | 39 ++-- resources/views/admin/sales/_detail.blade.php | 2 +- resources/views/admin/sales/users.blade.php | 2 +- resources/views/admin/shipping/edit.blade.php | 17 +- resources/views/user/customer/add.blade.php | 3 +- resources/views/user/customer/edit.blade.php | 4 +- .../user/order/_bak_shipping_me.blade.php | 215 +++++++++++++++++ .../user/order/_bak_shipping_ot.blade.php | 210 +++++++++++++++++ .../views/user/order/comp_product.blade.php | 61 ++--- resources/views/user/order/delivery.blade.php | 2 + resources/views/user/order/index.blade.php | 2 +- resources/views/user/order/list.blade.php | 77 +++++-- .../views/user/order/shipping_me.blade.php | 187 ++------------- .../views/user/order/shipping_ot.blade.php | 218 +++--------------- .../views/user/order/yard_view_form.blade.php | 203 ++++++++++++---- resources/views/web/templates/card.blade.php | 2 +- .../web/templates/checkout-final.blade.php | 2 +- .../views/web/templates/checkout.blade.php | 115 +++++---- 36 files changed, 1104 insertions(+), 617 deletions(-) create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 resources/views/user/order/_bak_shipping_me.blade.php create mode 100644 resources/views/user/order/_bak_shipping_ot.blade.php diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e0f926b..df50fa1 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,32 +5,42 @@ + + + + + - - + + - - - - + - - + - + + + + - - - + + + + + + + + + + - - - - - - - - @@ -290,6 +294,13 @@ + + + + + + + @@ -540,6 +551,10 @@ + + + + @@ -612,10 +627,6 @@ - - - - @@ -629,11 +640,11 @@ - + - - + + diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index a55c433..6b0845c 100755 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -153,6 +153,9 @@ class CustomerController extends Controller ->addColumn('id', function (ShoppingUser $ShoppingUser) { return ''; }) + ->addColumn('billing_email', function (ShoppingUser $ShoppingUser) { + return $ShoppingUser->faker_mail ? "-" : $ShoppingUser->billing_email; + }) ->addColumn('billing_salutation', function (ShoppingUser $ShoppingUser) { return HTMLHelper::getSalutationLang($ShoppingUser->billing_salutation); }) @@ -183,9 +186,15 @@ class CustomerController extends Controller ->addColumn('subscribed', function (ShoppingUser $ShoppingUser) { return get_active_badge($ShoppingUser->subscribed); }) + ->filterColumn('billing_email', function($query, $keyword) { + if($keyword != ""){ + $query->where('billing_email', 'LIKE', '%'.$keyword.'%'); + } + }) ->orderColumn('id', 'id $1') ->orderColumn('billing_country_id', 'billing_country_id $1') ->orderColumn('billing_salutation', 'billing_salutation $1') + ->orderColumn('billing_email', 'billing_email $1') ->orderColumn('created_at', 'created_at $1') ->orderColumn('isMember', 'auth_user_id $1') ->orderColumn('member_id', 'member_id $1') diff --git a/app/Http/Controllers/SalesController.php b/app/Http/Controllers/SalesController.php index fd74bdf..f8c774a 100755 --- a/app/Http/Controllers/SalesController.php +++ b/app/Http/Controllers/SalesController.php @@ -74,10 +74,10 @@ class SalesController extends Controller }) ->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) { if($ShoppingOrder->shopping_user->is_for === 'me'){ - return 'Berater'; + return 'Beraterbestellung'; } if($ShoppingOrder->shopping_user->is_for === 'ot'){ - return 'Kunde'; + return 'Kundenbestellung'; } return '-'; }) @@ -216,10 +216,10 @@ class SalesController extends Controller }) ->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) { if($ShoppingOrder->shopping_user->is_for === 'me'){ - return 'Berater'; + return 'Beraterbestellung'; } if($ShoppingOrder->shopping_user->is_for === 'ot'){ - return 'Kunde'; + return 'Kundenbestellung'; } return '-'; }) diff --git a/app/Http/Controllers/ShippingController.php b/app/Http/Controllers/ShippingController.php index 15d4de8..e705529 100755 --- a/app/Http/Controllers/ShippingController.php +++ b/app/Http/Controllers/ShippingController.php @@ -140,6 +140,9 @@ class ShippingController extends Controller public function deleteCountry($id) { $model = ShippingCountry::findOrFail($id); + if($model->shopping_orders->count()){ + abort(403, 'Einträge vorhanden'); + } $shipping = $model->shipping; $model->delete(); \Session()->flash('alert-success', "Preis gelöscht"); diff --git a/app/Http/Controllers/User/CustomerController.php b/app/Http/Controllers/User/CustomerController.php index 5dae854..192fcb4 100755 --- a/app/Http/Controllers/User/CustomerController.php +++ b/app/Http/Controllers/User/CustomerController.php @@ -211,7 +211,7 @@ class CustomerController extends Controller { $user = User::find(\Auth::user()->id); - $query = ShoppingUser::select(['id', 'billing_company', 'billing_salutation', 'billing_firstname', 'billing_lastname', 'billing_email', 'billing_zipcode', 'billing_city', 'billing_country_id', 'orders', 'subscribed', 'created_at', 'number', 'mode', 'is_like', 'wp_order_number']) + $query = ShoppingUser::select(['id', 'billing_company', 'billing_salutation', 'billing_firstname', 'billing_lastname', 'billing_email', 'faker_mail', 'billing_zipcode', 'billing_city', 'billing_country_id', 'orders', 'subscribed', 'created_at', 'number', 'mode', 'is_like', 'wp_order_number']) ->where('shopping_users.member_id', '=', $user->id); //->groupBy('shopping_users.number'); @@ -224,6 +224,9 @@ class CustomerController extends Controller ->addColumn('send_to', function (ShoppingUser $ShoppingUser) { return $ShoppingUser->is_like ? ' in Prüfung' : ' wählen'; }) + ->addColumn('billing_email', function (ShoppingUser $ShoppingUser) { + return $ShoppingUser->faker_mail ? "-" : $ShoppingUser->billing_email; + }) ->addColumn('id', function (ShoppingUser $ShoppingUser) { return ''; }) @@ -248,8 +251,14 @@ class CustomerController extends Controller ->addColumn('extras', function (ShoppingUser $ShoppingUser) { return $ShoppingUser->wp_order_number.($ShoppingUser->mode==='dev' ? ' dev' : ''); }) + ->filterColumn('billing_email', function($query, $keyword) { + if($keyword != ""){ + $query->where('billing_email', 'LIKE', '%'.$keyword.'%'); + } + }) ->orderColumn('send_to', 'id $1') ->orderColumn('id', 'id $1') + ->orderColumn('billing_email', 'billing_email $1') ->orderColumn('billing_country_id', 'billing_country_id $1') ->orderColumn('billing_salutation', 'billing_salutation $1') ->orderColumn('first_created_at', 'created_at $1') diff --git a/app/Http/Controllers/User/OrderController.php b/app/Http/Controllers/User/OrderController.php index e836c3f..f84da60 100755 --- a/app/Http/Controllers/User/OrderController.php +++ b/app/Http/Controllers/User/OrderController.php @@ -77,17 +77,16 @@ class OrderController extends Controller }) ->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) { if($ShoppingOrder->shopping_user->is_for === 'me'){ - return 'Berater'; + return 'Beraterbestellung'; } if($ShoppingOrder->shopping_user->is_for === 'ot'){ - return 'Kunde'; + return 'Kundenbestellung'; } return '-'; }) ->addColumn('reference', function (ShoppingOrder $ShoppingOrder) { return $ShoppingOrder->getLastShoppingPayment('reference'); }) - ->orderColumn('id', 'id $1') ->orderColumn('txaction', 'txaction $1') ->orderColumn('shipped', 'shipped $1') @@ -148,11 +147,6 @@ class OrderController extends Controller Yard::instance('shopping')->setShippingCountryWithPrice($shipping_country_id, $for); - $comp_products = null; - if($for === 'me'){ - $comp_products = Product::whereActive(true)->where('show_at', '=', 1)->where('shipping_addon', true)->orderBy('pos', 'DESC')->get(); - - } $data = [ 'shopping_user' => $shopping_user, 'user' => $user, @@ -160,7 +154,7 @@ class OrderController extends Controller 'isView' => 'customer', 'for' => $for, 'delivery_id' => $delivery_id, - 'comp_products' => $comp_products, + 'comp_products' => $this->getCompProducts($for), ]; return view('user.order.list', $data); } @@ -179,10 +173,27 @@ class OrderController extends Controller 'shipping_state' => 'required', ); $validator = Validator::make(Request::all(), $rules); + if ($validator->fails()) { return back()->withErrors($validator)->withInput(Request::all()); } + if(Yard::instance('shopping')->getNumComp() > 0){ + if(!isset($data['switchers-comp-product'])){ + $validator->errors()->add('switchers-comp-product', __('Bitte wähle ein Kompensationsprodukt aus')); + }else{ + if(!is_array($data['switchers-comp-product'])){ + $validator->errors()->add('switchers-comp-product', __('Bitte wähle ein Kompensationsprodukt aus')); + }else{ + if(count($data['switchers-comp-product']) !== Yard::instance('shopping')->getNumComp()){ + $validator->errors()->add('switchers-comp-product', __('Bitte wähle :count Kompensationsprodukte aus', ['count'=>Yard::instance('shopping')->getNumComp()])); + } + } + } + if ($validator->errors()->count()) { + return back()->withErrors($validator)->withInput(Request::all()); + } + } do { $identifier = Util::getToken(); } while( ShoppingInstance::where('identifier', $identifier)->count() ); @@ -267,6 +278,26 @@ class OrderController extends Controller //->orderBy('id', 'DESC'); return \DataTables::eloquent($query) + + ->addColumn('product', function (Product $product) { + + $cartItem = Yard::instance('shopping')->getCartItemByProduct($product->id); + $qty = isset($cartItem->qty) ? $cartItem->qty : 0; + $rowId = isset($cartItem->rowId) ? $cartItem->rowId : ''; + return ''.$product->name.'
+
+ + + + + + + +
+
'; + }) + /* + ->addColumn('add_card', function (Product $product) { return ''; }) - + ->filterColumn('product', function($query, $keyword) { + if($keyword != ""){ + $query->where('name', 'LIKE', '%'.$keyword.'%'); + } + }) ->orderColumn('name', 'name $1') + ->orderColumn('product', 'name $1') ->orderColumn('number', 'number $1') ->orderColumn('points', 'points $1') ->orderColumn('price_net', 'price_net $1') ->orderColumn('price_gross', 'price_gross $1') - ->orderColumn('price_vk_gross', 'price_vk_gross $1') + ->orderColumn('price_vk_gross', 'price $1') ->orderColumn('contents_total', 'contents_total $1') ->orderColumn('weight', 'weight $1') - ->rawColumns(['add_card', 'quantity', 'picture', 'action']) + + ->rawColumns(['add_card', 'product', 'quantity', 'picture', 'action']) ->make(true); } @@ -327,6 +364,10 @@ class OrderController extends Controller if(Request::ajax()) { $data = Request::all(); + + $is_for = isset($data['shipping_is_for']) ? $data['shipping_is_for'] : 'ot'; + $data['comp_products'] = $this->getCompProducts($is_for); + if($data['action'] === 'updateCart' && isset($data['product_id'])){ if($product = Product::find($data['product_id'])){ $image = ""; @@ -344,61 +385,86 @@ class OrderController extends Controller //if 0 get the item by qty:1 and remove it Yard::instance('shopping')->remove($cartItem->rowId); } - $this->updateCompProduct($data); + // Yard::instance('shopping')->reCalculateShippingPrice(); - $html = view("user.order.yard_view_form", $data)->render(); - return response()->json(['response' => true, 'data'=>$data, 'html'=>$html]); + $this->checkCompProduct(Yard::instance('shopping')->getNumComp()); + $html_card = view("user.order.yard_view_form", $data)->render(); + $html_comp = view("user.order.comp_product", $data)->render(); + + return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]); } } if($data['action'] === 'clearCart') { Yard::instance('shopping')->destroy(); - return response()->json(['response' => true, 'data'=>Yard::instance('shopping')->count(), 'html'=>'']); + return response()->json(['response' => true, 'data'=>Yard::instance('shopping')->count(), 'html_card'=>'', 'html_comp'=>'']); } if($data['action'] === 'updateShippingCountry') { if(isset($data['shipping_country_id'])){ - $is_for = isset($data['shipping_is_for']) ? $data['shipping_is_for'] : 'ot'; if($shipping_country = ShippingCountry::find($data['shipping_country_id'])){ Yard::instance('shopping')->setShippingCountryWithPrice($shipping_country->id, $is_for); - $this->updateCompProduct($data); + $this->checkCompProduct(Yard::instance('shopping')->getNumComp()); } } - $html = view("user.order.yard_view_form", $data)->render(); - return response()->json(['response' => true, 'data'=>$data, 'html'=>$html]); + $html_card = view("user.order.yard_view_form", $data)->render(); + $html_comp = view("user.order.comp_product", $data)->render(); + return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]); } if($data['action'] === 'updateCompProduct'){ + // $data['comp_product_id'] + // $data['comp_num'] + //count_comp_products $this->updateCompProduct($data); Yard::instance('shopping')->reCalculateShippingPrice(); - $html = view("user.order.yard_view_form", $data)->render(); - return response()->json(['response' => true, 'data'=>$data, 'html'=>$html]); + $html_card = view("user.order.yard_view_form", $data)->render(); + $html_comp = view("user.order.comp_product", $data)->render(); + + return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]); } return response()->json(['response' => false, 'data'=>$data]); } } + private function checkCompProduct($count_comp_products){ + foreach (Yard::instance('shopping')->content() as $row) { + //wenn gleich löschen, da neue Versandkosten + if($row->options->comp > $count_comp_products) { + Yard::instance('shopping')->remove($row->rowId); + } + } + } private function updateCompProduct($data){ //clear old foreach (Yard::instance('shopping')->content() as $row) { - if($row->options->comp) { + //wenn kleiner wurde ein produkt entfernt aufgrund der Anzahl + //wenn gleich löschen, da neue Versandkosten + if($row->options->comp === $data['comp_num'] || $row->options->comp > $data['count_comp_products']) { Yard::instance('shopping')->remove($row->rowId); } } - if(isset($data['comp_product_id'])) { - if ($product = Product::find($data['comp_product_id'])) { + if(isset($data['comp_product_id'])) { + if ($product = Product::find($data['comp_product_id'])) { $image = ""; if ($product->images->count()) { $image = $product->images->first()->slug; } - - $cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, ['image' => $image, 'slug' => $product->slug, 'weight' => 0, 'points' => 0, 'comp' => $product->id]); + $cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, + ['image' => $image, 'slug' => $product->slug, 'weight' => 0, 'points' => 0, + 'comp' => $data['comp_num'], 'product_id' => $product->id]); Yard::setTax($cartItem->rowId, 0); } } + } + private function getCompProducts($for){ + if($for === 'me'){ + return Product::whereActive(true)->where('show_at', '=', 1)->where('shipping_addon', true)->orderBy('pos', 'DESC')->get(); + } + return null; } } \ No newline at end of file diff --git a/app/Http/Controllers/Web/CheckoutController.php b/app/Http/Controllers/Web/CheckoutController.php index 88b59e7..1b18a57 100755 --- a/app/Http/Controllers/Web/CheckoutController.php +++ b/app/Http/Controllers/Web/CheckoutController.php @@ -83,7 +83,9 @@ class CheckoutController extends Controller $shopping_user->billing_state = Shop::getCountryShippingCountryId($shopping_user->billing_country_id); $shopping_user->shipping_state = Shop::getCountryShippingCountryId($shopping_user->shipping_country_id); } - + if($shopping_user->same_as_billing === NULL){ + $shopping_user->same_as_billing = false; + } if(old('selected_country') && old('selected_country') === 'change'){ \Session::forget('_old_input.selected_country'); @@ -99,9 +101,7 @@ class CheckoutController extends Controller //$shopping_user->save(); } - if($shopping_user->same_as_billing === NULL){ - $shopping_user->same_as_billing = true; - } + if($is_from !== 'shopping' && Util::getAuthUser()){ $user = Util::getAuthUser(); @@ -174,7 +174,7 @@ class CheckoutController extends Controller $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->same_as_billing = true; $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'] : ''; @@ -187,7 +187,7 @@ class CheckoutController extends Controller $shopping_user->shipping_phone = isset($data['shipping_phone']) ? $data['shipping_phone'] : ''; }else{ - $shopping_user->same_as_billing = $user->account->same_as_billing; + $shopping_user->same_as_billing = $user->account->same_as_billing ? false : true; $shopping_user->shipping_salutation = $user->account->shipping_salutation; $shopping_user->shipping_company = $user->account->shipping_company; $shopping_user->shipping_firstname = $user->account->shipping_firstname; @@ -209,7 +209,7 @@ class CheckoutController extends Controller $data = Request::all(); //change selected Country if(isset($data['selected_country']) && $data['selected_country'] === 'change'){ - if(Request::get('same_as_billing')){ + 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']); @@ -228,7 +228,7 @@ class CheckoutController extends Controller 'accepted_data_checkbox' => 'accepted', ); - if(!Request::get('same_as_billing')){ + if(Request::get('same_as_billing')){ $rules = array_merge($rules, [ 'shipping_firstname'=>'required', 'shipping_lastname'=>'required', @@ -432,7 +432,7 @@ 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']) ? false : true; //reinvert $data['accepted_data_checkbox'] = isset($data['accepted_data_checkbox']) ? true : false; $shopping_user = false; @@ -494,7 +494,7 @@ class CheckoutController extends Controller $this->putPayments('shopping_order_id', $shopping_order->id); - $items = Yard::instance('shopping')->content(); + $items = Yard::instance('shopping')->getContentByOrder(); $shopping_order->shopping_order_items()->each(function($model) use ($items, $shopping_order) { foreach ($items as $item) { @@ -503,6 +503,7 @@ class CheckoutController extends Controller 'shopping_order_id' => $shopping_order->id, 'row_id' => $item->rowId, 'product_id' => $item->id, + 'comp' => $item->options->comp, 'qty' => $item->qty, 'price' => $item->price, 'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''), @@ -521,6 +522,7 @@ class CheckoutController extends Controller 'shopping_order_id' => $shopping_order->id, 'row_id' => $item->rowId, 'product_id' => $item->id, + 'comp' => $item->options->comp, 'qty' => $item->qty, 'price' => $item->price, 'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''), @@ -528,7 +530,6 @@ class CheckoutController extends Controller 'slug' => $item->options->slug ]); }; - return $shopping_order; } @@ -567,8 +568,10 @@ class CheckoutController extends Controller $shopping_order->txaction = 'invoice_open'; $shopping_order->save(); $shopping_payment = ShoppingPayment::where('reference', $payt->transmitted_data['reference'])->first(); - $shopping_payment->txaction = 'invoice_open'; - $shopping_payment->save(); + if($shopping_payment){ + $shopping_payment->txaction = 'invoice_open'; + $shopping_payment->save(); + } $send_link = Payment::paymentStatusPaidAction($shopping_order, false); $data = [ 'mode' => $payt->transmitted_data['mode'], diff --git a/app/Models/ShippingCountry.php b/app/Models/ShippingCountry.php index 363a3b4..cabe731 100644 --- a/app/Models/ShippingCountry.php +++ b/app/Models/ShippingCountry.php @@ -43,4 +43,9 @@ class ShippingCountry extends Model return $this->belongsTo('App\Models\Country', 'country_id'); } + public function shopping_orders() + { + return $this->hasMany('App\Models\ShoppingOrder', 'country_id'); + } + } diff --git a/app/Models/ShippingPrice.php b/app/Models/ShippingPrice.php index f4e1757..c642293 100644 --- a/app/Models/ShippingPrice.php +++ b/app/Models/ShippingPrice.php @@ -43,7 +43,7 @@ class ShippingPrice extends Model protected $table = 'shipping_prices'; protected $fillable = [ - 'shipping_id', 'price', 'price_comp', 'tax_rate', 'factor', 'total_from', 'total_to', 'weight_from', 'weight_to', + 'shipping_id', 'price', 'price_comp', 'num_comp', 'tax_rate', 'factor', 'total_from', 'total_to', 'weight_from', 'weight_to', ]; public function shipping() diff --git a/app/Models/ShoppingOrderItem.php b/app/Models/ShoppingOrderItem.php index 84193fd..450c9b4 100644 --- a/app/Models/ShoppingOrderItem.php +++ b/app/Models/ShoppingOrderItem.php @@ -53,6 +53,7 @@ class ShoppingOrderItem extends Model 'shopping_order_id', 'row_id', 'product_id', + 'comp', 'qty', 'price', 'price_net', diff --git a/app/Services/HTMLHelper.php b/app/Services/HTMLHelper.php index 9e886c1..ab9b968 100644 --- a/app/Services/HTMLHelper.php +++ b/app/Services/HTMLHelper.php @@ -242,6 +242,14 @@ class HTMLHelper return $ret; } + public static function getCountryNameFormShipping($id){ + $value = ShippingCountry::find($id); + if($value){ + return $value->country->getLocated(); + } + return "not defined"; + } + public static function getCountriesForShipping($id, $all=false){# $values = ShippingCountry::all(); $ret = ""; diff --git a/app/Services/Yard.php b/app/Services/Yard.php index 4152c84..d5b9727 100644 --- a/app/Services/Yard.php +++ b/app/Services/Yard.php @@ -19,6 +19,7 @@ class Yard extends Cart private $shipping_tax = 0; private $shipping_country_id = 0; //default de private $shipping_is_for; + private $num_comp; private $ysession; private $yinstance; private $shopping_data = []; @@ -51,6 +52,10 @@ class Yard extends Cart $this->shipping_is_for = $this->getYardExtra('shipping_is_for'); } + if($this->getYardExtra('num_comp')){ + $this->num_comp = $this->getYardExtra('num_comp'); + } + parent::__construct($session, $events); @@ -160,8 +165,10 @@ class Yard extends Cart } if($shipping_price){ $price = $shipping_price->price; + $this->num_comp = 0; if($this->shipping_is_for === 'me'){ $price = $shipping_price->price_comp; + $this->num_comp = $shipping_price->num_comp; } $this->shipping_price = $price; @@ -169,6 +176,7 @@ 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->putYardExtra('num_comp', $this->num_comp); $this->putYardExtra('shipping_price', $this->shipping_price); $this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate); $this->putYardExtra('shipping_tax', $this->shipping_tax); @@ -394,7 +402,33 @@ class Yard extends Cart return $this->numberFormat(($price * $row->qty), $decimals, $decimalPoint, $thousandSeperator); } + public function getNumComp(){ + return $this->num_comp; + } + public function getCompProductBy($comp, $product_id=false){ + foreach ($this->content() as $row) { + if($row->options->comp == $comp) { + return $row->options->product_id; + } + } + return false; + } + + public function getContentByOrder(){ + $ret = []; + $comp = []; + foreach ($this->content() as $row) { + if($row->options->comp){ + $comp[100+$row->options->comp] = $row; + }else{ + $ret[] = $row; + } + } + ksort($comp); + $ret = array_merge($ret, $comp); + return $ret; + } /** * Get the Formated number diff --git a/database/migrations/2019_01_06_004849_create_shipping_prices_table.php b/database/migrations/2019_01_06_004849_create_shipping_prices_table.php index 502f775..ccdb0f4 100644 --- a/database/migrations/2019_01_06_004849_create_shipping_prices_table.php +++ b/database/migrations/2019_01_06_004849_create_shipping_prices_table.php @@ -19,6 +19,7 @@ class CreateShippingPricesTable extends Migration $table->decimal('price', 8, 2)->nullable(); $table->decimal('price_comp', 8, 2)->nullable(); + $table->unsignedTinyInteger('num_comp')->nullable(); $table->decimal('tax_rate', 5, 2)->nullable(); $table->decimal('factor', 5, 2)->nullable(); diff --git a/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php b/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php index 4aa0060..e460973 100644 --- a/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php +++ b/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php @@ -19,10 +19,15 @@ class CreateShoppingOrderItemsTable extends Migration $table->unsignedInteger('shopping_order_id'); $table->string('row_id', 40)->nullable(); $table->unsignedInteger('product_id'); + + $table->unsignedTinyInteger('comp')->nullable(); + + $table->unsignedInteger('qty'); $table->decimal('price', 8, 2)->nullable(); $table->decimal('price_net', 8, 3)->nullable(); + $table->decimal('tax_rate', 5, 2)->nullable(); $table->string('slug')->nullable(); diff --git a/public/js/iq-shopping-cart.js b/public/js/iq-shopping-cart.js index 9a7c93a..53d3268 100755 --- a/public/js/iq-shopping-cart.js +++ b/public/js/iq-shopping-cart.js @@ -4,32 +4,28 @@ var IqShoppingCart = { btn_add: '.add-product-basket', btn_remove: '.remove-product-basket', card_holder: '#holder_html_view_card', + comp_holder: '#holder_html_view_comp_product', is_for: null, url: null, btn_clear: '#clear-products-basket', modal: null, oTable: null, - cProductId: null, table_input: '.table-input-event-onchange', cart_input: '.cart-input-event-onchange', remove_item: '.remove_item_form_cart', shipping_state: '#change_shipping_state', - comp_product: 'switchers-comp-product', + comp_products: 'switchers-comp-product', + count_comp_products: 'count_comp_products', shipping_is_for: 'shipping_is_for', init: function () { var _self = this; _self.url = $(_self.table).data('url'); _self.is_for = $('input[name="'+_self.shipping_is_for+'"]').val(); - _self.cProductId = $('input[name="'+_self.comp_product+'"]:checked').val(); _self.showInit(); $(_self.shipping_state).on('change', function(){ _self.update_shipping_state($(this)); }); - $('input[name="'+_self.comp_product+'"]').on('change', function(){ - _self.update_comp_product(); - }); - // _self.update_comp_product(); return _self; }, setDatabase: function (oTable){ @@ -58,10 +54,15 @@ var IqShoppingCart = { $(_self.cart_input).on('change', function(){ _self.update_input_cart($(this)); }); - $(_self.remove_item).on('click', function(){ + $(_self.remove_item).on('click', function(event){ + event.preventDefault(); _self.update_cart_database($(this).data('product-id'), 0); }); - + if(_self.is_for === 'me'){ + $('input[name^="'+_self.comp_products+'"]').on('change', function(){ + _self.update_comp_product($(this)); + }); + } }, update_shipping_state : function (_obj){ var _self = this; @@ -84,10 +85,9 @@ var IqShoppingCart = { _obj.val(qty); _self.update_cart_database(_obj.data('product-id'), qty); }, - update_comp_product: function (){ + update_comp_product: function (_obj){ var _self = this; - _self.cProductId = $('input[name="'+_self.comp_product+'"]:checked').val(); - _self.performRequest({action: 'updateCompProduct'}) + _self.performRequest({comp_product_id: _obj.val(), comp_num: _obj.data('comp_num'), count_comp_products: $('input[name="'+_self.count_comp_products+'"]').val(), action: 'updateCompProduct'}) .done(_self.refreshItemsAndView); }, add_product: function (_obj){ @@ -120,24 +120,27 @@ var IqShoppingCart = { }, refreshItemsAndView: function (data){ var _self = IqShoppingCart; - $(_self.card_holder).html(data.html); + $(_self.card_holder).html(data.html_card); + $(_self.comp_holder).html(data.html_comp); _self.showInit(); }, refreshDatabaseAndView: function (data) { var _self = IqShoppingCart; - $(_self.card_holder).html(data.html); + $(_self.card_holder).html(data.html_card); + $(_self.comp_holder).html(data.html_comp); + var input = $(_self.table).find('input[name="product_qty_'+data.data.product_id+'"]'); input.val(data.data.qty); _self.showInit(); }, refreshDatabaseRefreshAndView : function (data){ var _self = IqShoppingCart; - $(_self.card_holder).html(data.html); + $(_self.card_holder).html(data.html_card); + $(_self.comp_holder).html(data.html_comp); + _self.showInit(); _self.oTable.draw(); - _self.update_comp_product(); - }, checkNumber : function(number){ if(number < 0 || isNaN(number)){ @@ -154,7 +157,6 @@ var IqShoppingCart = { contentType = 'application/x-www-form-urlencoded; charset=UTF-8'; data.shipping_is_for = _self.is_for; - data.comp_product_id = _self.cProductId; console.log(data); console.log(url); diff --git a/resources/lang/de/navigation.php b/resources/lang/de/navigation.php index bc8aa50..8e914da 100755 --- a/resources/lang/de/navigation.php +++ b/resources/lang/de/navigation.php @@ -16,7 +16,7 @@ return [ 'my_membership' => 'Meine Mitgliedschaft', 'orders'=>'Bestellungen', 'trigger'=>'auslösen', - 'do_order'=>'bestellen', + 'do_order'=>'Bestellung aufgeben', 'clients'=>'Kunden', 'products'=>'Produkte', 'overview'=>'Übersicht', diff --git a/resources/views/admin/customer/_detail.blade.php b/resources/views/admin/customer/_detail.blade.php index 0970ffa..d1e55e4 100644 --- a/resources/views/admin/customer/_detail.blade.php +++ b/resources/views/admin/customer/_detail.blade.php @@ -7,7 +7,11 @@
E-Mail
- {{ $shopping_user->billing_email }} + @if($shopping_user->faker_mail) + - + @else + {{ $shopping_user->billing_email }} + @endif
Kundennummer
@@ -25,7 +29,11 @@
E-Mail
- {{ $shopping_user->billing_email }} + @if($shopping_user->faker_mail) + - + @else + {{ $shopping_user->billing_email }} + @endif
Kundennummer
diff --git a/resources/views/admin/customer/_edit.blade.php b/resources/views/admin/customer/_edit.blade.php index f75d384..246cf27 100644 --- a/resources/views/admin/customer/_edit.blade.php +++ b/resources/views/admin/customer/_edit.blade.php @@ -220,13 +220,13 @@
-
+
@if($isView === 'customer') @@ -234,8 +234,10 @@ @endif +
+

+ {{ Form::hidden('faker_mail', $shopping_user->faker_mail) }} + @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) }} - - -
-
- - {{ Form::text('billing_email', $billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email', 'readonly')) }} + @if($shopping_user->faker_mail) + {{ Form::hidden('billing_email', $billing_email) }} + {{ Form::hidden('billing_email-confirm', $billing_email) }} + @else +
+
+ + {{ Form::text('billing_email', $billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email', 'readonly')) }} +
+
+ + {{ Form::text('billing_email-confirm', $billing_email, array('placeholder'=>__('Confirm E-Mail'), 'class'=>'form-control', 'id'=>'billing_email-confirm', 'readonly')) }} +
-
- - {{ Form::text('billing_email-confirm', $billing_email, array('placeholder'=>__('Confirm E-Mail'), 'class'=>'form-control', 'id'=>'billing_email-confirm', 'readonly')) }} -
-
+ @endif + @else + @if($shopping_user->faker_mail) + {{ Form::hidden('billing_email', $shopping_user->billing_email) }} + {{ Form::hidden('billing_email-confirm', $shopping_user->billing_email) }} + @else
{{ Form::text('billing_email', $shopping_user->billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email')) }} - faker_mail
{{ Form::text('billing_email-confirm', $shopping_user->billing_email, array('placeholder'=>__('Confirm E-Mail'), 'class'=>'form-control', 'id'=>'billing_email-confirm')) }}
+ @endif @endif
diff --git a/resources/views/admin/sales/_detail.blade.php b/resources/views/admin/sales/_detail.blade.php index cff11ad..b1ac2b8 100644 --- a/resources/views/admin/sales/_detail.blade.php +++ b/resources/views/admin/sales/_detail.blade.php @@ -122,7 +122,7 @@ @if($shopping_order->shopping_user->is_from === 'shopping') Rechnungsadresse des Kunden @else - Rechnungsadresse des Berater + Rechnungsadresse des Beraters @endif
diff --git a/resources/views/admin/sales/users.blade.php b/resources/views/admin/sales/users.blade.php index fd1927f..f6af6fa 100644 --- a/resources/views/admin/sales/users.blade.php +++ b/resources/views/admin/sales/users.blade.php @@ -20,7 +20,7 @@ {{__('Zahlung')}} {{__('Status')}} {{__('Versand')}} - {{__('Für')}} + {{__('Art')}} {{__('First name')}} {{__('Last name')}} {{__('E-Mail')}} diff --git a/resources/views/admin/shipping/edit.blade.php b/resources/views/admin/shipping/edit.blade.php index ed99acc..fd07738 100755 --- a/resources/views/admin/shipping/edit.blade.php +++ b/resources/views/admin/shipping/edit.blade.php @@ -70,6 +70,7 @@   {{__('Kunden Preis')}} {{__('Kompensation Preis')}} + {{__('Anzahl KP')}} {{__('Tax')}} {{__('Preis von - bis')}} {{__('Gewicht von - bis')}} @@ -85,6 +86,7 @@ data-id="{{ $price->id }}" data-price="{{ $price->getFormattedPrice() }}" data-price_comp="{{ $price->getFormattedPriceComp() }}" + data-num_comp="{{ $price->num_comp }}" data-tax_rate="{{ $price->getFormattedTaxRate() }}" data-factor="{{ $price->getFormattedFactor() }}" data-total_from="{{ $price->getFormatTotalFrom() }}" @@ -96,6 +98,7 @@ {{ $price->getFormattedPrice() }} {{ $price->getFormattedPriceComp() }} + {{ $price->num_comp }} {{ $price->getFormattedTaxRate() }} {{ $price->getFormatTotalFrom() }} - {{ $price->getFormattedTotalTo() }} {{ $price->weight_from }} - {{ $price->weight_to }} @@ -110,6 +113,7 @@ data-id="new" data-price="" data-price_comp="" + data-num_comp="" data-tax_rate="" data-factor="1" data-total_from="" @@ -153,6 +157,10 @@
+
+ + +
@@ -204,7 +212,13 @@ {{ $country->country->de }} - + + @if(!$country->shopping_orders->count()) + + @else + - + @endif + @endforeach @@ -261,6 +275,7 @@ $(this).find(".modal-content input[name='id']").val(button.data('id')); $(this).find(".modal-body input[name='price']").val(button.data('price')); $(this).find(".modal-body input[name='price_comp']").val(button.data('price_comp')); + $(this).find(".modal-body input[name='num_comp']").val(button.data('num_comp')); $(this).find(".modal-body input[name='tax_rate']").val(button.data('tax_rate')); $(this).find(".modal-body input[name='factor']").val(button.data('factor')); $(this).find(".modal-body input[name='total_from']").val(button.data('total_from')); diff --git a/resources/views/user/customer/add.blade.php b/resources/views/user/customer/add.blade.php index a09bbd9..42c418c 100644 --- a/resources/views/user/customer/add.blade.php +++ b/resources/views/user/customer/add.blade.php @@ -79,8 +79,7 @@
{!! Form::close() !!} diff --git a/resources/views/user/customer/edit.blade.php b/resources/views/user/customer/edit.blade.php index 39af600..80e0ef3 100644 --- a/resources/views/user/customer/edit.blade.php +++ b/resources/views/user/customer/edit.blade.php @@ -3,7 +3,7 @@ @section('content')

- zurück + zurück {{ __('Kunden Details') }} bearbeiten

{!! Form::open(['url' => route('user_customer_edit', [$shopping_user->id]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!} @@ -12,5 +12,5 @@   {!! Form::close() !!} - zurück + zurück @endsection \ No newline at end of file diff --git a/resources/views/user/order/_bak_shipping_me.blade.php b/resources/views/user/order/_bak_shipping_me.blade.php new file mode 100644 index 0000000..8fa8aed --- /dev/null +++ b/resources/views/user/order/_bak_shipping_me.blade.php @@ -0,0 +1,215 @@ + +@if($user->account) + @if($user->account->same_as_billing) + + +
+
+
+ + {{ Form::text('shipping_company', $user->account->company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }} +
+
+
+
+ + + @if ($errors->has('shipping_salutation')) + + {{ $errors->first('shipping_salutation') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_firstname', $user->account->first_name, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_firstname')) + + {{ $errors->first('shipping_firstname') }} + + @endif + +
+
+ + {{ Form::text('shipping_lastname', $user->account->last_name, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_lastname')) + + {{ $errors->first('shipping_lastname') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_address', $user->account->address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_address')) + + {{ $errors->first('shipping_address') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_address_2', $user->account->address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }} +
+
+
+
+ + {{ Form::text('shipping_zipcode', $user->account->zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_zipcode')) + + {{ $errors->first('shipping_zipcode') }} + + @endif +
+
+ + {{ Form::text('shipping_city', $user->account->city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_city')) + + {{ $errors->first('shipping_city') }} + + @endif +
+
+
+
+ + + @if ($errors->has('shipping_state')) + + {{ $errors->first('shipping_state') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_phone', $user->account->phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }} +
+
+
+ + @else + +
+
+
+ + {{ Form::text('shipping_company', $user->account->shipping_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }} +
+
+
+
+ + + @if ($errors->has('shipping_salutation')) + + {{ $errors->first('shipping_salutation') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_firstname', $user->account->shipping_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_firstname')) + + {{ $errors->first('shipping_firstname') }} + + @endif +
+
+ + {{ Form::text('shipping_lastname', $user->account->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_lastname')) + + {{ $errors->first('shipping_lastname') }} + + @endif + +
+
+
+
+ + {{ Form::text('shipping_address', $user->account->shipping_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_address')) + + {{ $errors->first('shipping_address') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_address_2', $user->account->shipping_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }} + @if ($errors->has('shipping_address_2')) + + {{ $errors->first('shipping_address_2') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_zipcode', $user->account->shipping_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_zipcode')) + + {{ $errors->first('shipping_zipcode') }} + + @endif + +
+
+ + {{ Form::text('shipping_city', $user->account->shipping_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_city')) + + {{ $errors->first('shipping_city') }} + + @endif +
+
+
+
+ + + @if ($errors->has('shipping_state')) + + {{ $errors->first('shipping_state') }} + + @endif +
+
+ +
+
+ + {{ Form::text('shipping_phone', $user->account->shipping_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }} +
+
+
+ @endif +@else +

Fehler: Keine Adressdaten gefunden!

+@endif \ No newline at end of file diff --git a/resources/views/user/order/_bak_shipping_ot.blade.php b/resources/views/user/order/_bak_shipping_ot.blade.php new file mode 100644 index 0000000..1bcdcfc --- /dev/null +++ b/resources/views/user/order/_bak_shipping_ot.blade.php @@ -0,0 +1,210 @@ + + @if($shopping_user->same_as_billing) + +
+
+
+ + {{ Form::text('shipping_company', $shopping_user->billing_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }} +
+
+
+
+ + + @if ($errors->has('shipping_salutation')) + + {{ $errors->first('shipping_salutation') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_firstname', $shopping_user->billing_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_firstname')) + + {{ $errors->first('shipping_firstname') }} + + @endif + +
+
+ + {{ Form::text('shipping_lastname', $shopping_user->billing_lastname, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_lastname')) + + {{ $errors->first('shipping_lastname') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_address', $shopping_user->billing_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_address')) + + {{ $errors->first('shipping_address') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_address_2', $shopping_user->billing_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }} +
+
+
+
+ + {{ Form::text('shipping_zipcode', $shopping_user->billing_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_zipcode')) + + {{ $errors->first('shipping_zipcode') }} + + @endif +
+
+ + {{ Form::text('shipping_city', $shopping_user->billing_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_city')) + + {{ $errors->first('shipping_city') }} + + @endif +
+
+
+
+ + + @if ($errors->has('shipping_state')) + + {{ $errors->first('shipping_state') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_phone', $shopping_user->billing_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }} +
+
+
+ + @else + +
+
+
+ + {{ Form::text('shipping_company', $shopping_user->shipping_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }} +
+
+
+
+ + + @if ($errors->has('shipping_salutation')) + + {{ $errors->first('shipping_salutation') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_firstname', $shopping_user->shipping_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_firstname')) + + {{ $errors->first('shipping_firstname') }} + + @endif +
+
+ + {{ Form::text('shipping_lastname', $shopping_user->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_lastname')) + + {{ $errors->first('shipping_lastname') }} + + @endif + +
+
+
+
+ + {{ Form::text('shipping_address', $shopping_user->shipping_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_address')) + + {{ $errors->first('shipping_address') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_address_2', $shopping_user->shipping_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }} + @if ($errors->has('shipping_address_2')) + + {{ $errors->first('shipping_address_2') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_zipcode', $shopping_user->shipping_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_zipcode')) + + {{ $errors->first('shipping_zipcode') }} + + @endif + +
+
+ + {{ Form::text('shipping_city', $shopping_user->shipping_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }} + @if ($errors->has('shipping_city')) + + {{ $errors->first('shipping_city') }} + + @endif +
+
+
+
+ + + @if ($errors->has('shipping_state')) + + {{ $errors->first('shipping_state') }} + + @endif +
+
+ +
+
+ + {{ Form::text('shipping_phone', $shopping_user->shipping_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }} +
+
+
+ @endif \ No newline at end of file diff --git a/resources/views/user/order/comp_product.blade.php b/resources/views/user/order/comp_product.blade.php index f53cce3..05ada8d 100644 --- a/resources/views/user/order/comp_product.blade.php +++ b/resources/views/user/order/comp_product.blade.php @@ -1,35 +1,42 @@ +
-

Versand Kompensationsprodukt

- - @if($comp_products) -
- @php($counter = 1) - - @foreach($comp_products as $comp_product) -
-
- @if(count($comp_product->images)) - - @endif -
-
- -
{{ $comp_product->name }}
-
Art-Nr.: {{ $comp_product->number }}
+ @if($comp_products && Yard::instance('shopping')->getNumComp() > 0) + + @for($i = 1; $i <= Yard::instance('shopping')->getNumComp(); $i++) + @if(Yard::instance('shopping')->getNumComp() > 1) +

{{$i}}. Versand Kompensationsprodukt

+ @else +

Versand Kompensationsprodukt

+ @endif +
+ @php($counter = 1) + @php($checked_id = Yard::instance('shopping')->getCompProductBy($i)) + @foreach($comp_products as $comp_product) +
+
+ @if(count($comp_product->images)) + + @endif +
+
+ +
{{ $comp_product->name }}
+
Art-Nr.: {{ $comp_product->number }}
+
+ @php($counter++) + @endforeach
- @php($counter++) - @endforeach -
+ @endfor @endif
\ No newline at end of file diff --git a/resources/views/user/order/delivery.blade.php b/resources/views/user/order/delivery.blade.php index 07b17d2..33fccd1 100644 --- a/resources/views/user/order/delivery.blade.php +++ b/resources/views/user/order/delivery.blade.php @@ -58,6 +58,8 @@ @endif

An diesen Kunde versenden

+

Sollten unten stehend Angaben nicht korrekt sein oder aktualisiert werden müssen, ändere diese bitte vorerst unter: + Meine Kunden -> Übersicht -> Kunde

@include('admin.customer._customer_detail')
@endif diff --git a/resources/views/user/order/index.blade.php b/resources/views/user/order/index.blade.php index f05c32c..8ea7efb 100644 --- a/resources/views/user/order/index.blade.php +++ b/resources/views/user/order/index.blade.php @@ -17,7 +17,7 @@ {{__('Zahlung')}} {{__('Status')}} {{__('Versand')}} - {{__('Für')}} + {{__('Art')}} {{__('First name')}} {{__('Last name')}} {{__('E-Mail')}} diff --git a/resources/views/user/order/list.blade.php b/resources/views/user/order/list.blade.php index 9c9ff6b..4709bfa 100644 --- a/resources/views/user/order/list.blade.php +++ b/resources/views/user/order/list.blade.php @@ -4,6 +4,7 @@

{{ __('navigation.my_orders') }} / {{ __('navigation.do_order') }} zurück +

+ @if($user->user_level) +

Die Produktpreise werden entsprechend deinem Karriere-Level {{$user->user_level->name}} abzüglich {{$user->user_level->getFormattedMargin()}} % Marge angezeigt.
+ Hinweis: Wenn Du den Warenkorb verlässt, gehen alle Einstellungen verloren.

+ @else +

Hinweis: Dir wurde noch kein Karriere-Level zugewisen. Bitte wende dich an info@mivita.care

+ @endif + + @if($errors->has('switchers-comp-product')) +
+
+
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+
+
+ @endif +
@@ -39,16 +76,13 @@ {{__('Bild')}} - # - {{__('Anzahl')}} {{__('Produkt')}} - {{__('Artikelnummer')}} - {{__('Netto-Preis')}} - {{__('Brutto-Preis')}} - {{__('VK-Brutto-Preis')}} + {{__('Mein Preis netto')}} + {{__('Mein Preis brutto')}} {{__('Points')}} + {{__('VK-Preis brutto')}} {{__('Inhalt (ml)')}} - {{__('Gewicht (g)')}} + {{__('Artikelnummer')}} # @@ -60,22 +94,25 @@ {!! Form::open(['url' => route('user_order_my_payment', [$for, $delivery_id]), 'class' => 'form-horizontal']) !!} +
@if($for === 'ot') -

Lieferadresse des Kunden

+

Lieferland des Kunden

@include('user.order.shipping_ot') @endif - @if($for === 'me') -

Meine Lieferadresse

+

Mein Lieferland

@include('user.order.shipping_me') + Kann bei der Zahlung/Checkout nicht mehr geändert werden. @endif
@if($for === 'me') - @include('user.order.comp_product') +
+ @include('user.order.comp_product') +
@endif
@@ -110,17 +147,14 @@ }, "order": [[4, "asc" ]], "columns": [ - { data: 'picture', name: 'picture', searchable: false, orderable: false }, - { data: 'add_card', name: 'add_card', searchable: false, orderable: false}, - { data: 'quantity', name: 'quantity', searchable: false, orderable: false}, - { data: 'name', name: 'name' }, - { data: 'number', name: 'number' }, - { data: 'price_net', name: 'price_net', searchable: false }, - { data: 'price_gross', name: 'price_gross', searchable: false }, - { data: 'price_vk_gross', name: 'price_vk_gross', searchable: false }, + { data: 'picture', name: 'picture', searchable: false, width: 35 }, + { data: 'product', name: 'product' }, + { data: 'price_net', name: 'price_net', searchable: false, orderable: false }, + { data: 'price_gross', name: 'price_gross', searchable: false, orderable: false }, { data: 'points', name: 'points', searchable: false }, + { data: 'price_vk_gross', name: 'price_vk_gross', searchable: false }, { data: 'contents_total', name: 'contents_total', searchable: false }, - { data: 'weight', name: 'weight', searchable: false }, + { data: 'number', name: 'number' }, { data: 'action', name: 'action', searchable: false, orderable: false }, ], "bLengthChange": false, @@ -143,6 +177,9 @@ }); */ + /*{ data: 'add_card', name: 'add_card', searchable: false, orderable: false}, + { data: 'quantity', name: 'quantity', searchable: false, orderable: false},*/ + $('body').tooltip({ selector: '.product-tooltip' }); diff --git a/resources/views/user/order/shipping_me.blade.php b/resources/views/user/order/shipping_me.blade.php index 4999c35..1ddd39a 100644 --- a/resources/views/user/order/shipping_me.blade.php +++ b/resources/views/user/order/shipping_me.blade.php @@ -3,87 +3,19 @@ @if($user->account->same_as_billing) + {{ Form::hidden('shipping_company', $user->account->company) }} + {{ Form::hidden('shipping_salutation', $user->account->salutation) }} + {{ Form::hidden('shipping_firstname', $user->account->first_name) }} + {{ Form::hidden('shipping_lastname', $user->account->last_name) }} + {{ Form::hidden('shipping_address', $user->account->address) }} + {{ Form::hidden('shipping_address_2', $user->account->address_2) }} + {{ Form::hidden('shipping_zipcode', $user->account->zipcode) }} + {{ Form::hidden('shipping_city', $user->account->city) }} + {{ Form::hidden('shipping_phone', $user->account->phone) }} +
-
-
- - {{ Form::text('shipping_company', $user->account->company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }} -
-
-
-
- - - @if ($errors->has('shipping_salutation')) - - {{ $errors->first('shipping_salutation') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_firstname', $user->account->first_name, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_firstname')) - - {{ $errors->first('shipping_firstname') }} - - @endif - -
-
- - {{ Form::text('shipping_lastname', $user->account->last_name, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_lastname')) - - {{ $errors->first('shipping_lastname') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_address', $user->account->address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_address')) - - {{ $errors->first('shipping_address') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_address_2', $user->account->address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }} -
-
-
-
- - {{ Form::text('shipping_zipcode', $user->account->zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_zipcode')) - - {{ $errors->first('shipping_zipcode') }} - - @endif -
-
- - {{ Form::text('shipping_city', $user->account->city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_city')) - - {{ $errors->first('shipping_city') }} - - @endif -
-
- @@ -94,103 +26,22 @@ @endif
-
-
- - {{ Form::text('shipping_phone', $user->account->phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }} -
-
@else + {{ Form::hidden('shipping_company', $user->account->shipping_company) }} + {{ Form::hidden('shipping_salutation', $user->account->shipping_salutation) }} + {{ Form::hidden('shipping_firstname', $user->account->shipping_firstname) }} + {{ Form::hidden('shipping_lastname', $user->account->shipping_lastname) }} + {{ Form::hidden('shipping_address', $user->account->shipping_address) }} + {{ Form::hidden('shipping_address_2', $user->account->shipping_address_2) }} + {{ Form::hidden('shipping_zipcode', $user->account->shipping_zipcode) }} + {{ Form::hidden('shipping_city', $user->account->shipping_city) }} + {{ Form::hidden('shipping_phone', $user->account->shipping_phone) }}
-
-
- - {{ Form::text('shipping_company', $user->account->shipping_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }} -
-
-
-
- - - @if ($errors->has('shipping_salutation')) - - {{ $errors->first('shipping_salutation') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_firstname', $user->account->shipping_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_firstname')) - - {{ $errors->first('shipping_firstname') }} - - @endif -
-
- - {{ Form::text('shipping_lastname', $user->account->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_lastname')) - - {{ $errors->first('shipping_lastname') }} - - @endif - -
-
-
-
- - {{ Form::text('shipping_address', $user->account->shipping_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_address')) - - {{ $errors->first('shipping_address') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_address_2', $user->account->shipping_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }} - @if ($errors->has('shipping_address_2')) - - {{ $errors->first('shipping_address_2') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_zipcode', $user->account->shipping_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_zipcode')) - - {{ $errors->first('shipping_zipcode') }} - - @endif - -
-
- - {{ Form::text('shipping_city', $user->account->shipping_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_city')) - - {{ $errors->first('shipping_city') }} - - @endif -
-
- diff --git a/resources/views/user/order/shipping_ot.blade.php b/resources/views/user/order/shipping_ot.blade.php index 9086507..b4ecfa4 100644 --- a/resources/views/user/order/shipping_ot.blade.php +++ b/resources/views/user/order/shipping_ot.blade.php @@ -1,87 +1,21 @@ @if($shopping_user->same_as_billing) + + {{ Form::hidden('shipping_company', $shopping_user->billing_company) }} + {{ Form::hidden('shipping_salutation', $shopping_user->billing_salutation) }} + {{ Form::hidden('shipping_firstname', $shopping_user->billing_first_name) }} + {{ Form::hidden('shipping_lastname', $shopping_user->billing_last_name) }} + {{ Form::hidden('shipping_address', $shopping_user->billing_address) }} + {{ Form::hidden('shipping_address_2', $shopping_user->billing_address_2) }} + {{ Form::hidden('shipping_zipcode', $shopping_user->billing_zipcode) }} + {{ Form::hidden('shipping_city', $shopping_user->billing_city) }} + {{ Form::hidden('shipping_phone', $shopping_user->billing_phone) }} + +
-
-
- - {{ Form::text('shipping_company', $shopping_user->billing_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }} -
-
-
-
- - - @if ($errors->has('shipping_salutation')) - - {{ $errors->first('shipping_salutation') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_firstname', $shopping_user->billing_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_firstname')) - - {{ $errors->first('shipping_firstname') }} - - @endif - -
-
- - {{ Form::text('shipping_lastname', $shopping_user->billing_lastname, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_lastname')) - - {{ $errors->first('shipping_lastname') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_address', $shopping_user->billing_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_address')) - - {{ $errors->first('shipping_address') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_address_2', $shopping_user->billing_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }} -
-
-
-
- - {{ Form::text('shipping_zipcode', $shopping_user->billing_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_zipcode')) - - {{ $errors->first('shipping_zipcode') }} - - @endif -
-
- - {{ Form::text('shipping_city', $shopping_user->billing_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_city')) - - {{ $errors->first('shipping_city') }} - - @endif -
-
- @@ -92,119 +26,31 @@ @endif
-
-
- - {{ Form::text('shipping_phone', $shopping_user->billing_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }} -
-
@else + {{ Form::hidden('shipping_company', $shopping_user->shipping_company) }} + {{ Form::hidden('shipping_salutation', $shopping_user->shipping_salutation) }} + {{ Form::hidden('shipping_firstname', $shopping_user->shipping_firstname) }} + {{ Form::hidden('shipping_lastname', $shopping_user->shipping_lastname) }} + {{ Form::hidden('shipping_address', $shopping_user->shipping_address) }} + {{ Form::hidden('shipping_address_2', $shopping_user->shipping_address_2) }} + {{ Form::hidden('shipping_zipcode', $shopping_user->shipping_zipcode) }} + {{ Form::hidden('shipping_city', $shopping_user->shipping_city) }} + {{ Form::hidden('shipping_phone', $shopping_user->shipping_phone) }}
-
-
- - {{ Form::text('shipping_company', $shopping_user->shipping_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }} -
-
-
-
- - - @if ($errors->has('shipping_salutation')) - - {{ $errors->first('shipping_salutation') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_firstname', $shopping_user->shipping_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_firstname')) - - {{ $errors->first('shipping_firstname') }} - - @endif -
-
- - {{ Form::text('shipping_lastname', $shopping_user->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_lastname')) - - {{ $errors->first('shipping_lastname') }} - - @endif - -
-
-
-
- - {{ Form::text('shipping_address', $shopping_user->shipping_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_address')) - - {{ $errors->first('shipping_address') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_address_2', $shopping_user->shipping_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }} - @if ($errors->has('shipping_address_2')) - - {{ $errors->first('shipping_address_2') }} - - @endif -
-
-
-
- - {{ Form::text('shipping_zipcode', $shopping_user->shipping_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_zipcode')) - - {{ $errors->first('shipping_zipcode') }} - - @endif - -
-
- - {{ Form::text('shipping_city', $shopping_user->shipping_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }} - @if ($errors->has('shipping_city')) - - {{ $errors->first('shipping_city') }} - - @endif -
-
-
-
- - - @if ($errors->has('shipping_state')) - - {{ $errors->first('shipping_state') }} - - @endif -
-
- -
-
- - {{ Form::text('shipping_phone', $shopping_user->shipping_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }} -
+
+
+ + @if ($errors->has('shipping_state')) + + {{ $errors->first('shipping_state') }} + + @endif
+
@endif \ No newline at end of file diff --git a/resources/views/user/order/yard_view_form.blade.php b/resources/views/user/order/yard_view_form.blade.php index dfc4979..f85306f 100644 --- a/resources/views/user/order/yard_view_form.blade.php +++ b/resources/views/user/order/yard_view_form.blade.php @@ -2,30 +2,126 @@ @if(Yard::instance('shopping')->content()->count()) @if(Yard::instance('shopping')->compCount() > 0) - -
- - - - - - - - - - - + +
+ +
+
+
+
 
+
+
+
+
+ Artikel +
+
+ Einzelpreis +
+
+ Anzahl +
+
+
+
+
+ @foreach(Yard::instance('shopping')->getContentByOrder() as $row) @php($product = \App\Models\Product::find($row->id)) -
- - - +
+ @if(!$row->options->comp) + Artikel entfernen + @else + @if(Yard::instance('shopping')->getNumComp() > 1) + {{$row->options->comp}}. Kompensationsprodukt + @else + Kompensationsprodukt + @endif -
- + @endif + + + +
+
{{ Yard::instance('shopping')->rowPriceNet($row, 3) }} €
+
+ +
+
+ @if($row->options->comp) + 1 x + @else + + @endif +
+
+
{{ Yard::instance('shopping')->rowSubtotalNet($row) }} €
+
+ +
+ + + + @endforeach - -
Produkt
Netto-Preis
AnzahlSumme
-
- @if($row->options->has('image')) - - @else - - @endif +
+ +
+ @if($row->options->has('image')) + + @else + + @endif +
+ +
+
+
{{ $row->name }}
@@ -33,32 +129,45 @@
Art.-Nr.: {{ $product->number }}
-
-
-
{{ Yard::instance('shopping')->rowPriceNet($row, 3) }} €
-
- @if($row->options->comp) -
1x KP
- @else -
- - - - -
- @endif -
-
{{ Yard::instance('shopping')->rowSubtotalNet($row) }} €
-
-
+
+
+
@@ -75,7 +184,7 @@ {{ Yard::instance('shopping')->subtotal() }} € - Versandland: + Lieferland: {{ Yard::instance('shopping')->getShippingCountryName() }} diff --git a/resources/views/web/templates/card.blade.php b/resources/views/web/templates/card.blade.php index 4888edd..ef8df5f 100644 --- a/resources/views/web/templates/card.blade.php +++ b/resources/views/web/templates/card.blade.php @@ -315,7 +315,7 @@
-
Versandland:
+
Lieferland:
+ - Bei der Änderung des Versandlandes werden die Versandkosten neu berechnet. + Bei der Änderung des Lieferlandes werden die Versandkosten neu berechnet.
@@ -306,56 +306,70 @@ {!! Form::hidden('billing_country_id', \App\Services\Shop::getShippingCountryCountryId($shopping_user->billing_state)) !!}
+ @if($shopping_user->billing_company)
-
Firma
- {{ $shopping_user->billing_company }} +
Firma
+
{{ $shopping_user->billing_company }}
@endif
-
Anrede
- {{ \App\Services\HTMLHelper::getSalutationLang($shopping_user->billing_salutation) }} +
Anrede
+
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_user->billing_salutation) }}
-
Vorname
- {{ $shopping_user->billing_firstname }} +
Vorname
+
{{ $shopping_user->billing_firstname }}
-
Nachname
- {{ $shopping_user->billing_lastname }} +
Nachname
+
{{ $shopping_user->billing_lastname }}
-
Straße
- {{ $shopping_user->billing_address }} +
Straße
+
{{ $shopping_user->billing_address }}
-
Zusatz
- {{ $shopping_user->billing_address_2 }} +
Zusatz
+
{{ $shopping_user->billing_address_2 }}
-
PLZ
- {{ $shopping_user->billing_zipcode }} +
PLZ
+
{{ $shopping_user->billing_zipcode }}
-
Stadt
- {{ $shopping_user->billing_city }} +
Stadt
+
{{ $shopping_user->billing_city }}
-
Land
- {{ $shopping_user->billing_country->getLocated() }} +
Land
+
{{ $shopping_user->billing_country->getLocated() }}
-
Telefon
- {{ $shopping_user->billing_phone }} +
Telefon
+
{{ $shopping_user->billing_phone }}
-
E-Mail
- {{ $shopping_user->billing_email }} +
E-Mail
+
{{ $shopping_user->billing_email }}
-

Deine hinterlegten Rechnungsdaten können nur im Salescenter geändert werden.

+
+

Deine Rechnungsadresse kann nur im Salescenter geändert werden.

@endif @@ -376,18 +390,15 @@ @endif
-
- -
-
- + - -
- @@ -403,7 +414,7 @@

Lieferadresse des Kunden

@endif @else -

Versand Adresse

+

Lieferadresse

@endif
@@ -494,12 +505,16 @@
- - - - Bei der Änderung des Landes werden die Versandkosten neu berechnet. + + + + @if($is_from === 'user_order' && $is_for === 'me') + Das Lieferland kann nur bei der Bestellübersicht geändert werden. + @else + Bei der Änderung des Landes werden die Versandkosten neu berechnet. + @endif
@@ -793,7 +808,7 @@
{{ Yard::instance('shopping')->getShippingCountryName() }} - Versandland: + Lieferland:

@@ -870,22 +885,22 @@ } if(jQuery('#shipping').is(":visible")) { _scrollTo('#shipping', 150); - showShippingCountryFor('shipping'); - }else{ showShippingCountryFor('billing'); + }else{ + showShippingCountryFor('shipping'); } }); }); if(!jQuery('#shipswitch').is(':checked')){ + showShippingCountryFor('billing'); + }else{ jQuery('#shipping').show(); showShippingCountryFor('shipping'); - - }else{ - showShippingCountryFor('billing'); } + jQuery('.quick-cart-box-close').on('click', function () { jQuery('.quick-cart-box').css('display', 'none'); });