From 4339475e7014e30858a0ea4bc630ee8dd2b5d98b Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Thu, 27 Jun 2019 19:55:36 +0530 Subject: [PATCH] CheckOnShipping method added to check where rule applies on shipping or not --- packages/Webkul/Discount/src/Helpers/Discount.php | 2 ++ .../Webkul/Shop/src/Http/Controllers/OnepageController.php | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/Webkul/Discount/src/Helpers/Discount.php b/packages/Webkul/Discount/src/Helpers/Discount.php index 726e14585..83adb0d58 100644 --- a/packages/Webkul/Discount/src/Helpers/Discount.php +++ b/packages/Webkul/Discount/src/Helpers/Discount.php @@ -150,6 +150,8 @@ abstract class Discount $this->updateCartItemAndCart($rule); return true; + } else { + $this->checkOnShipping(); } } else { $this->cartRuleCart->create([ diff --git a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php index fd04c36a0..37784b360 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php @@ -147,8 +147,6 @@ class OnepageController extends Controller $this->nonCoupon->apply(); - $this->nonCoupon->checkOnShipping(); - Cart::collectTotals(); return response()->json(Payment::getSupportedPaymentMethods()); @@ -168,8 +166,6 @@ class OnepageController extends Controller $this->nonCoupon->apply(); - $this->nonCoupon->checkOnShipping(); - Cart::collectTotals(); $cart = Cart::getCart();