Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

購入手続き中でもPurchaseContextでユーザー情報を取得できるようにする #4768

Merged
merged 1 commit into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

インタフェースの変更とはなりますが、制限を緩和するだけなので問題ないかと思います。

{
$this->originHolder = $originHolder;
$this->user = $user;
Expand Down