增加 checkoutService 属性 totalService

This commit is contained in:
Edward Yang 2022-12-01 17:19:42 +08:00
parent a6322880d0
commit 9413de29c7
1 changed files with 3 additions and 2 deletions

View File

@ -30,6 +30,7 @@ class CheckoutService
public $customer; public $customer;
public $cart; public $cart;
public $selectedProducts; public $selectedProducts;
public $totalService;
/** /**
@ -169,13 +170,13 @@ class CheckoutService
$cartList = CartService::list($customer, true); $cartList = CartService::list($customer, true);
$carts = CartService::reloadData($cartList); $carts = CartService::reloadData($cartList);
$totalService = (new TotalService($currentCart, $cartList));
$this->totalService = $totalService;
$addresses = AddressRepo::listByCustomer($customer); $addresses = AddressRepo::listByCustomer($customer);
$shipments = ShippingMethodService::getShippingMethods($this); $shipments = ShippingMethodService::getShippingMethods($this);
$payments = PaymentMethodItem::collection(PluginRepo::getPaymentMethods())->jsonSerialize(); $payments = PaymentMethodItem::collection(PluginRepo::getPaymentMethods())->jsonSerialize();
$totalService = (new TotalService($currentCart, $cartList));
$data = [ $data = [
'current' => [ 'current' => [
'shipping_address_id' => $currentCart->shipping_address_id, 'shipping_address_id' => $currentCart->shipping_address_id,