From c129a44383e0df4491caf3257edb03257f8f87f9 Mon Sep 17 00:00:00 2001 From: Kevin Adametz Date: Wed, 12 Dec 2018 14:33:52 +0100 Subject: [PATCH] Card + Products --- .env | 2 +- .idea/mivita.care.iml | 1 + .idea/php.xml | 1 + .idea/workspace.xml | 1023 ++++--- .phpstorm.meta.php | 16 +- _ide_helper.php | 546 +++- _ide_helper_models.php | 12 + _static/assets/LESS/LESS_BS3/config.codekit3 | 2597 +++++++++-------- app/Http/Controllers/AdminUserController.php | 18 + app/Http/Controllers/Api/KasController.php | 89 + app/Http/Controllers/Web/CardController.php | 101 + app/Http/Controllers/Web/SiteController.php | 12 +- app/Models/Attribute.php | 2 + app/Models/Category.php | 4 + app/Models/Product.php | 3 + app/Models/ProductImage.php | 3 + app/Providers/YardServiceProvider.php | 30 + app/Services/Facade/Yard.php | 19 + app/Services/HTMLHelper.php | 5 - app/Services/Yard.php | 167 ++ bootstrap/cache/packages.php | 11 + bootstrap/cache/services.php | 68 +- composer.json | 1 + composer.lock | 62 +- config/app.php | 4 +- config/cart.php | 67 + config/ide-helper.php | 1 + ...11_20_174609_create_shoppingcart_table.php | 30 + public/css/custom-forms-v2.css | 311 ++ .../views/web/layouts/application.blade.php | 28 + .../web/layouts/includes/header.blade.php | 92 + .../views/web/templates/_categories.blade.php | 9 +- resources/views/web/templates/card.blade.php | 235 ++ .../web/templates/checkout-final.blade.php | 119 + .../views/web/templates/checkout.blade.php | 420 +++ .../web/templates/produkte-show.blade.php | 60 +- .../views/web/templates/produkte.blade.php | 72 +- routes/web.php | 37 +- 38 files changed, 4489 insertions(+), 1789 deletions(-) create mode 100755 app/Http/Controllers/Api/KasController.php create mode 100755 app/Http/Controllers/Web/CardController.php create mode 100755 app/Providers/YardServiceProvider.php create mode 100644 app/Services/Facade/Yard.php create mode 100644 app/Services/Yard.php create mode 100644 config/cart.php create mode 100644 database/migrations/2018_11_20_174609_create_shoppingcart_table.php create mode 100755 public/css/custom-forms-v2.css create mode 100644 resources/views/web/templates/card.blade.php create mode 100644 resources/views/web/templates/checkout-final.blade.php create mode 100644 resources/views/web/templates/checkout.blade.php diff --git a/.env b/.env index 076d594..b72a686 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ APP_NAME="mivita.care" APP_ENV=local APP_DEBUG=true -APP_KEY=base64:fXRSayOEVbHeLShA01AWFSzaGDrwn201yfdCigNhqTg= +APP_KEY=base64:HrWQ9AV3Zt2TU0iq1OeUUpTUaXwNUdh8xHmx7RXTif4= APP_URL=http://mivita.local/login LOG_CHANNEL=stack diff --git a/.idea/mivita.care.iml b/.idea/mivita.care.iml index 3ea9f85..7bdb327 100644 --- a/.idea/mivita.care.iml +++ b/.idea/mivita.care.iml @@ -22,6 +22,7 @@ + diff --git a/.idea/php.xml b/.idea/php.xml index f906430..2b86738 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -99,6 +99,7 @@ + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fda2eca..d6821f0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,71 +2,39 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + - - + + - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + yout tem ?> + exca + tax + instance + priceTax + instance( + confi + cartIt + form + form> + + + + + + + + + + + + + + + + + + + + + + + + @@ -196,35 +301,9 @@ @@ -373,11 +478,11 @@ + - @@ -387,7 +492,6 @@ - @@ -395,17 +499,6 @@ - - - - - - - - - - - @@ -444,6 +537,12 @@ + + + + + + @@ -456,11 +555,29 @@ + + + + + + + + + + + + + + + + + + @@ -570,6 +687,7 @@ × {{ $row->price() }} € +
+ + + @endforeach + + Warenkorb löschen + + +
+ + + + {!! Form::close() !!} + + @endif + + + + + +
+ + @if(Yard::instance('shopping')->content()->count()) +

Warenkorb Summe

+ + +
+
+
+ +
+ {{ Yard::instance('shopping')->total() }} € + Zwischensumme: +
+ +
+ {{ Yard::instance('shopping')->shipping() }} € + Versandkosten: +
+ +
+ +
+ {{ Yard::instance('shopping')->subtotalWithShipping() }} € + Summe ohne MwSt: +
+ +
+ {{ Yard::instance('shopping')->taxWithShipping() }} € + zzgl. {{ Yard::getTaxRate() }} % MwSt.: +
+ +
+ + + {{ Yard::instance('shopping')->totalWithShipping() }} € + Gesamtsumme: + + + + zur Kasse +
+
+
+ @endif + +
+ + + + +

+
+

Alle Preise inkl. gesetzl. Mehrwertsteuer zzgl. Versandkosten, wenn nicht anders beschrieben

+ + + + + +@endsection \ No newline at end of file diff --git a/resources/views/web/templates/checkout-final.blade.php b/resources/views/web/templates/checkout-final.blade.php new file mode 100644 index 0000000..7d768f3 --- /dev/null +++ b/resources/views/web/templates/checkout-final.blade.php @@ -0,0 +1,119 @@ +@extends('web.layouts.layout') + +@section('content') + + + + + + + + +
+
+ + +
+
+

Thank you, John Doe.

+ +

+ Your order has been placed. In a few moments you will receive an order confirmation email from us.
+ If you like, you can explore more products. +

+ +
+ +

+ Thank you very much for choosing us,
+ Inc. +

+
+
+ + +
+
+ + + + + +@endsection \ No newline at end of file diff --git a/resources/views/web/templates/checkout.blade.php b/resources/views/web/templates/checkout.blade.php new file mode 100644 index 0000000..a1fb45d --- /dev/null +++ b/resources/views/web/templates/checkout.blade.php @@ -0,0 +1,420 @@ +@extends('web.layouts.layout') + +@section('content') + + + + + + + {{ Yard::instance('shopping')->setShipping(5.9) }} + + +
+
+ + {{-- + + + + --}} + + + +
+ {!! Form::open(['url' => route('card_checkout_final'), 'class' => 'row clearfix', 'id'=>'']) !!} + + + +
+ + +
+ +

Rechnung & Versand

+ +
+ +
+ +
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + + +
+
+ + + + +
+
+ +
+
+ + +
+
+ + +
+ +
+ +
+
+ + +
+ + + +
+ +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+ +
+ +
+ +
+ +
+ + + + +
+
+ +

Versand Adresse

+ +
+ +
+ +
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + + +
+
+ + + + +
+
+ +
+
+ + +
+
+ + +
+ +
+ +
+
+ + +
+ + + +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + + +
+ + +
+ +

Zahlungsart

+ +
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ + + + + + + +
+
+
+ +
+ {{ Yard::instance('shopping')->total() }} € + Zwischensumme: +
+ +
+ {{ Yard::instance('shopping')->shipping() }} € + Versandkosten: +
+ +
+ +
+ {{ Yard::instance('shopping')->subtotalWithShipping() }} € + Summe ohne MwSt: +
+ +
+ {{ Yard::instance('shopping')->taxWithShipping() }} € + zzgl. {{ Yard::getTaxRate() }} % MwSt.: +
+ +
+ + + {{ Yard::instance('shopping')->totalWithShipping() }} € + Gesamtsumme: + + +
+
+
+ + + {{-- + + +
+
+
+ +
+ +
+ + +
+ +
+
+ + +
+
+ + +
+
+ NOTE: Email address will be used to login + +
+ + + +
+
+
+ + --}} + + {!! Form::close() !!} +
+ + +
+
+ + + + +@endsection \ No newline at end of file diff --git a/resources/views/web/templates/produkte-show.blade.php b/resources/views/web/templates/produkte-show.blade.php index 01de65f..45ad93d 100644 --- a/resources/views/web/templates/produkte-show.blade.php +++ b/resources/views/web/templates/produkte-show.blade.php @@ -2,6 +2,27 @@ @section('content') + diff --git a/resources/views/web/templates/produkte.blade.php b/resources/views/web/templates/produkte.blade.php index 1a0350a..56a9120 100644 --- a/resources/views/web/templates/produkte.blade.php +++ b/resources/views/web/templates/produkte.blade.php @@ -11,7 +11,29 @@ - +
- @endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 663e5ff..be314a5 100755 --- a/routes/web.php +++ b/routes/web.php @@ -15,12 +15,38 @@ Route::domain('mivita.local')->group(function () { - Route::get('/', 'Web\SiteController@index')->name('/'); +Route::get('/', 'Web\SiteController@index')->name('/'); + +Route::get('product/image/{slug}', function($slug = null) +{ + $image = \App\Models\ProductImage::where('slug', $slug)->first(); + $path = storage_path('app/public').'/images/product'.'/'.$image->product_id.'/'.$image->filename; + if (file_exists($path)) { + return Response::file($path); + } +})->name('product_image'); + + Route::get('/card/add/{id}/{quantity?}/{product_slug?}', 'Web\CardController@addToCardGet')->name('card_add_get'); + + Route::post('/card/add/{id}', 'Web\CardController@addToCardPost')->name('card_add_post'); + + Route::get('/card/show', 'Web\CardController@showCard')->name('card_show'); + + Route::get('/card/checkout', 'Web\CardController@checkoutCard')->name('card_checkout'); + Route::post('/card/checkout_final', 'Web\CardController@checkoutFinalCard')->name('card_checkout_final'); + + Route::post('/card/update', 'Web\CardController@updateCard')->name('card_update'); + + Route::get('/card/remove/{rowId}', 'Web\CardController@removeCard')->name('card_remove'); + + Route::get('/card/delete', 'Web\CardController@deleteCard')->name('card_delete'); Route::get('/{site}/{subsite?}/{product_slug?}', 'Web\SiteController@site')->name('site'); + + }); /* ROUTING FOR CRM / CMS*/ @@ -189,14 +215,7 @@ Route::get('/user/update_email_confirm/{token}', 'UpdateEmailController@activate -Route::get('product/image/{slug}', function($slug = null) -{ - $image = \App\Models\ProductImage::where('slug', $slug)->first(); - $path = storage_path('app/public').'/images/product'.'/'.$image->product_id.'/'.$image->filename; - if (file_exists($path)) { - return Response::file($path); - } -})->name('product_image'); + /*Route::get('storage/{what}/{path}/{id}/{file_name}', function($what = null, $path = null, $id = null, $file_name = null) {