Skip to content

Commit

Permalink
受注編集時にすでに受注にセットされている顧客情報を書き換えない
Browse files Browse the repository at this point in the history
  • Loading branch information
yshirai-joolen authored and chihiro-adachi committed Nov 16, 2021
1 parent e955010 commit 95f3438
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Eccube/Form/Type/Admin/OrderType.php
Expand Up @@ -378,16 +378,15 @@ public function copyFields(FormEvent $event)
$Order->setPaymentMethod($Payment->getMethod());
}

// 会員受注の場合、会員の性別/職業/誕生日をエンティティにコピーする
if ($Customer = $Order->getCustomer()) {
$Order->setSex($Customer->getSex());
$Order->setJob($Customer->getJob());
$Order->setBirth($Customer->getBirth());
}

// 新規登録時は, 新規受付ステータスで登録する.
if (null === $Order->getOrderStatus()) {
$Order->setOrderStatus($this->orderStatusRepository->find(OrderStatus::NEW));
// 会員受注の場合、会員の性別/職業/誕生日をエンティティにコピーする
if ($Customer = $Order->getCustomer()) {
$Order->setSex($Customer->getSex());
$Order->setJob($Customer->getJob());
$Order->setBirth($Customer->getBirth());
}
} else {
// 編集時は, mapped => falseで定義しているため, フォームから変更後データを取得する.
$form = $event->getForm();
Expand Down

0 comments on commit 95f3438

Please sign in to comment.