修复游客结账客户组折扣问题
This commit is contained in:
parent
34c45dcde9
commit
a5191440c6
|
|
@ -22,10 +22,14 @@ class CustomerDiscountService
|
||||||
public static function getTotal(CheckoutService $checkout)
|
public static function getTotal(CheckoutService $checkout)
|
||||||
{
|
{
|
||||||
$totalService = $checkout->totalService;
|
$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) {
|
if ($discountFactor <= 0) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
if ($discountFactor > 1) {
|
if ($discountFactor > 1) {
|
||||||
$discountFactor = 1;
|
$discountFactor = 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue