| @@ 402-432 (lines=31) @@ | ||
| 399 | /** |
|
| 400 | * お届け先変更がクリックされた場合の処理 |
|
| 401 | */ |
|
| 402 | public function shippingChange(Application $app, Request $request, $id) |
|
| 403 | { |
|
| 404 | $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']); |
|
| 405 | if (!$Order) { |
|
| 406 | $app->addError('front.shopping.order.error'); |
|
| 407 | return $app->redirect($app->url('shopping_error')); |
|
| 408 | } |
|
| 409 | ||
| 410 | $form = $app['eccube.service.shopping']->getShippingForm($Order); |
|
| 411 | ||
| 412 | if ('POST' === $request->getMethod()) { |
|
| 413 | $form->handleRequest($request); |
|
| 414 | ||
| 415 | if ($form->isValid()) { |
|
| 416 | $data = $form->getData(); |
|
| 417 | $message = $data['message']; |
|
| 418 | $Order->setMessage($message); |
|
| 419 | // 受注情報を更新 |
|
| 420 | $app['orm.em']->flush(); |
|
| 421 | // お届け先設定一覧へリダイレクト |
|
| 422 | return $app->redirect($app->url('shopping_shipping', array('id' => $id))); |
|
| 423 | } else { |
|
| 424 | return $app->render('Shopping/index.twig', array( |
|
| 425 | 'form' => $form->createView(), |
|
| 426 | 'Order' => $Order, |
|
| 427 | )); |
|
| 428 | } |
|
| 429 | } |
|
| 430 | ||
| 431 | return $app->redirect($app->url('shopping')); |
|
| 432 | } |
|
| 433 | ||
| 434 | /** |
|
| 435 | * お届け先の設定一覧からの選択 |
|
| @@ 523-553 (lines=31) @@ | ||
| 520 | /** |
|
| 521 | * お届け先の設定(非会員)がクリックされた場合の処理 |
|
| 522 | */ |
|
| 523 | public function shippingEditChange(Application $app, Request $request, $id) |
|
| 524 | { |
|
| 525 | $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']); |
|
| 526 | if (!$Order) { |
|
| 527 | $app->addError('front.shopping.order.error'); |
|
| 528 | return $app->redirect($app->url('shopping_error')); |
|
| 529 | } |
|
| 530 | ||
| 531 | $form = $app['eccube.service.shopping']->getShippingForm($Order); |
|
| 532 | ||
| 533 | if ('POST' === $request->getMethod()) { |
|
| 534 | $form->handleRequest($request); |
|
| 535 | ||
| 536 | if ($form->isValid()) { |
|
| 537 | $data = $form->getData(); |
|
| 538 | $message = $data['message']; |
|
| 539 | $Order->setMessage($message); |
|
| 540 | // 受注情報を更新 |
|
| 541 | $app['orm.em']->flush(); |
|
| 542 | // お届け先設定一覧へリダイレクト |
|
| 543 | return $app->redirect($app->url('shopping_shipping_edit', array('id' => $id))); |
|
| 544 | } else { |
|
| 545 | return $app->render('Shopping/index.twig', array( |
|
| 546 | 'form' => $form->createView(), |
|
| 547 | 'Order' => $Order, |
|
| 548 | )); |
|
| 549 | } |
|
| 550 | } |
|
| 551 | ||
| 552 | return $app->redirect($app->url('shopping')); |
|
| 553 | } |
|
| 554 | ||
| 555 | ||
| 556 | /** |
|
| @@ 873-903 (lines=31) @@ | ||
| 870 | /** |
|
| 871 | * 複数配送処理がクリックされた場合の処理 |
|
| 872 | */ |
|
| 873 | public function shippingMultipleChange(Application $app, Request $request) |
|
| 874 | { |
|
| 875 | $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']); |
|
| 876 | if (!$Order) { |
|
| 877 | $app->addError('front.shopping.order.error'); |
|
| 878 | return $app->redirect($app->url('shopping_error')); |
|
| 879 | } |
|
| 880 | ||
| 881 | $form = $app['eccube.service.shopping']->getShippingForm($Order); |
|
| 882 | ||
| 883 | if ('POST' === $request->getMethod()) { |
|
| 884 | $form->handleRequest($request); |
|
| 885 | ||
| 886 | if ($form->isValid()) { |
|
| 887 | $data = $form->getData(); |
|
| 888 | $message = $data['message']; |
|
| 889 | $Order->setMessage($message); |
|
| 890 | // 受注情報を更新 |
|
| 891 | $app['orm.em']->flush(); |
|
| 892 | // 複数配送設定へリダイレクト |
|
| 893 | return $app->redirect($app->url('shopping_shipping_multiple')); |
|
| 894 | } else { |
|
| 895 | return $app->render('Shopping/index.twig', array( |
|
| 896 | 'form' => $form->createView(), |
|
| 897 | 'Order' => $Order, |
|
| 898 | )); |
|
| 899 | } |
|
| 900 | } |
|
| 901 | ||
| 902 | return $app->redirect($app->url('shopping')); |
|
| 903 | } |
|
| 904 | ||
| 905 | ||
| 906 | /** |
|