修复游客结账客户组折扣问题

This commit is contained in:
Edward Yang 2023-02-11 09:29:05 +08:00
parent 34c45dcde9
commit a5191440c6
1 changed files with 6 additions and 2 deletions

View File

@ -22,10 +22,14 @@ class CustomerDiscountService
public static function getTotal(CheckoutService $checkout)
{
$totalService = $checkout->totalService;
$customer = current_customer();
if (empty($customer)) {
return null;
}
$discountFactor = current_customer()->customerGroup->discount_factor;
$discountFactor = $customer->customerGroup->discount_factor;
if ($discountFactor <= 0) {
return;
return null;
}
if ($discountFactor > 1) {
$discountFactor = 1;