Fixed customer group bug in cart rule and fixed a bug in coupon apply rule

This commit is contained in:
Prashant Singh 2019-06-18 19:00:24 +05:30
parent bcdb4efb6c
commit 9e80687960
5 changed files with 9 additions and 3 deletions

View File

@ -41,6 +41,10 @@ class CouponAbleRule extends Discount
}
}
if (! isset($applicableRule)) {
return false;
}
$applicability = $this->checkApplicability($applicableRule);
if ($applicability) {

View File

@ -85,8 +85,10 @@ abstract class Discount
// customer groups based constraints
if (auth()->guard('customer')->check()) {
foreach ($rule->customer_groups as $customer_group) {
if ($customer_group->customer_group_id == auth()->guard('customer')->user()->group->id) {
$customerGroupBased = true;
if (auth()->guard('customer')->user()->group->exists()) {
if ($customer_group->customer_group_id == auth()->guard('customer')->user()->group->id) {
$customerGroupBased = true;
}
}
}
} else {

View File

@ -39,7 +39,7 @@ class ProductServiceProvider extends ServiceProvider
public function registerConfig() {
$this->mergeConfigFrom(
dirname(__DIR__) . '/Config/product_types.php', 'product_types'
dirname(__DIR__) . '/Config/product-types.php', 'product-types'
);
}