diff --git a/app/Criteria/MyCriteria.php b/app/Criteria/MyCriteria.php new file mode 100644 index 000000000..6e32e67b2 --- /dev/null +++ b/app/Criteria/MyCriteria.php @@ -0,0 +1,27 @@ + @rahul-webkul + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ + +class CustomerDataGrid +{ + /** + * The CustomerDataGrid + * implementation. + * + * @var CustomerDataGrid + */ + + public function createCustomerDataGrid() + { + + return DataGrid::make([ + 'name' => 'Customer', + 'table' => 'customers', + 'select' => 'id', + 'perpage' => 10, + 'aliased' => false, //use this with false as default and true in case of joins + + 'massoperations' =>[ + [ + 'route' => route('admin.datagrid.delete'), + 'method' => 'DELETE', + 'label' => 'Delete', + 'type' => 'button', + ], + ], + + 'actions' => [ + [ + 'type' => 'Edit', + 'route' => route('admin.datagrid.delete'), + 'confirm_text' => 'Do you really want to do this?', + 'icon' => 'icon pencil-lg-icon', + ], [ + 'type' => 'Delete', + 'route' => route('admin.datagrid.delete'), + 'confirm_text' => 'Do you really want to do this?', + 'icon' => 'icon trash-icon', + ], + ], + + 'join' => [ + // [ + // 'join' => 'leftjoin', + // 'table' => 'roles as r', + // 'primaryKey' => 'u.role_id', + // 'condition' => '=', + // 'secondaryKey' => 'r.id', + // ] + ], + + //use aliasing on secodary columns if join is performed + + 'columns' => [ + + [ + 'name' => 'id', + 'alias' => 'customerId', + 'type' => 'number', + 'label' => 'ID', + 'sortable' => true, + ], + [ + 'name' => 'first_name', + 'alias' => 'customerFirstName', + 'type' => 'string', + 'label' => 'Name', + 'sortable' => true, + ], + [ + 'name' => 'email', + 'alias' => 'customerEmail', + 'type' => 'string', + 'label' => 'Email', + 'sortable' => true, + ], + [ + 'name' => 'phone', + 'alias' => 'customerPhone', + 'type' => 'number', + 'label' => 'Phone', + 'sortable' => true, + ], + [ + 'name' => 'customer_group_id', + 'alias' => 'customerGroupId', + 'type' => 'number', + 'label' => 'Customer Group', + 'sortable' => true, + ], + ], + + //don't use aliasing in case of filters + + 'filterable' => [ + + [ + 'name' => 'id', + 'alias' => 'customerId', + 'type' => 'number', + 'label' => 'ID', + ], + [ + 'name' => 'first_name', + 'alias' => 'customerFirstName', + 'type' => 'string', + 'label' => 'Name', + ], + [ + 'name' => 'phone', + 'alias' => 'customerPhone', + 'type' => 'number', + 'label' => 'Phone', + ], + [ + 'name' => 'email', + 'alias' => 'customerEmail', + 'type' => 'string', + 'label' => 'Comment', + ], + [ + 'name' => 'customer_group_id', + 'alias' => 'customerGroupId', + 'type' => 'number', + 'label' => 'Status', + ], + ], + + //don't use aliasing in case of searchables + + 'searchable' => [ + [ + 'column' => 'first_name', + 'type' => 'string', + 'label' => 'Title', + ], + [ + 'column' => 'email', + 'type' => 'string', + 'label' => 'Rating', + ], + ], + + //list of viable operators that will be used + 'operators' => [ + 'eq' => "=", + 'lt' => "<", + 'gt' => ">", + 'lte' => "<=", + 'gte' => ">=", + 'neqs' => "<>", + 'neqn' => "!=", + 'like' => "like", + 'nlike' => "not like", + ], + // 'css' => [] + + ]); + + } + + public function render() + { + + return $this->createCustomerDataGrid()->render(); + + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php new file mode 100644 index 000000000..f28a22b61 --- /dev/null +++ b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php @@ -0,0 +1,183 @@ + @rahul-webkul + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ + +class CustomerReviewDataGrid +{ + /** + * The CustomerReviewDataGrid + * implementation. + * + * @var ReviewsDataGrid + * for Reviews + */ + + public function createCustomerReviewDataGrid() + { + + return DataGrid::make([ + 'name' => 'Review', + 'table' => 'product_reviews', + 'select' => 'id', + 'perpage' => 10, + 'aliased' => false, //use this with false as default and true in case of joins + + 'massoperations' =>[ + [ + 'route' => route('admin.datagrid.delete'), + 'method' => 'DELETE', + 'label' => 'Delete', + 'type' => 'button', + ], + ], + + 'actions' => [ + [ + 'type' => 'Edit', + 'route' => route('admin.datagrid.delete'), + 'confirm_text' => 'Do you really want to do this?', + 'icon' => 'icon pencil-lg-icon', + ], [ + 'type' => 'Delete', + 'route' => route('admin.datagrid.delete'), + 'confirm_text' => 'Do you really want to do this?', + 'icon' => 'icon trash-icon', + ], + ], + + 'join' => [ + // [ + // 'join' => 'leftjoin', + // 'table' => 'roles as r', + // 'primaryKey' => 'u.role_id', + // 'condition' => '=', + // 'secondaryKey' => 'r.id', + // ] + ], + + //use aliasing on secodary columns if join is performed + + 'columns' => [ + + [ + 'name' => 'id', + 'alias' => 'reviewId', + 'type' => 'number', + 'label' => 'ID', + 'sortable' => true, + ], + [ + 'name' => 'title', + 'alias' => 'titleName', + 'type' => 'string', + 'label' => 'Title', + 'sortable' => true, + ], + [ + 'name' => 'rating', + 'alias' => 'productRating', + 'type' => 'number', + 'label' => 'Rating', + 'sortable' => true, + ], + [ + 'name' => 'comment', + 'alias' => 'productComment', + 'type' => 'string', + 'label' => 'Comment', + 'sortable' => true, + ], + [ + 'name' => 'status', + 'alias' => 'countryStatus', + 'type' => 'number', + 'label' => 'Status', + 'sortable' => true, + ], + + ], + + //don't use aliasing in case of filters + + 'filterable' => [ + [ + 'name' => 'id', + 'alias' => 'countryId', + 'type' => 'number', + 'label' => 'ID', + ], + [ + 'name' => 'title', + 'alias' => 'titleName', + 'type' => 'string', + 'label' => 'Title', + ], + [ + 'name' => 'rating', + 'alias' => 'productRating', + 'type' => 'number', + 'label' => 'Rating', + ], + [ + 'name' => 'comment', + 'alias' => 'productComment', + 'type' => 'string', + 'label' => 'Comment', + ], + [ + 'name' => 'status', + 'alias' => 'countryStatus', + 'type' => 'number', + 'label' => 'Code', + ], + ], + + //don't use aliasing in case of searchables + + 'searchable' => [ + [ + 'column' => 'title', + 'type' => 'string', + 'label' => 'Title', + ], + [ + 'column' => 'rating', + 'type' => 'number', + 'label' => 'Rating', + ], + ], + + //list of viable operators that will be used + 'operators' => [ + 'eq' => "=", + 'lt' => "<", + 'gt' => ">", + 'lte' => "<=", + 'gte' => ">=", + 'neqs' => "<>", + 'neqn' => "!=", + 'like' => "like", + 'nlike' => "not like", + ], + // 'css' => [] + + ]); + + } + + public function render() + { + return $this->createCustomerReviewDataGrid()->render(); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index a5df6357c..11a76f380 100644 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -36,12 +36,44 @@ Route::group(['middleware' => ['web']], function () { 'redirect' => 'admin.session.create' ])->name('admin.session.destroy'); - //orders page - - // Dashboard Route - Route::get('/dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->name('admin.dashboard.index'); + Route::get('dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->name('admin.dashboard.index'); + //Customers Management Routes + + Route::get('customer', 'Webkul\Core\Http\Controllers\CustomerController@index')->defaults('_config', [ + 'view' => 'admin::customers.index' + ])->name('admin.customer.index'); + + Route::get('customer/orders', 'Webkul\Core\Http\Controllers\CustomerController@index')->defaults('_config',[ + 'view' => 'admin::customers.orders.index' + ])->name('admin.customer.orders.index'); + + Route::get('customer/reviews', 'Webkul\Shop\Http\Controllers\ReviewController@index')->defaults('_config',[ + 'view' => 'admin::customers.review.index' + ])->name('admin.customer.review.index'); + + Route::get('customer/reviews/edit/{id}', 'Webkul\Shop\Http\Controllers\ReviewController@edit')->defaults('_config',[ + 'view' => 'admin::customers.review.edit' + ])->name('admin.customer.review.edit'); + + Route::put('customer/reviews/edit/{id}', 'Webkul\Shop\Http\Controllers\ReviewController@update')->defaults('_config', [ + 'redirect' => 'admin.customer.review.index' + ])->name('admin.customer.review.update'); + + Route::get('customer/edit/{id}', 'Webkul\Core\Http\Controllers\CustomerController@edit')->defaults('_config',[ + 'view' => 'admin::customers.edit' + ])->name('admin.customer.edit'); + + Route::put('customer/reviews/edit/{id}', 'Webkul\Core\Http\Controllers\CustomerController@update')->defaults('_config', [ + 'redirect' => 'admin.customer.index' + ])->name('admin.customer.update'); + + // dummy number i.e-1 is used for creating view only + + Route::get('customer/orders/1', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [ + 'view' => 'admin::customers.orders.order' + ])->name('admin.customer.orders.order'); // Catalog Routes Route::prefix('catalog')->group(function () { diff --git a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php index 773257629..751cfa5a2 100644 --- a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php @@ -52,6 +52,18 @@ class EventServiceProvider extends ServiceProvider $menu->add('catalog.families', 'Families', 'admin.catalog.families.index', 4); + $menu->add('customers', 'Customers', 'admin.customer.index', 5, 'customer-icon'); + + $menu->add('customers.customers', 'Customers', 'admin.customer.index', 1, ''); + + $menu->add('customers.orders', 'Orders', 'admin.customer.orders.index', 2, ''); + + $menu->add('customers.reviews', 'Review', 'admin.customer.review.index', 3, ''); + + // $menu->add('customers.blocked_customer', 'Blocked Customers', 'admin.account.edit', 2, ''); + + // $menu->add('customers.allowed_customer', 'Allowed Customers', 'admin.account.edit', 4, ''); + $menu->add('configuration', 'Configure', 'admin.account.edit', 6, 'configuration-icon'); $menu->add('configuration.account', 'My Account', 'admin.account.edit', 1); diff --git a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss index 07fdc741d..506819344 100644 --- a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss @@ -274,3 +274,28 @@ body { } // admin dashboard css ends here + + +// customer oder css for admin start here + +.order-place-detail { + + .order-account-information { + margin-left: 10px; + } + + .address { + margin-left: 10px; + } + + .payment-shipping{ + margin-left: 10px; + } + + .order-products{ + margin-left: 10px; + } +} + + +// customer oder css for admin end here diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 75bc3141f..af10f6280 100644 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -133,7 +133,8 @@ return [ 'value_per_channel' => 'Value Per Channel', 'is_filterable' => 'Use in Layered Navigation', 'is_configurable' => 'Use To Create Configurable Product', - 'admin_name' => 'Admin Name' + 'admin_name' => 'Admin Name', + 'is_visible_on_front' => 'Visible on Product View Page on Front-end' ], 'families' => [ 'families' => 'Families', @@ -264,5 +265,24 @@ return [ 'content' => 'Content', 'channels' => 'Channel' ], + ], + 'customers' => [ + 'customers' => [ + 'title' => 'Customers', + 'first_name' => 'First Name', + 'last_name' => 'Last Name', + 'gender' => 'Gender', + 'email' => 'Email', + 'date_of_birth' => 'Date of Birth', + 'phone' => 'Phone', + 'customer_group' => 'Customer Group' + ], + 'reviews' => [ + 'title' => 'Title', + 'name' => 'Reviews', + 'rating' => 'Rating', + 'status' => 'Status', + 'comment' => 'Comment' + ] ] ]; \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php index 35112e645..b6b37b540 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php @@ -154,6 +154,14 @@ + +
+ + +
diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php index 1eb333a36..b2d5ddcf6 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php @@ -210,6 +210,18 @@ + +
+ + +
diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php index 77ad5064f..686a82463 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php @@ -19,7 +19,7 @@
@foreach(core()->getAllLocales() as $localeModel) - + @@ -61,8 +61,8 @@ @foreach($attributeGroup->custom_attributes as $attribute) @if(!$product->super_attributes->contains($attribute)) - - type == 'configurable' && in_array($attribute->code, ['price', 'cost', 'special_price', 'special_price_from', 'special_price_to', 'width', 'height', 'depth', 'weight'])) { @@ -79,7 +79,7 @@ } $validations = implode('|', array_filter($validations)); - ?> + ?> @if(view()->exists($typeView = 'admin::catalog.products.field-types.' . $attribute->type)) @@ -97,7 +97,7 @@ array_push($channel_locale, $locale); } ?> - + @if(count($channel_locale)) [{{ implode(' - ', $channel_locale) }}] @endif @@ -111,7 +111,7 @@ @endif @endif - + @endforeach
@@ -120,11 +120,11 @@ @endforeach @if ($form_accordians) - + @foreach ($form_accordians->items as $accordian) @include ($accordian['view']) - + @endforeach @endif diff --git a/packages/Webkul/Admin/src/Resources/views/customers/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/edit.blade.php new file mode 100644 index 000000000..1388fd16d --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/customers/edit.blade.php @@ -0,0 +1,81 @@ +@extends('admin::layouts.content') + +@section('content') +
+
+ + + +
+ +
+ @csrf() + + + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/customers/index.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/index.blade.php new file mode 100644 index 000000000..6a7127324 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/customers/index.blade.php @@ -0,0 +1,28 @@ +@extends('admin::layouts.content') + +@section('page_title') + +@stop + +@section('content') + +
+ + +
+ @inject('customer','Webkul\Admin\DataGrids\CustomerDataGrid') + {!! $customer->render() !!} +
+
+ +@stop + diff --git a/packages/Webkul/Admin/src/Resources/views/customers/orders/index.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/orders/index.blade.php new file mode 100644 index 000000000..9dd651cf4 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/customers/orders/index.blade.php @@ -0,0 +1,25 @@ +@extends('admin::layouts.content') + +@section('page_title') + +@stop + +@section('content') + +
+ + +
+
+
+ +@stop diff --git a/packages/Webkul/Admin/src/Resources/views/customers/orders/order.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/orders/order.blade.php new file mode 100644 index 000000000..da1b1081e --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/customers/orders/order.blade.php @@ -0,0 +1,353 @@ + +@extends('admin::layouts.master') + +@section('content-wrapper') + + +
+ +
+ +
+ +
+
+ Order Information + + Edit + +
+
+ + + + + + +
+ + + +
+
+
+ +
+ + + +
+ +
+
+ Shipping Address + + Edit + +
+
+
+ 0933 Crossing Suite 12B + Dallas , Texas + United States + 75001 +
+
+ +
+
+ Billing Address + + Edit + +
+
+
+ 0933 Crossing Suite 12B + Dallas , Texas + United States + 75001 +
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+ Payment Information +
+
+ +
+
+ + Payment Method + +
+
+ + Bank Wire Transfer + +
+
+ +
+
+ + Currency + +
+
+ + US Dollar + +
+
+ +
+ +
+
+ Shipping Information +
+
+ +
+
+ + Shipping Method + +
+
+ + Flat Rate-Fixed-$10.00 + +
+
+ +
+
+ + Expected Delivery + +
+
+ + 3 Days + +
+
+ +
+ + +
+
+
+ +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SKUProduct NameItem StatusPriceQtyRow total
PROD124Apple iPhone 7- White-32GBPacked (2)$350.002$700.00
PROD128Blue Linen T-Shirt for Men- Small- RedShipped (2)$45.002$35.00
+
+ +
+ +
+ +
+ + Subtotal + + + - + + + $805.00 + +
+ +
+ + Shipping & handling + + + - + + + $5.00 + +
+ +
+ + Discounts + + + - + + + $15.00 + +
+ +
+ + Grand Total + + + - + + + $15.00 + +
+ +
+ + Total Due + + + - + + + $15.00 + +
+ +
+ +
+ +
+
+ +
+
+ +@stop + + + diff --git a/packages/Webkul/Admin/src/Resources/views/customers/review/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/review/edit.blade.php new file mode 100644 index 000000000..d51814fbf --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/customers/review/edit.blade.php @@ -0,0 +1,69 @@ +@extends('admin::layouts.content') + +@section('content') +
+
+ + + +
+ +
+ @csrf() + + + + +
+ +
+ + +
+ +
+ + @for($i = 1; $i <= $review->rating ; $i++) + + + + @endfor +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/customers/review/index.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/review/index.blade.php new file mode 100644 index 000000000..1afc63c69 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/customers/review/index.blade.php @@ -0,0 +1,27 @@ +@extends('admin::layouts.content') + +@section('page_title') + +@stop + +@section('content') + +
+ + +
+ @inject('review','Webkul\Admin\DataGrids\CustomerReviewDataGrid') + {!! $review->render() !!} +
+
+ +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/sliders/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/sliders/index.blade.php index 92ffef011..646e0bb72 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/sliders/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/sliders/index.blade.php @@ -1,6 +1,12 @@ @extends('admin::layouts.content') +@section('page_title') + +@stop + @section('content') + +