From b01fdc7496da8a2e70de9376760bf960a83e2a85 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Fri, 1 Nov 2019 17:05:15 +0530 Subject: [PATCH 1/3] Fixed issue #1728 --- packages/Webkul/Discount/src/Actions/Cart/WholeCartToFixed.php | 2 +- .../Webkul/Discount/src/Actions/Cart/WholeCartToPercent.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/Webkul/Discount/src/Actions/Cart/WholeCartToFixed.php b/packages/Webkul/Discount/src/Actions/Cart/WholeCartToFixed.php index 1ba84ca86..7fbc39cd4 100644 --- a/packages/Webkul/Discount/src/Actions/Cart/WholeCartToFixed.php +++ b/packages/Webkul/Discount/src/Actions/Cart/WholeCartToFixed.php @@ -15,7 +15,7 @@ class WholeCartToFixed */ public function calculate($rule) { - $actualInstance = new FixedAmount(); + $actualInstance = new FixedAmount($rule); $result = $actualInstance->calculate($rule); diff --git a/packages/Webkul/Discount/src/Actions/Cart/WholeCartToPercent.php b/packages/Webkul/Discount/src/Actions/Cart/WholeCartToPercent.php index ec54f2886..ffd334370 100644 --- a/packages/Webkul/Discount/src/Actions/Cart/WholeCartToPercent.php +++ b/packages/Webkul/Discount/src/Actions/Cart/WholeCartToPercent.php @@ -15,7 +15,7 @@ class WholeCartToPercent */ public function calculate($rule) { - $actualInstance = new PercentOfProduct(); + $actualInstance = new PercentOfProduct($rule); $result = $actualInstance->calculate($rule); From e55dd37619814d8ad5cedfff14133aec985d98fd Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Fri, 1 Nov 2019 18:46:54 +0530 Subject: [PATCH 2/3] Fixed issue #1730 --- packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php | 2 ++ packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php b/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php index 4cca8221a..0405e8302 100644 --- a/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php +++ b/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php @@ -8,6 +8,8 @@ class FixedAmount extends Action { public function __construct($rule) { + parent::__construct(); + /** * Setting the rule getting applied */ diff --git a/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php b/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php index 9f29ad329..d741c42b0 100644 --- a/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php +++ b/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php @@ -8,6 +8,8 @@ class PercentOfProduct extends Action { public function __construct($rule) { + parent::__construct(); + /** * Setting the rule getting applied */ From 045639cd59b6cc04b8e6d8411d02d7452cc7d0df Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Sat, 2 Nov 2019 01:23:45 +0530 Subject: [PATCH 3/3] Datagrid table frontend header splitted into partial blades --- .../partials/default-header.blade.php | 33 ++++++++ .../partials/mass-action-header.blade.php | 34 +++++++++ .../Resources/views/datagrid/table.blade.php | 75 ++----------------- 3 files changed, 75 insertions(+), 67 deletions(-) create mode 100644 packages/Webkul/Ui/src/Resources/views/datagrid/partials/default-header.blade.php create mode 100644 packages/Webkul/Ui/src/Resources/views/datagrid/partials/mass-action-header.blade.php diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/partials/default-header.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/partials/default-header.blade.php new file mode 100644 index 000000000..6f6b34c17 --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/partials/default-header.blade.php @@ -0,0 +1,33 @@ + + + @if (count($results['records']) && $results['enableMassActions']) + + + + + + + + @endif + + @foreach($results['columns'] as $key => $column) + + {{ $column['label'] }} + + @endforeach + + @if ($results['enableActions']) + + {{ __('ui::app.datagrid.actions') }} + + @endif + + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/partials/mass-action-header.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/partials/mass-action-header.blade.php new file mode 100644 index 000000000..26f8e9cc6 --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/partials/mass-action-header.blade.php @@ -0,0 +1,34 @@ + + @if (isset($results['massactions'])) + + +
+ + + + + +
+ @csrf() + + + +
+ +
+ +
+ +
+ + +
+
+ + + @endif + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php index 1b03e194c..6ebd93a0e 100644 --- a/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php @@ -146,74 +146,9 @@ - - @if (isset($results['massactions'])) - - - - @endif - - - - - @if (count($results['records']) && $results['enableMassActions']) - - @endif - - @foreach($results['columns'] as $key => $column) - - @endforeach - - @if ($results['enableActions']) - - @endif - - + @include('ui::datagrid.partials.default-header') @include('ui::datagrid.body', ['records' => $results['records'], 'actions' => $results['actions'], 'index' => $results['index'], 'columns' => $results['columns'],'enableMassActions' => $results['enableMassActions'], 'enableActions' => $results['enableActions'], 'norecords' => $results['norecords']])
-
+ @include('ui::datagrid.partials.mass-action-header') - - - - -
- @csrf() - - - -
- -
- -
- -
- - -
-
-
- - - - - - - {{ $column['label'] }} - - {{ __('ui::app.datagrid.actions') }} -
@@ -725,6 +660,12 @@ } }, + captureColumn: function(id) { + element = document.getElementById(id); + + console.log(element.innerHTML); + }, + removeMassActions: function() { this.dataIds = [];