diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php index 1b17bef70..982033ebc 100644 --- a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php @@ -60,7 +60,6 @@ class AttributeDataGrid //use aliasing on secodary columns if join is performed 'columns' => [ - [ 'name' => 'id', 'alias' => 'attributeId', @@ -87,37 +86,60 @@ class AttributeDataGrid 'alias' => 'attributeType', 'type' => 'string', 'label' => 'Type', - 'sortable' => true, + 'sortable' => false, ], [ 'name' => 'is_required', 'alias' => 'attributeIsRequired', 'type' => 'string', 'label' => 'Required', - 'sortable' => true, + 'sortable' => false, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], [ 'name' => 'is_unique', 'alias' => 'attributeIsUnique', 'type' => 'string', 'label' => 'Unique', - 'sortable' => true, + 'sortable' => false, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], [ 'name' => 'value_per_locale', 'alias' => 'attributeValuePerLocale', 'type' => 'string', 'label' => 'ValuePerLocale', - 'sortable' => true, + 'sortable' => false, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], [ 'name' => 'value_per_channel', 'alias' => 'attributeValuePerChannel', 'type' => 'string', 'label' => 'ValuePerChannel', - 'sortable' => true, + 'sortable' => false, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], - ], 'filterable' => [ @@ -148,7 +170,6 @@ class AttributeDataGrid ], //don't use aliasing in case of searchables - 'searchable' => [ [ 'column' => 'code', diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index 4e3e70508..08012cfb2 100644 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -104,6 +104,12 @@ class CategoryDataGrid 'type' => 'string', 'label' => 'Visible in Menu', 'sortable' => true, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php index 6bee79ed3..070694ca2 100644 --- a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php @@ -103,13 +103,13 @@ class CustomerDataGrid 'filterable' => [ [ - 'name' => 'id', + 'column' => 'id', 'alias' => 'ID', 'type' => 'number', 'label' => 'Customer ID', ], [ - 'name' => 'first_name', + 'column' => 'first_name', 'alias' => 'FirstName', 'type' => 'string', 'label' => 'Customer First Name', diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php index fff921c47..2360e9e89 100644 --- a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php @@ -19,7 +19,7 @@ class CustomerReviewDataGrid * The CustomerReviewDataGrid * implementation. * - * @var ReviewsDataGrid + * @var CustomerReviewsDataGrid * for Reviews */ @@ -57,13 +57,6 @@ class CustomerReviewDataGrid ], 'join' => [ - // [ - // 'join' => 'leftjoin', - // 'table' => 'roles as r', - // 'primaryKey' => 'u.role_id', - // 'condition' => '=', - // 'secondaryKey' => 'r.id', - // ] ], //use aliasing on secodary columns if join is performed @@ -76,67 +69,51 @@ class CustomerReviewDataGrid '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' => 'reviewStatus', 'type' => 'number', 'label' => 'Status', 'sortable' => true, ], - ], //don't use aliasing in case of filters - 'filterable' => [ [ - 'name' => 'id', + 'column' => 'id', 'alias' => 'reviewId', 'type' => 'number', 'label' => 'ID', - ], - [ - 'name' => 'title', + ], [ + 'column' => 'title', 'alias' => 'titleName', 'type' => 'string', 'label' => 'Title', - ], - [ - 'name' => 'rating', + ], [ + 'column' => 'rating', 'alias' => 'productRating', 'type' => 'number', 'label' => 'Rating', - ], - [ - 'name' => 'comment', + ], [ + 'column' => 'comment', 'alias' => 'productComment', 'type' => 'string', 'label' => 'Comment', - ], - [ - 'name' => 'status', + ], [ + 'column' => 'status', 'alias' => 'reviewStatus', 'type' => 'string', 'label' => 'Status', @@ -144,14 +121,12 @@ class CustomerReviewDataGrid ], //don't use aliasing in case of searchables - 'searchable' => [ [ 'column' => 'title', 'type' => 'string', 'label' => 'Title', - ], - [ + ], [ 'column' => 'rating', 'type' => 'number', 'label' => 'Rating', diff --git a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php index 876587c00..85d091a3b 100644 --- a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php @@ -64,7 +64,6 @@ class InventorySourcesDataGrid ], //use aliasing on secodary columns if join is performed - 'columns' => [ [ @@ -73,34 +72,36 @@ class InventorySourcesDataGrid 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'code', 'alias' => 'inventoryCode', 'type' => 'string', 'label' => 'Code', - 'sortable' => true, - ], - [ + 'sortable' => false, + ], [ 'name' => 'name', 'alias' => 'inventoryName', 'type' => 'string', 'label' => 'Name', - 'sortable' => true, - ], - [ + 'sortable' => false, + ], [ 'name' => 'priority', 'alias' => 'inventoryPriority', 'type' => 'string', 'label' => 'Priority', 'sortable' => true, - ], - [ + ], [ 'name' => 'status', 'alias' => 'inventoryStatus', 'type' => 'string', 'label' => 'Status', 'sortable' => true, + 'wrapper' => function ($value) { + if($value == 0) + return "In Active"; + else + return "Active"; + }, ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php index 25cf5249d..74e236511 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -129,25 +129,25 @@ class ProductDataGrid 'filterable' => [ //column, type, and label [ - 'name' => 'prods.id', + 'column' => 'prods.id', 'alias' => 'productID', 'type' => 'number', 'label' => 'ID', ], [ - 'name' => 'prods.sku', + 'column' => 'prods.sku', 'alias' => 'productCode', 'type' => 'string', 'label' => 'SKU', ], [ - 'name' => 'attfam.name', + 'column' => 'attfam.name', 'alias' => 'FamilyName', 'type' => 'string', 'label' => 'Family Name', ], [ - 'name' => 'pi.qty', + 'column' => 'pi.qty', 'alias' => 'ProductQuantity', 'type' => 'number', 'label' => 'Product Quatity', diff --git a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php index 361c6cb43..759fb0f45 100644 --- a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php @@ -67,28 +67,25 @@ class SliderDataGrid //use aliasing on secodary columns if join is performed 'columns' => [ - [ 'name' => 's.id', 'alias' => 'sliderId', 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 's.title', 'alias' => 'sliderTitle', 'type' => 'string', 'label' => 'title', - ], - [ + 'sortable' => false + ], [ 'name' => 's.channel_id', 'alias' => 'channelId', 'type' => 'string', 'label' => 'Channel ID', - 'sortable' => true, - ], - [ + 'sortable' => false, + ], [ 'name' => 'c.name', 'alias' => 'channelName', 'type' => 'string', @@ -98,41 +95,31 @@ class SliderDataGrid ], //don't use aliasing in case of filters - 'filterable' => [ [ - 'column' => 'id', - 'alias' => 'locale_id', + 'column' => 's.id', + 'alias' => 'sliderId', 'type' => 'number', - 'label' => 'ID', - ], - [ - 'column' => 'code', - 'alias' => 'locale_code', + 'label' => 'ID' + ], [ + 'column' => 's.title', + 'alias' => 'SliderTitle', 'type' => 'string', - 'label' => 'Code', - ], - [ - 'column' => 'name', - 'alias' => 'locale_name', - 'type' => 'string', - 'label' => 'Name', + 'label' => 'Slider Title' ], ], //don't use aliasing in case of searchables - 'searchable' => [ - // [ - // 'column' => 'name', - // 'type' => 'string', - // 'label' => 'Name', - // ], - // [ - // 'column' => 'code', - // 'type' => 'string', - // 'label' => 'Code', - // ], + [ + 'column' => 's.id', + 'type' => 'number', + 'label' => 'ID' + ], [ + 'column' => 's.title', + 'type' => 'string', + 'label' => 'Slider Title' + ] ], //list of viable operators that will be used @@ -148,9 +135,7 @@ class SliderDataGrid 'nlike' => "not like", ], // 'css' => [] - ]); - } public function render() diff --git a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php index be5b5c12e..535745430 100644 --- a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php @@ -24,7 +24,6 @@ class TaxRateDataGrid { return DataGrid::make([ - 'name' => 'Tax Rates', 'table' => 'tax_rates as tr', 'select' => 'tr.id', @@ -64,21 +63,13 @@ class TaxRateDataGrid 'icon' => 'icon trash-icon', ], ], - 'join' => [ - // [ - // 'join' => 'leftjoin', - // 'table' => 'roles as r', - // 'primaryKey' => 'u.role_id', - // 'condition' => '=', - // 'secondaryKey' => 'r.id', - // ] - ], + 'join' => [], //use aliasing on secodary columns if join is performed 'columns' => [ [ 'name' => 'tr.id', - 'alias' => 'ID', + 'alias' => 'id', 'type' => 'number', 'label' => 'ID', 'sortable' => true, @@ -90,7 +81,7 @@ class TaxRateDataGrid 'label' => 'Identifier', 'sortable' => true, // 'wrapper' => function ($value, $object) { - // return '' . $object->Name . ''; + // return '' . $object->identifier . ''; // }, ], [ @@ -119,32 +110,27 @@ class TaxRateDataGrid //don't use aliasing in case of filters 'filterable' => [ [ - 'name' => 'tr.id', + 'column' => 'tr.id', 'alias' => 'ID', 'type' => 'number', 'label' => 'ID', - ], - [ - 'name' => 'tr.identifier', + ], [ + 'column' => 'tr.identifier', 'alias' => 'identifier', 'type' => 'string', 'label' => 'Identifier', - ], - [ - 'name' => 'tr.state', + ], [ + 'column' => 'tr.state', 'alias' => 'state', 'type' => 'string', 'label' => 'State', - ], - [ - 'name' => 'tr.country', + ], [ + 'column' => 'tr.country', 'alias' => 'country', 'type' => 'string', 'label' => 'Country', - ], - - [ - 'name' => 'tr.tax_rate', + ], [ + 'column' => 'tr.tax_rate', 'alias' => 'tax_rate', 'type' => 'number', 'label' => 'Tax Rate', @@ -157,22 +143,6 @@ class TaxRateDataGrid 'type' => 'string', 'label' => 'Identifier', ], - [ - 'column' => 'tr.state', - 'type' => 'string', - 'label' => 'State', - ], - [ - 'column' => 'tr.country', - 'type' => 'string', - 'label' => 'Country', - ], - - [ - 'column' => 'tr.tax_rate', - 'type' => 'number', - 'label' => 'Tax Rate', - ], ], 'operators' => [ 'eq' => "=", diff --git a/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php b/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php index 618856942..9b405f9e9 100644 --- a/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php @@ -42,14 +42,21 @@