From 59058f0aa72c2897d8dd95cdac12c133298e77c5 Mon Sep 17 00:00:00 2001 From: Purvesh Date: Fri, 5 Feb 2021 21:53:19 +1300 Subject: [PATCH 1/3] bread crumb and lang changes --- .../Account/DashboardController.php | 2 +- resources/lang/en/avored.php | 92 +++------ .../views/account/address/_fields.blade.php | 4 +- .../views/account/address/create.blade.php | 55 +++--- .../views/account/address/edit.blade.php | 59 +++--- .../views/account/address/index.blade.php | 180 +++++++++--------- resources/views/account/dashboard.blade.php | 87 ++++++--- resources/views/account/edit.blade.php | 73 ++++--- resources/views/account/order/index.blade.php | 50 ++--- resources/views/account/order/show.blade.php | 42 ++-- resources/views/account/upload.blade.php | 53 ++++-- resources/views/auth/login.blade.php | 39 ++-- .../views/auth/passwords/email.blade.php | 2 +- .../views/auth/passwords/reset.blade.php | 6 +- resources/views/auth/register.blade.php | 10 +- .../views/checkout/cards/personal.blade.php | 10 +- .../checkout/cards/shipping-address.blade.php | 4 +- resources/views/layouts/user.blade.php | 11 +- .../views/partials/account-nav.blade.php | 10 +- 19 files changed, 435 insertions(+), 354 deletions(-) diff --git a/app/Http/Controllers/Account/DashboardController.php b/app/Http/Controllers/Account/DashboardController.php index 67904e85e..39c33980b 100644 --- a/app/Http/Controllers/Account/DashboardController.php +++ b/app/Http/Controllers/Account/DashboardController.php @@ -13,7 +13,7 @@ class DashboardController extends Controller */ public function index() { - $user = Auth::user(); + $user = Auth::guard('customer')->user(); return view('account.dashboard', compact('user')); } } diff --git a/resources/lang/en/avored.php b/resources/lang/en/avored.php index 149f8798b..6495ec167 100644 --- a/resources/lang/en/avored.php +++ b/resources/lang/en/avored.php @@ -24,74 +24,34 @@ 'state' => 'State', 'city' => 'City', 'postcode' => 'Postcode', - 'fields' => [ - 'email' => 'Email Address', - 'password' => 'Password', - 'first_name' => 'First Name', - 'last_name' => 'Last Name', - 'password_confirmation' => 'Confirm password', - 'image' => 'Image', - 'address2' => 'Address2', - 'company_name' => 'Company Name', - 'phone' => 'Phone', - 'address1' => 'Address 1', - 'postcode' => 'Postcode', - 'state' => 'State', - 'city' => 'City', - 'country_id' => 'Country' - ], - 'properties' => 'Properties', - 'my_wishlist' => 'My Wishlist', - 'customer_wishlists' => 'Customer Wishlists', - 'not_available' => 'Not Available', - 'add_to_cart' => 'Add To Cart', - 'add_to_wishlist' => 'Add To Wishlist', - 'remove_to_wishlist' => 'Remove from Wishlist', - 'availability' => 'Availability: Total In Stock', 'home' => 'Home', - 'reset_password' => 'Reset Password', + 'orders' => 'Orders', + 'account' => 'Account', + 'edit' => 'Edit', + 'email' => 'Email', + 'account_edit' => 'Account Edit', + 'account_dashboard' => 'Account Dashboard', + 'edit_user_personal_info' => 'Edit User Personal Information', + 'update_your_password' => 'Update your password', + 'save' => 'Save', + 'cancel' => 'Cancel', + 'password' => 'Password', + 'password_confirmation' => 'Confirm Password', + 'my_wishlist' => 'My Wishlist', + 'user_personal_info' => 'User Personal Information', + 'login_title' => 'Login to your Account', + 'remember_me' => 'Remember me', + 'forgot_password' => 'Forgor your password?', + 'sign_in' => 'Sign in', 'login' => 'Login', - 'password_update' => 'Update Password', - 'user_dashboard' => 'User Dashboard', + 'upload' => 'Upload', + 'upload_user_picture' => 'Upload User Picture', + 'image' => 'Image', + 'addresses' => 'Addresses', + 'edit_address' => 'Edit Address', + 'create_address' => 'Create Address', + 'create' => 'Create', 'show_order' => 'Show Order', - 'cart' => 'Cart', - 'page' => 'Page', - 'product' => 'Product', - 'qty' => 'Qty', - 'unit_price' => 'Unit Price', - 'total_price' => 'Total Price', - 'subtotal' => 'Sub Total', - 'discount_coupon' => 'Discount Coupon', - 'discount' => 'Discount', - 'total' => 'Total', - 'checkout' => 'Checkout', - 'user_personal_info' => 'User Personal Information', - 'user_shipping_address' => 'User Shipping Address', - 'user' => 'User', - 'billing_address' => 'Billing Address', - 'btn' => [ - 'sign_in' => 'Sign In', - 'register' => 'Register', - 'save' => 'Save', - 'cancel' => 'Cancel', - 'create' => 'Create', - 'apply' => 'Apply', - 'place_order' => 'Place Order' - ], - 'pages' => [ - - 'login' => [ - 'title' => 'Login to your Account', - 'remember_me' => 'Remember Me', - 'forgot_password' => 'Forgot password?' - ], - 'register' => [ - 'title' => 'Register your Account', - ], - 'account_dashboard' => [ - 'title' => 'Dashboard' - ], - - ], + 'add_to_cart' => 'Add to cart' ]; diff --git a/resources/views/account/address/_fields.blade.php b/resources/views/account/address/_fields.blade.php index 1687764d6..6d6d26419 100644 --- a/resources/views/account/address/_fields.blade.php +++ b/resources/views/account/address/_fields.blade.php @@ -12,7 +12,7 @@
+ + +
  • + + {{ __('avored.create_address') }} + +
  • + + + @endsection @section('content') -
    -
    -

    {{ __('Create Address') }}

    +
    +
    +
    +

    {{ __('avored.create_address') }}

    +
    +
    +
    @@ -41,13 +52,13 @@ class="px-6 py-3 font-semibold leading-7 text-white hover:text-white bg-red-600 - {{ __('avored.btn.save') }} + {{ __('avored.save') }} - {{ __('avored.btn.cancel') }} + {{ __('avored.cancel') }}
    diff --git a/resources/views/account/address/edit.blade.php b/resources/views/account/address/edit.blade.php index 340fbd854..a68fee601 100644 --- a/resources/views/account/address/edit.blade.php +++ b/resources/views/account/address/edit.blade.php @@ -1,36 +1,46 @@ @extends('layouts.user') @section('breadcrumb') - + + +
  • + + {{ __('avored.edit_address') }} + +
  • + + + @endsection @section('content') -
    -
    - -
    +
    +
    +
    +

    {{ __('avored.edit_address') }}

    +
    +
    +
    + @csrf @method('put') @@ -43,18 +53,17 @@ class="px-6 py-3 font-semibold leading-7 text-white hover:text-white bg-red-600 - {{ __('avored.btn.save') }} + {{ __('avored.save') }} - {{ __('avored.btn.cancel') }} + {{ __('avored.cancel') }}
    -
    diff --git a/resources/views/account/address/index.blade.php b/resources/views/account/address/index.blade.php index f996a3057..23004370c 100644 --- a/resources/views/account/address/index.blade.php +++ b/resources/views/account/address/index.blade.php @@ -1,101 +1,109 @@ @extends('layouts.user') - @section('breadcrumb') - + + +
  • + + {{ __('avored.addresses') }} + +
  • + + + @endsection - @section('content') -
    -
    -

    {{ __('User Addressses') }}

    - - - {{ __('avored.btn.create') }} - - +
    +
    +
    +

    {{ __('avored.addresses') }}

    + + + {{ __('avored.create') }} + + +
    -
    -
    - @foreach ($userAddresses as $address) -
    -
    -
    - - {{ $address->type }} - - -
    - - - - -
    -
    +
    +
    -
    -
    - - @if(empty($address)) -

    {{ $address->first_name }} {{ $address->last_name }}

    -

    {{ $address->company_name }}

    -

    {{ $address->phone }}

    -

    {{ $address->address1 }}, {{ $address->address2 }}

    -

    {{ $address->city }}, {{ $address->postcode }}

    -

    {{ $address->state }}: {{ $address->country->name }}

    - @else - The Shipping Address is empty - @endif + @foreach ($userAddresses as $address) +
    +
    +
    + + {{ $address->type }} + + +
    + + + + +
    +
    + +
    +
    + + @if(empty($address)) +

    {{ $address->first_name }} {{ $address->last_name }}

    +

    {{ $address->company_name }}

    +

    {{ $address->phone }}

    +

    {{ $address->address1 }}, {{ $address->address2 }}

    +

    {{ $address->city }}, {{ $address->postcode }}

    +

    {{ $address->state }}: {{ $address->country->name }}

    + @else + The Shipping Address is empty + @endif +
    -
    +
    + @endforeach
    - @endforeach +
    - @endsection diff --git a/resources/views/account/dashboard.blade.php b/resources/views/account/dashboard.blade.php index 27750f750..79adb73bb 100644 --- a/resources/views/account/dashboard.blade.php +++ b/resources/views/account/dashboard.blade.php @@ -1,36 +1,73 @@ @extends('layouts.user') @section('breadcrumb') - + + +
  • + + {{ __('avored.account_dashboard') }} + + +
  • +
  • + + {{ __('avored.account') }} + +
  • + + + @endsection @section('content') -
    -
    -
    - - {{ __('avored.pages.account_dashboard.title') }} - - - - Edit - - + +
    +
    +
    +

    + {{ __('avored.user_personal_info') }} +

    + +
    +
    +
    +
    +
    +
    + {{ __('avored.first_name') }} +
    +
    + {{ $user->first_name }} +
    -
    -

    First Name: {{ $user->first_name }}

    -

    Last Name: {{ $user->last_name }}

    -

    Email: {{ $user->email }}

    +
    +
    + {{ __('avored.last_name') }} +
    +
    + {{ $user->last_name }} +
    -
    +
    +
    + {{ __('avored.email') }} +
    +
    + {{ $user->email }} +
    +
    +
    +
    +
    + @endsection diff --git a/resources/views/account/edit.blade.php b/resources/views/account/edit.blade.php index c3f9c8c94..590d04f37 100644 --- a/resources/views/account/edit.blade.php +++ b/resources/views/account/edit.blade.php @@ -1,33 +1,46 @@ @extends('layouts.user') @section('breadcrumb') - + + +
  • + + {{ __('avored.account_edit') }} + +
  • + + + @endsection @section('content') -
    -
    +
    +
    +
    +

    + {{ __('avored.edit_user_personal_info') }} +

    +
    +
    +
    @csrf
    - {{ __('avored.btn.save') }} + {{ __('avored.save') }} - {{ __('avored.btn.cancel') }} + {{ __('avored.cancel') }}
    +
    +
    +
    +
    +
    +

    + {{ __('avored.update_your_password') }} +

    +
    +
    +
    @csrf
    @@ -91,7 +115,7 @@ class="px-6 py-3 font-semibold inline-block text-white leading-7 hover:text-whit
    - {{ __('avored.btn.save') }} + {{ __('avored.save') }} - {{ __('avored.btn.cancel') }} + {{ __('avored.cancel') }}
    +
    @endsection diff --git a/resources/views/account/order/index.blade.php b/resources/views/account/order/index.blade.php index 289f5af5b..7ab024bc2 100644 --- a/resources/views/account/order/index.blade.php +++ b/resources/views/account/order/index.blade.php @@ -1,35 +1,41 @@ @extends('layouts.user') @section('breadcrumb') - + + +
  • + + {{ __('avored.orders') }} + +
  • + + @endsection @section('content') -
    -
    -

    {{ __('Orders') }}

    +
    +
    +
    +

    {{ __('avored.orders') }}

    +
    -
    -
    -
    - - - +
    +
    diff --git a/resources/views/account/order/show.blade.php b/resources/views/account/order/show.blade.php index 187d59085..f730d8666 100644 --- a/resources/views/account/order/show.blade.php +++ b/resources/views/account/order/show.blade.php @@ -1,21 +1,33 @@ @extends('layouts.user') @section('breadcrumb') - + @endsection diff --git a/resources/views/account/upload.blade.php b/resources/views/account/upload.blade.php index 13f5b1a71..99d500eec 100644 --- a/resources/views/account/upload.blade.php +++ b/resources/views/account/upload.blade.php @@ -1,35 +1,47 @@ @extends('layouts.user') @section('breadcrumb') - + + +
  • + + {{ __('avored.upload') }} + +
  • + + + @endsection @section('content') -
    -
    +
    +
    +
    +

    + {{ __('avored.upload_user_picture') }} +

    +
    +
    +
    -
    @csrf
    @if ($errors->has('file')) @@ -46,21 +58,20 @@ class="px-6 py-3 font-semibold leading-7 text-white hover:text-white bg-red-600 - {{ __('avored.btn.save') }} + {{ __('avored.save') }} - {{ __('avored.btn.cancel') }} + {{ __('avored.cancel') }}
    - +
    -
    diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 28dec5429..f85d9b1b8 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,16 +1,23 @@ @extends('layouts.app') @section('breadcrumb') -
    -
      -
    1. - - {{ __('avored.home') }} >> - -
    2. -
    3. {{ __('avored.login') }}
    4. -
    -
    + @endsection @section('content') @@ -23,7 +30,7 @@ alt="AvoRed Ecommerce" />

    - {{ __('avored.pages.login.title') }} + {{ __('avored.login_title') }}

    @@ -32,7 +39,7 @@
    @@ -87,7 +94,7 @@ class="h-5 w-5 text-red-500 group-hover:text-red-400" /> - {{ __('avored.btn.sign_in') }} + {{ __('avored.sign_in') }}
    diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 3a2e16cfe..ee2355fce 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -32,7 +32,7 @@
    @@ -14,7 +14,7 @@
    @@ -27,7 +27,7 @@
    @@ -38,7 +38,7 @@
    diff --git a/resources/views/layouts/user.blade.php b/resources/views/layouts/user.blade.php index 306516b83..0fcfa07c3 100644 --- a/resources/views/layouts/user.blade.php +++ b/resources/views/layouts/user.blade.php @@ -17,7 +17,8 @@ - @if(file_exists(public_path('mix-manifest.json'))) + + @if(env('APP_ENV') === 'testing1' && file_exists(public_path('mix-manifest.json'))) @else @@ -30,11 +31,11 @@
    @include('partials.nav') -
    +
    @yield('breadcrumb')
    -
    +
    @include('partials.account-nav')
    @@ -54,7 +55,7 @@
    - @if(file_exists(public_path('mix-manifest.json'))) + @if(env('APP_ENV') === 'testing1' && file_exists(public_path('mix-manifest.json'))) @else @@ -62,7 +63,7 @@ @stack('scripts') - @if(file_exists(public_path('mix-manifest.json'))) + @if(env('APP_ENV') === 'testing1' && file_exists(public_path('mix-manifest.json'))) @else diff --git a/resources/views/partials/account-nav.blade.php b/resources/views/partials/account-nav.blade.php index 1e4bdb793..9a662d55c 100644 --- a/resources/views/partials/account-nav.blade.php +++ b/resources/views/partials/account-nav.blade.php @@ -1,12 +1,6 @@ -
    -
    -
    - {{ __('avored.discount') }} -
    -
    - - - @{{ defaultCurrency.symbol }}@{{ discountTotal }} + @if (Cart::discount() > 0) +
    +
    + {{ __('avored.discount') }} +
    +
    + - + @{{ defaultCurrency.symbol }}@{{ discountTotal }} +
    -
    + @endif
    -
    {{ $categoryFilter->filter->name }}
    +
    +
    + {{ $categoryFilter->filter->name }} +
    +
    @if($categoryFilter->type == 'PROPERTY' && $categoryFilter->filter->use_for_category_filter) @if ( @@ -38,8 +42,9 @@ @foreach ($categoryFilter->filter->dropdown as $dropdownOption)

    - get('a___' . $categoryFilter->filter->slug) !== null && + get('a___' . $categoryFilter->filter->slug) !== null && in_array($dropdownOption->id, request()->get('a___' . $categoryFilter->filter->slug)) ) checked @@ -49,7 +54,7 @@ '{{ $categoryFilter->filter->slug }}', '{{ $dropdownOption->id }}', 'ATTRIBUTE')" - /> + > {{ $dropdownOption->display_text }}

    @@ -57,5 +62,6 @@ @endif @endif
    +
    @endforeach diff --git a/resources/views/category/card/product.blade.php b/resources/views/category/card/product.blade.php index ed0d31e36..670fda6e3 100644 --- a/resources/views/category/card/product.blade.php +++ b/resources/views/category/card/product.blade.php @@ -1,62 +1,61 @@ @php $product->main_image_url = empty($product->mainImage) ? 'https://placehold.it/250x250' : asset('storage/'.$product->mainImage->path); @endphp -
    -
    - - {{ $product->name }} - -
    -

    {{ $product->name }}

    -

    {{ number_format($product->qty, 0) }} in Stock

    -
    -
    -
    - {{ session()->get('default_currency')->symbol . number_format($product->price, 2) }} -
    -
    -
    -
    -
    - @csrf - - - -
    -
    - guard('customer')->user(); - ?> - @if (($customer === null) || !($customer && $wishlistRepository->customerHasProduct($customer, $product->id))) -
    - @csrf - - -
    - @else -
    - @csrf - - -
    - @endif - -
    +
    + + {{ $product->name }} + +
    +

    {{ $product->name }}

    +

    {{ number_format($product->qty, 0) }} in Stock

    +
    +
    +
    + {{ session()->get('default_currency')->symbol . number_format($product->price, 2) }} +
    +
    +
    +
    +
    + @csrf + + + +
    +
    + guard('customer')->user(); + ?> + @if (($customer === null) || !($customer && $wishlistRepository->customerHasProduct($customer, $product->id))) + +
    + @csrf + + +
    + @else +
    + @csrf + + +
    + @endif +
    -
    -
    -
    +
    +
    +
    diff --git a/resources/views/category/show.blade.php b/resources/views/category/show.blade.php index 1cf2347c5..e903fc4cc 100644 --- a/resources/views/category/show.blade.php +++ b/resources/views/category/show.blade.php @@ -31,14 +31,20 @@
    @include('category.card.filters')
    +
    -

    {{ $category->name }}

    -
    -
    - @foreach ($categoryProducts as $product) - @include('category.card.product', ['product' => $product]) - @endforeach -
    +

    + {{ $category->name }} +

    +
    +
    + @foreach ($categoryProducts as $product) +
    + @include('category.card.product', ['product' => $product]) +
    + @endforeach +
    +
    diff --git a/resources/views/checkout/cards/cart-items.blade.php b/resources/views/checkout/cards/cart-items.blade.php index 3b13dbec0..d98bd1471 100644 --- a/resources/views/checkout/cards/cart-items.blade.php +++ b/resources/views/checkout/cards/cart-items.blade.php @@ -1,5 +1,5 @@ -

    {{ __('Cart Information') }}

    +

    {{ __('avored.cart_information') }}

    Image
    @@ -25,15 +25,17 @@
    {{ session()->get('default_currency')->symbol }}@{{ parseFloat((item.qty * item.price) + item.tax).toFixed(2) }}
    -
    -
    -
    -
    -
    Discount
    -
    - - {{ session()->get('default_currency')->symbol }}{{ Cart::discount() }} +@if(Cart::discount() > 0) +
    +
    +
    +
    +
    Discount
    +
    + - {{ session()->get('default_currency')->symbol }}{{ Cart::discount() }} +
    -
    +@endif
    diff --git a/resources/views/checkout/cards/payment-option.blade.php b/resources/views/checkout/cards/payment-option.blade.php index 417fc95d1..beb266c11 100644 --- a/resources/views/checkout/cards/payment-option.blade.php +++ b/resources/views/checkout/cards/payment-option.blade.php @@ -1,5 +1,5 @@ -

    {{ __('Payment Options') }}

    +

    {{ __('avored.payment_options') }}

    @foreach ($paymentOptions as $payment)

    diff --git a/resources/views/checkout/show.blade.php b/resources/views/checkout/show.blade.php index 98a144271..bf1e1aceb 100644 --- a/resources/views/checkout/show.blade.php +++ b/resources/views/checkout/show.blade.php @@ -1,20 +1,23 @@ @extends('layouts.app') @section('breadcrumb') -

    -
      -
    1. - - {{ __('avored.home') }} -   >   -
    2. -
    3. - - {{ __('avored.checkout') }} - -
    4. -
    -
    + @endsection @@ -25,7 +28,7 @@ inline-template>

    - {{ __('avored.checkout') }} {{ __('avored.page') }} + {{ __('avored.checkout_page') }}

    - {{ __('avored.btn.place_order') }} + {{ __('avored.place_order') }}
    diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 5bd7cb956..1db777d38 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -50,15 +50,15 @@
    - @if(env('APP_ENV') === 'testing1' && file_exists(public_path('mix-manifest.json'))) + @if(env('APP_ENV') === 'local' && file_exists(public_path('mix-manifest.json'))) @else @endif - @stack('scripts') + {{-- @stack('scripts') --}} - @if(env('APP_ENV') === 'testing1' && file_exists(public_path('mix-manifest.json'))) + @if(env('APP_ENV') === 'local' && file_exists(public_path('mix-manifest.json'))) @else