Skip to content

Commit

Permalink
Merge pull request #4768 from kurozumi/4.0
Browse files Browse the repository at this point in the history
購入手続き中でもPurchaseContextでユーザー情報を取得できるようにする
  • Loading branch information
okazy authored Nov 16, 2020
2 parents 40a16bb + da8d122 commit 20b8309
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Eccube/Controller/ShippingMultipleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Controller/ShoppingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Service/PurchaseFlow/PurchaseContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 20b8309

Please sign in to comment.