Issue #3572 fixes according to comment
This commit is contained in:
parent
5620817db2
commit
5b05cf75f4
|
|
@ -932,8 +932,23 @@ abstract class AbstractType
|
|||
public function getCustomerGroupPricingOffers() {
|
||||
$offerLines = [];
|
||||
$haveOffers = true;
|
||||
$customerGroupId = null;
|
||||
|
||||
$customerGroupPrices = $this->product->customer_group_prices()->get()->sortBy('qty')->values()->all();
|
||||
if (Cart::getCurrentCustomer()->check()) {
|
||||
$customerGroupId = Cart::getCurrentCustomer()->user()->customer_group_id;
|
||||
} else {
|
||||
$customerGroupRepository = app('Webkul\Customer\Repositories\CustomerGroupRepository');
|
||||
|
||||
if ($customerGuestGroup = $customerGroupRepository->findOneByField('code', 'guest')) {
|
||||
$customerGroupId = $customerGuestGroup->id;
|
||||
}
|
||||
}
|
||||
|
||||
$customerGroupPrices = $this->product->customer_group_prices()->where(function ($query) use ($customerGroupId) {
|
||||
$query->where('customer_group_id', $customerGroupId)
|
||||
->orWhereNull('customer_group_id');
|
||||
}
|
||||
)->groupBy('qty')->get()->sortBy('qty')->values()->all();
|
||||
|
||||
if ($this->haveSpecialPrice()) {
|
||||
$rulePrice = app('Webkul\CatalogRule\Helpers\CatalogRuleProductPrice')->getRulePrice($this->product);
|
||||
|
|
|
|||
Loading…
Reference in New Issue