From b2161571bdf0049cd3f2244cd6f7935993bf7e89 Mon Sep 17 00:00:00 2001 From: prashant-webkul Date: Thu, 29 Nov 2018 13:20:50 +0530 Subject: [PATCH] XSS fixes in datagrid where directly some columns were create html unescaped, migration fixes for products grid table, changelog added for past two releases v0.1.0 & v0.1.1 --- CHANGELOG for v0.1.x.md | 69 +++++++++++++++++++ .../Admin/src/DataGrids/AttributeDataGrid.php | 4 +- .../src/DataGrids/AttributeFamilyDataGrid.php | 4 +- .../Admin/src/DataGrids/CategoryDataGrid.php | 4 +- .../Admin/src/DataGrids/ChannelDataGrid.php | 2 +- .../Admin/src/DataGrids/CountryDataGrid.php | 4 +- .../Admin/src/DataGrids/CurrencyDataGrid.php | 2 +- .../Admin/src/DataGrids/CustomerDataGrid.php | 4 +- .../src/DataGrids/CustomerGroupDataGrid.php | 4 +- .../src/DataGrids/ExchangeRatesDataGrid.php | 2 +- .../DataGrids/InventorySourcesDataGrid.php | 2 +- .../Admin/src/DataGrids/LocalesDataGrid.php | 2 +- .../Admin/src/DataGrids/OrderDataGrid.php | 3 +- .../src/DataGrids/OrderInvoicesDataGrid.php | 2 +- .../src/DataGrids/OrderShipmentsDataGrid.php | 2 +- .../Admin/src/DataGrids/ProductDataGrid.php | 10 ++- .../src/DataGrids/ProductReviewDataGrid.php | 5 +- .../Admin/src/DataGrids/RolesDataGrid.php | 2 +- .../Admin/src/DataGrids/SliderDataGrid.php | 2 +- .../src/DataGrids/TaxCategoryDataGrid.php | 4 +- .../Admin/src/DataGrids/TaxRateDataGrid.php | 4 +- .../Admin/src/DataGrids/UserDataGrid.php | 16 ++--- .../Webkul/Admin/src/Listeners/Product.php | 10 +-- ...2018_10_22_111807_create_products_grid.php | 2 +- ...13535_remove_cost_column_from_datagrid.php | 4 +- .../views/datagrid/table/body.blade.php | 8 ++- 26 files changed, 129 insertions(+), 48 deletions(-) create mode 100644 CHANGELOG for v0.1.x.md diff --git a/CHANGELOG for v0.1.x.md b/CHANGELOG for v0.1.x.md new file mode 100644 index 000000000..3aa09d16c --- /dev/null +++ b/CHANGELOG for v0.1.x.md @@ -0,0 +1,69 @@ +# CHANGELOG for v0.1.x + +#### This changelog consists the bug & security fixes and new features being included in the releases listed below. + +## **v0.1.1(13th of November, 2018)** - *Release* + +#94 - [fixed] Sign-in page shows signup text(@prashant-webkul) + +#95 - [fixed] Buy Now Button does not work(@prashant-webkul) + +#96 - [fixed] Search button does not work(@prashant-webkul) + +**PR #118** - *List of the features and fixes covered:* + + * [fixed] Email templates logo issue fixed(@jitendra-webkul) + * [fixed] Front search issue fixed due to hardcoded attribute code in search criteria(@jitendra-webkul) + * [changed] Versioning of core packages + * [fixed] Buynow validation fixes(@jitendra-webkul) + * [feature] New action type added in datagrid + * [feature] Loader added in storefront product page + * [fixed] Tax rates and categories form fixes(@jitendra-webkul) + * [feature] Country state selector added where country and states were there originally in release v0.1.0 + * [feature] Multiple addresses for customers with CRUD + * [feature] Customer can now make any of his/her existing address a default address + * [fixed] Customer address 2 form field validation required changed to optional(@jitendra-webkul) + * [fixed] Tax rates validation fixes for zip ranges(@prashant-webkul) + * [feature] Print invoice feature added. + * [changed] Core packages composer file parameter name changed from namespace webkul to bagisto + * [feature] Payment package added in core packages + * [feature] Sales module added in admin with orders, invoices and shipments with datagrid + * [feature] Functionality to indicate the new and featured product in the product's add and edit form + * [feature] Cart actions more faster in storefront + * [changed] Responsive styles refined and extended for checkout pages on storefront + * [fixed] Various UI/UX fixes in store front styles and layouts(@prashant-webkul & @jitendra-webkul) + + +## **v0.1.0(30th of October 2018)** - *First release* + +**PR #117** - *List of the features and fixes covered:* + + * [feature] Add and modify product with simple and configurable types + * [feature] Add and modify attributes and attribute families for creating products. + * [feature] Datagrid for all the major core resources added as index for listing core resources like product, attributes. + * [feature] Add and modify channels for creating multiple storefront. + * [feature] Add and modify categories to be displayed on storefront. + * [feature] Add and modify customers. + * [feature] Add and modify customer groups. + * [feature] Add and modify customer reviews for moderation by admin. + * [feature] Add and modify currently logged in admin user details. + * [feature] Add and modify locales for multiple languages support system wide. + * [feature] Add and modify currencies to be used in channels + * [feature] Add and modify currency exchange rate for the stores accepting multiple currencies or using multiple channels. + * [feature] Add and modify inventory sources with priority to hold products quantities in real time. + * [feature] Add and modify channels. + * [feature] Add and modify user from admins access with customer roles. + * [feature] Add and modify customer roles for users. + * [feature] Add and modify slider for storefront as a CMS capability. + * [feature] Add and modify tax categories and tax rates. + * [feature] Shopping cart in storefront + * [feature] Wishlist for customer + * [feature] Single address for customer + * [feature] Customer can see his reviews in his account section when logged in. + * [feature] Customer profile edit feature account section when logged in. + * [feature] Customer can view his orders in account section when logged in. + * [feature] Customer order notifications via mails. + * [feature] Multiple locales and currencies on storefront. + * [feature] Locale translations are stored as a separate file in shop and admin packages. + * [feature] Single page checkout system for checkout. + * [feature] Custom themes and assets provisioning included as a integrated package called "theme" in packages. \ No newline at end of file diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php index ff11441ea..c0f13c043 100644 --- a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php @@ -44,12 +44,12 @@ class AttributeDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php index 9ff9261ba..aaa941446 100644 --- a/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php @@ -45,12 +45,12 @@ class AttributeFamilyDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index 1fc176f52..3a2ff7f5f 100644 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -45,12 +45,12 @@ class CategoryDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php index eceb562d8..ac8f322dd 100644 --- a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php @@ -45,7 +45,7 @@ class ChannelDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really edit this record?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', diff --git a/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php index 01abdfe6e..4ca12c7dd 100644 --- a/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php @@ -45,12 +45,12 @@ class CountryDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php index 9b4162f46..339765f54 100644 --- a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php @@ -44,7 +44,7 @@ class CurrencyDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really edit this record?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php index 6b2a711d3..b58ed695a 100644 --- a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php @@ -43,12 +43,12 @@ class CustomerDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php index 37649ee86..bcd8bf2da 100644 --- a/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php @@ -54,13 +54,13 @@ class CustomerGroupDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really wanis?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php index 67ac589b2..93ea66e1c 100644 --- a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php @@ -45,7 +45,7 @@ class ExchangeRatesDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really edit this record?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', diff --git a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php index 8dcf9bfe6..dc8e8edae 100644 --- a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php @@ -43,7 +43,7 @@ class InventorySourcesDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.edit'), - 'confirm_text' => 'Do you really edit this record?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', diff --git a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php index c134a0f88..e16906952 100644 --- a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php @@ -44,7 +44,7 @@ class LocalesDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really edit this record?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', diff --git a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php index d927d59e6..f8fd17b5d 100644 --- a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php @@ -44,7 +44,7 @@ class OrderDataGrid [ 'type' => 'View', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to view this record?', 'icon' => 'icon pencil-lg-icon', ], // [ @@ -102,6 +102,7 @@ class OrderDataGrid 'type' => 'string', 'label' => 'Status', 'sortable' => true, + 'closure' => true, //to be used when ever wrappers or callables are used 'wrapper' => function ($value) { if($value == 'processing') return 'Processing'; diff --git a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php index f98f24d6a..739ea31fe 100644 --- a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php @@ -43,7 +43,7 @@ class OrderInvoicesDataGrid [ 'type' => 'View', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to view this record?', 'icon' => 'icon pencil-lg-icon', ], // [ diff --git a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php index 8e97e58ac..508db54bb 100644 --- a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php @@ -43,7 +43,7 @@ class OrderShipmentsDataGrid [ 'type' => 'View', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to view this record?', 'icon' => 'icon pencil-lg-icon', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php index 27df69211..475fb0339 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -37,12 +37,12 @@ class ProductDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], @@ -99,6 +99,12 @@ class ProductDataGrid 'wrapper' => function ($value) { return core()->formatBasePrice($value); }, + ], [ + 'name' => 'prods.attribute_family_name', + 'alias' => 'product_attribute_family_name', + 'type' => 'string', + 'label' => 'Attribute Family', + 'sortable' => true, ], [ 'name' => 'prods.quantity', 'alias' => 'ProductQuantity', diff --git a/packages/Webkul/Admin/src/DataGrids/ProductReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductReviewDataGrid.php index 5b6c3ce87..e409bed3e 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductReviewDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductReviewDataGrid.php @@ -46,12 +46,12 @@ class ProductReviewDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], @@ -102,6 +102,7 @@ class ProductReviewDataGrid 'type' => 'number', 'label' => 'Status', 'sortable' => true, + 'closure' => true, 'wrapper' => function ($value) { if($value == 'approved') return 'Approved'; diff --git a/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php index 0d36da193..82fdf957d 100644 --- a/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php @@ -45,7 +45,7 @@ class RolesDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really edit this record?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', diff --git a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php index 1bd679e15..1a08c1bf1 100644 --- a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php @@ -44,7 +44,7 @@ class SliderDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really edit this record?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', diff --git a/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php index de19cc205..0b45d3835 100644 --- a/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php @@ -54,13 +54,13 @@ class TaxCategoryDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really wanis?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php index b94780144..22b9f0d98 100644 --- a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php @@ -53,13 +53,13 @@ class TaxRateDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really wanis?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php index c1928ae3f..ea0dd2f82 100644 --- a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php @@ -56,13 +56,13 @@ class UserDataGrid [ 'type' => 'Edit', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really wanis?', + 'confirm_text' => 'Do you really want to edit this record?', 'icon' => 'icon pencil-lg-icon', ], [ 'type' => 'Delete', 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', + 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', ], ], @@ -84,9 +84,9 @@ class UserDataGrid 'type' => 'string', 'label' => 'Admin ID', 'sortable' => true, - 'wrapper' => function ($value, $object) { - return '' . $object->ID . ''; - }, + // 'wrapper' => function ($value, $object) { + // return '' . $object->ID . ''; + // }, ], [ 'name' => 'u.name', @@ -94,9 +94,9 @@ class UserDataGrid 'type' => 'string', 'label' => 'Name', 'sortable' => true, - 'wrapper' => function ($value, $object) { - return '' . $object->Name . ''; - }, + // 'wrapper' => function ($value, $object) { + // return '' . $object->Name . ''; + // }, ], [ 'name' => 'u.email', diff --git a/packages/Webkul/Admin/src/Listeners/Product.php b/packages/Webkul/Admin/src/Listeners/Product.php index eb40c580c..cbe1b54b9 100644 --- a/packages/Webkul/Admin/src/Listeners/Product.php +++ b/packages/Webkul/Admin/src/Listeners/Product.php @@ -64,7 +64,7 @@ class Product { 'product_id' => $product->id, 'sku' => $product->sku, 'type' => $product->type, - 'attribute_family_name' => 'default', + 'attribute_family_name' => $product->toArray()['attribute_family']['name'], 'name' => $product->name, 'quantity' => 0, 'status' => $product->status, @@ -83,7 +83,7 @@ class Product { 'product_id' => $variant->id, 'sku' => $variant->sku, 'type' => $variant->type, - 'attibute_family_name' => 'default', + 'attribute_family_name' => $variant->toArray()['attribute_family']['name'], 'name' => $variant->name, 'quantity' => 0, 'status' => $variant->status, @@ -133,7 +133,7 @@ class Product { 'product_id' => $product->id, 'sku' => $product->sku, 'type' => $product->type, - 'attribute_family_name' => 'default', + 'attribute_family_name' => $product->toArray()['attribute_family']['name'], 'name' => $product->name, 'status' => $product->status, ]; @@ -162,7 +162,7 @@ class Product { 'product_id' => $variant->id, 'sku' => $variant->sku, 'type' => $variant->type, - 'attibute_family_name' => 'name', + 'attribute_family_name' => $variant->toArray()['attribute_family']['name'], 'name' => $variant->name, 'status' => $variant->status, 'price' => $variant->price, @@ -188,7 +188,7 @@ class Product { 'product_id' => $variant->id, 'sku' => $variant->sku, 'type' => $variant->type, - 'attibute_family_name' => 'default', + 'attribute_family_name' => $variant->toArray()['attribute_family']['name'], 'name' => $variant->name, 'status' => $variant->status, 'price' => $variant->price, diff --git a/packages/Webkul/Product/src/Database/Migrations/2018_10_22_111807_create_products_grid.php b/packages/Webkul/Product/src/Database/Migrations/2018_10_22_111807_create_products_grid.php index 46130304f..85bc7849f 100644 --- a/packages/Webkul/Product/src/Database/Migrations/2018_10_22_111807_create_products_grid.php +++ b/packages/Webkul/Product/src/Database/Migrations/2018_10_22_111807_create_products_grid.php @@ -17,6 +17,7 @@ class CreateProductsGrid extends Migration $table->increments('id'); $table->integer('product_id')->unsigned(); $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->string('attribute_family_name')->nullable(); $table->string('sku')->nullable(); $table->string('type')->nullable(); $table->string('name')->nullable(); @@ -24,7 +25,6 @@ class CreateProductsGrid extends Migration $table->string('cost')->default(0); $table->string('price')->nullable(); $table->string('status')->nullable(); - $table->string('attribute_family_name')->nullable(); }); } diff --git a/packages/Webkul/Product/src/Database/Migrations/2018_11_27_113535_remove_cost_column_from_datagrid.php b/packages/Webkul/Product/src/Database/Migrations/2018_11_27_113535_remove_cost_column_from_datagrid.php index 95986d240..7bc776467 100644 --- a/packages/Webkul/Product/src/Database/Migrations/2018_11_27_113535_remove_cost_column_from_datagrid.php +++ b/packages/Webkul/Product/src/Database/Migrations/2018_11_27_113535_remove_cost_column_from_datagrid.php @@ -15,7 +15,6 @@ class RemoveCostColumnFromDatagrid extends Migration { Schema::table('products_grid', function (Blueprint $table) { $table->dropColumn('cost'); - $table->dropColumn('attribute_family_name'); }); } @@ -27,8 +26,7 @@ class RemoveCostColumnFromDatagrid extends Migration public function down() { Schema::table('products_grid', function (Blueprint $table) { - $table->string('cost'); - $table->string('attribute_family_name')->nullable(); + $table->string('cost')->nullable(); }); } } diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/table/body.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/table/body.blade.php index 8588d0df2..2bfdfca77 100644 --- a/packages/Webkul/Ui/src/Resources/views/datagrid/table/body.blade.php +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/table/body.blade.php @@ -15,7 +15,13 @@ --}} @foreach ($columns as $column) - {!! $column->render($result) !!} + @if(isset($column->closure)) + @if($column->closure == true) + {!! $column->render($result) !!} + @endif + @else + {{ $column->render($result) }} + @endif @endforeach @if(count($actions))