From c763bbced181c7e5fc57abaa7c1b06f8ada4d3a4 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Fri, 5 Feb 2021 16:39:46 +0530 Subject: [PATCH 1/9] Issue #4561 fixed --- .../Shop/src/Http/Controllers/OnepageController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php index f3abafb3e..5973cd768 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php @@ -74,6 +74,14 @@ class OnepageController extends Controller return redirect()->route('customer.session.index'); } + $minimumOrderAmount = (int) core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; + + if (! $cart->checkMinimumOrder()) { + session()->flash('warning', trans('shop::app.checkout.cart.minimum-order-message', ['amount' => core()->currency($minimumOrderAmount)])); + + return redirect()->back(); + } + Cart::collectTotals(); return view($this->_config['view'], compact('cart')); From ecbf35930a696b3b07cbc49fc57f154ceb61205b Mon Sep 17 00:00:00 2001 From: devansh bawari Date: Mon, 8 Feb 2021 14:12:21 +0530 Subject: [PATCH 2/9] Type Button Added --- public/installer/Views/migration.blade.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/installer/Views/migration.blade.php b/public/installer/Views/migration.blade.php index 4bdb26b2e..c04293a52 100644 --- a/public/installer/Views/migration.blade.php +++ b/public/installer/Views/migration.blade.php @@ -91,13 +91,13 @@

Populating the database tables

- +
 
- +
- +
@@ -193,6 +193,8 @@ } if ((data['key_results'] == 0) && (data['seeder_results'] == 0) && (data['publish_results'] == 0)) { + console.log('here'); + event.preventDefault(); $('#continue').show(); $('#migrate-seed').hide(); $('#loader').hide(); From 94491226d867d064da3819be747f98706b034e70 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Mon, 8 Feb 2021 15:47:33 +0530 Subject: [PATCH 3/9] decimal field for minimum order --- .../Paypal/src/Http/Controllers/SmartButtonController.php | 2 +- packages/Webkul/Sales/src/Config/system.php | 2 +- .../Webkul/Shop/src/Http/Controllers/OnepageController.php | 4 ++-- .../Shop/src/Resources/views/checkout/cart/index.blade.php | 2 +- .../src/Resources/views/checkout/cart/mini-cart.blade.php | 2 +- .../src/Resources/views/shop/checkout/total/summary.blade.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/Webkul/Paypal/src/Http/Controllers/SmartButtonController.php b/packages/Webkul/Paypal/src/Http/Controllers/SmartButtonController.php index f0d0fba21..b193fbb35 100755 --- a/packages/Webkul/Paypal/src/Http/Controllers/SmartButtonController.php +++ b/packages/Webkul/Paypal/src/Http/Controllers/SmartButtonController.php @@ -278,7 +278,7 @@ class SmartButtonController extends Controller { $cart = Cart::getCart(); - $minimumOrderAmount = (int) core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; + $minimumOrderAmount = core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; if (! $cart->checkMinimumOrder()) { throw new \Exception(trans('shop::app.checkout.cart.minimum-order-message', ['amount' => core()->currency($minimumOrderAmount)])); diff --git a/packages/Webkul/Sales/src/Config/system.php b/packages/Webkul/Sales/src/Config/system.php index 985500dd4..34bdbbae0 100644 --- a/packages/Webkul/Sales/src/Config/system.php +++ b/packages/Webkul/Sales/src/Config/system.php @@ -52,7 +52,7 @@ return [ 'name' => 'minimum_order_amount', 'title' => 'admin::app.admin.system.minimum-order-amount', 'type' => 'text', - 'validation' => 'numeric', + 'validation' => 'decimal', 'channel_based' => true, 'locale_based' => true, ], diff --git a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php index 5973cd768..f7e2e17ba 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php @@ -74,7 +74,7 @@ class OnepageController extends Controller return redirect()->route('customer.session.index'); } - $minimumOrderAmount = (int) core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; + $minimumOrderAmount = core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; if (! $cart->checkMinimumOrder()) { session()->flash('warning', trans('shop::app.checkout.cart.minimum-order-message', ['amount' => core()->currency($minimumOrderAmount)])); @@ -236,7 +236,7 @@ class OnepageController extends Controller { $cart = Cart::getCart(); - $minimumOrderAmount = (int) core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; + $minimumOrderAmount = core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; if (! $cart->checkMinimumOrder()) { throw new \Exception(trans('shop::app.checkout.cart.minimum-order-message', ['amount' => core()->currency($minimumOrderAmount)])); diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php index d44caa83c..b2e84e9e8 100755 --- a/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php @@ -131,7 +131,7 @@ @if (! cart()->hasError()) @php - $minimumOrderAmount = (int) core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; + $minimumOrderAmount = core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; @endphp {{ __('shop::app.minicart.view-cart') }} @php - $minimumOrderAmount = (int) core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; + $minimumOrderAmount = core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; @endphp @php - $minimumOrderAmount = (int) core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; + $minimumOrderAmount = core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; @endphp Date: Mon, 8 Feb 2021 18:11:35 +0530 Subject: [PATCH 4/9] Config Check Added --- .../views/shop/customers/signup/index.blade.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/customers/signup/index.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/customers/signup/index.blade.php index 82039e381..bc5dfbd1b 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/customers/signup/index.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/customers/signup/index.blade.php @@ -138,10 +138,12 @@
-
- - {{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }} -
+ @if (core()->getConfigData('customer.settings.newsletter.subscription')) +
+ + {{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }} +
+ @endif {!! view_render_event('bagisto.shop.customers.signup_form_controls.after') !!} From 13ba8c934fdedeffea80e9989856a83414eef48e Mon Sep 17 00:00:00 2001 From: devansh bawari Date: Mon, 8 Feb 2021 19:14:51 +0530 Subject: [PATCH 5/9] More Checks Added --- .../views/customers/account/profile/edit.blade.php | 10 ++++++---- .../Resources/views/customers/signup/index.blade.php | 10 ++++++---- .../shop/customers/account/profile/edit.blade.php | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php index 2172eb72f..44e076f7a 100755 --- a/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php @@ -108,10 +108,12 @@ @{{ errors.first('password_confirmation') }} -
- subscription)) value="{{ $customer->subscription->is_subscribed }}" {{ $customer->subscription->is_subscribed ? 'checked' : ''}} @endif> - {{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }} -
+ @if (core()->getConfigData('customer.settings.newsletter.subscription')) +
+ subscription)) value="{{ $customer->subscription->is_subscribed }}" {{ $customer->subscription->is_subscribed ? 'checked' : ''}} @endif> + {{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }} +
+ @endif {!! view_render_event('bagisto.shop.customers.account.profile.edit_form_controls.after', ['customer' => $customer]) !!} diff --git a/packages/Webkul/Shop/src/Resources/views/customers/signup/index.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/signup/index.blade.php index 9f1598a08..72f74bd86 100755 --- a/packages/Webkul/Shop/src/Resources/views/customers/signup/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/signup/index.blade.php @@ -76,10 +76,12 @@ Checkbox Value 1 --}} -
- - {{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }} -
+ @if (core()->getConfigData('customer.settings.newsletter.subscription')) +
+ + {{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }} +
+ @endif {!! view_render_event('bagisto.shop.customers.signup_form_controls.after') !!} diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/customers/account/profile/edit.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/customers/account/profile/edit.blade.php index 1c7d17017..14c70dd45 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/customers/account/profile/edit.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/customers/account/profile/edit.blade.php @@ -191,10 +191,12 @@ -
- subscription)) value="{{ $customer->subscription->is_subscribed }}" {{ $customer->subscription->is_subscribed ? 'checked' : ''}} @endif style="width: auto;"> - {{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }} -
+ @if (core()->getConfigData('customer.settings.newsletter.subscription')) +
+ subscription)) value="{{ $customer->subscription->is_subscribed }}" {{ $customer->subscription->is_subscribed ? 'checked' : ''}} @endif style="width: auto;"> + {{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }} +
+ @endif {!! view_render_event('bagisto.shop.customers.account.profile.edit_form_controls.after', ['customer' => $customer]) !!} From bfc2b0a55410ac4599abfdab5335002753ba3679 Mon Sep 17 00:00:00 2001 From: devansh bawari Date: Tue, 9 Feb 2021 11:02:31 +0530 Subject: [PATCH 6/9] Optimize Added --- public/installer/Seeder.php | 42 +++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/public/installer/Seeder.php b/public/installer/Seeder.php index a28739b25..aeb1b2bd6 100755 --- a/public/installer/Seeder.php +++ b/public/installer/Seeder.php @@ -1,21 +1,41 @@ &1'; -$seeder = 'cd ../.. && '. $phpbin .' artisan db:seed 2>&1'; -$publish = 'cd ../.. && '. $phpbin .' artisan vendor:publish --all --force 2>&1'; +/* commands sequence */ +$commands = [ + 'seeder' => [ + 'key' => 'seeder_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan db:seed 2>&1' + ], + 'publish' => [ + 'key' => 'publish_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan vendor:publish --all --force 2>&1' + ], + 'storage_link' => [ + 'key' => 'storage_link_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan storage:link 2>&1' + ], + 'key' => [ + 'key' => 'key_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan key:generate 2>&1' + ], + 'optimize' => [ + 'key' => 'optimize_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan optimize 2>&1' + ], +]; -$key_output = exec($key, $data['key'], $data['key_results']); -$seeder_output = exec($seeder, $data['seeder'], $data['seeder_results']); -$publish = exec($publish, $data['publish'], $data['publish_results']); +// run command on terminal +$data = []; +foreach ($commands as $key => $value) { + exec($value['command'], $data[$key], $data[$value['key']]); +} // return a response -//return all our data to an AJAX call - +// return all our data to an AJAX call echo json_encode($data); From a3b6ae034fdcd292c7d139f9ff4c8fac5b05b283 Mon Sep 17 00:00:00 2001 From: devansh bawari Date: Tue, 9 Feb 2021 11:05:06 +0530 Subject: [PATCH 7/9] some Debugging Code Removed --- public/installer/Views/migration.blade.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/installer/Views/migration.blade.php b/public/installer/Views/migration.blade.php index c04293a52..d503e545f 100644 --- a/public/installer/Views/migration.blade.php +++ b/public/installer/Views/migration.blade.php @@ -193,8 +193,6 @@ } if ((data['key_results'] == 0) && (data['seeder_results'] == 0) && (data['publish_results'] == 0)) { - console.log('here'); - event.preventDefault(); $('#continue').show(); $('#migrate-seed').hide(); $('#loader').hide(); From da551578b1d27d25798be9916fa85e6bbcb827fe Mon Sep 17 00:00:00 2001 From: devansh bawari Date: Tue, 9 Feb 2021 14:14:20 +0530 Subject: [PATCH 8/9] Wishlist Check Added --- .../src/Resources/views/shop/UI/header.blade.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/UI/header.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/UI/header.blade.php index 50324e0bc..bcde1fe6e 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/UI/header.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/UI/header.blade.php @@ -104,12 +104,14 @@ -
  • - - - {{ __('shop::app.header.wishlist') }} - -
  • + @if (core()->getConfigData('general.content.shop.wishlist_option')) +
  • + + + {{ __('shop::app.header.wishlist') }} + +
  • + @endif
  • From 6fc5abe7ceb9c9d5294f5e8bda7f478b06856b8e Mon Sep 17 00:00:00 2001 From: prateek srivastava Date: Tue, 9 Feb 2021 17:05:26 +0530 Subject: [PATCH 9/9] getting exception upon request /category-details issue fixed --- .../Velocity/src/Http/Controllers/Shop/ShopController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/Webkul/Velocity/src/Http/Controllers/Shop/ShopController.php b/packages/Webkul/Velocity/src/Http/Controllers/Shop/ShopController.php index 380e61e1e..b370637c7 100644 --- a/packages/Webkul/Velocity/src/Http/Controllers/Shop/ShopController.php +++ b/packages/Webkul/Velocity/src/Http/Controllers/Shop/ShopController.php @@ -59,6 +59,10 @@ class ShopController extends Controller { $slug = request()->get('category-slug'); + if (! $slug) { + abort(404); + } + switch ($slug) { case 'new-products': case 'featured-products':