diff --git a/src/Eccube/Controller/ShippingMultipleController.php b/src/Eccube/Controller/ShippingMultipleController.php index d0a2c63ebd2..2044f86a47d 100644 --- a/src/Eccube/Controller/ShippingMultipleController.php +++ b/src/Eccube/Controller/ShippingMultipleController.php @@ -343,7 +343,7 @@ public function index(Request $request) } } - $this->cartPurchaseFlow->validate($Cart, new PurchaseContext()); + $this->cartPurchaseFlow->validate($Cart, new PurchaseContext($Cart, $this->getUser())); $this->cartService->save(); } diff --git a/src/Eccube/Controller/ShoppingController.php b/src/Eccube/Controller/ShoppingController.php index 2f841a003e4..457b58548b5 100644 --- a/src/Eccube/Controller/ShoppingController.php +++ b/src/Eccube/Controller/ShoppingController.php @@ -124,7 +124,7 @@ public function index(PurchaseFlow $cartPurchaseFlow) log_info('[注文手続] Warningが発生しました.', [$flowResult->getWarning()]); // 受注明細と同期をとるため, CartPurchaseFlowを実行する - $cartPurchaseFlow->validate($Cart, new PurchaseContext()); + $cartPurchaseFlow->validate($Cart, new PurchaseContext($Cart, $this->getUser())); $this->cartService->save(); } @@ -685,7 +685,7 @@ public function error(Request $request, PurchaseFlow $cartPurchaseFlow) // 受注とカートのずれを合わせるため, カートのPurchaseFlowをコールする. $Cart = $this->cartService->getCart(); if (null !== $Cart) { - $cartPurchaseFlow->validate($Cart, new PurchaseContext()); + $cartPurchaseFlow->validate($Cart, new PurchaseContext($Cart, $this->getUser())); $this->cartService->setPreOrderId(null); $this->cartService->save(); } diff --git a/src/Eccube/Service/PurchaseFlow/PurchaseContext.php b/src/Eccube/Service/PurchaseFlow/PurchaseContext.php index 68ba672db07..6b4544ede48 100644 --- a/src/Eccube/Service/PurchaseFlow/PurchaseContext.php +++ b/src/Eccube/Service/PurchaseFlow/PurchaseContext.php @@ -33,7 +33,7 @@ class PurchaseContext extends \SplObjectStorage const CART_FLOW = 'cart'; - public function __construct(ItemHolderInterface $originHolder = null, Customer $user = null) + public function __construct(ItemHolderInterface $originHolder = null, ?Customer $user = null) { $this->originHolder = $originHolder; $this->user = $user;