| @@ 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 | * お届け先の設定一覧からの選択 |
|
| @@ 525-555 (lines=31) @@ | ||
| 522 | /** |
|
| 523 | * お届け先の設定(非会員)がクリックされた場合の処理 |
|
| 524 | */ |
|
| 525 | public function shippingEditChange(Application $app, Request $request, $id) |
|
| 526 | { |
|
| 527 | $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']); |
|
| 528 | if (!$Order) { |
|
| 529 | $app->addError('front.shopping.order.error'); |
|
| 530 | return $app->redirect($app->url('shopping_error')); |
|
| 531 | } |
|
| 532 | ||
| 533 | $form = $app['eccube.service.shopping']->getShippingForm($Order); |
|
| 534 | ||
| 535 | if ('POST' === $request->getMethod()) { |
|
| 536 | $form->handleRequest($request); |
|
| 537 | ||
| 538 | if ($form->isValid()) { |
|
| 539 | $data = $form->getData(); |
|
| 540 | $message = $data['message']; |
|
| 541 | $Order->setMessage($message); |
|
| 542 | // 受注情報を更新 |
|
| 543 | $app['orm.em']->flush(); |
|
| 544 | // お届け先設定一覧へリダイレクト |
|
| 545 | return $app->redirect($app->url('shopping_shipping_edit', array('id' => $id))); |
|
| 546 | } else { |
|
| 547 | return $app->render('Shopping/index.twig', array( |
|
| 548 | 'form' => $form->createView(), |
|
| 549 | 'Order' => $Order, |
|
| 550 | )); |
|
| 551 | } |
|
| 552 | } |
|
| 553 | ||
| 554 | return $app->redirect($app->url('shopping')); |
|
| 555 | } |
|
| 556 | ||
| 557 | ||
| 558 | /** |
|
| @@ 875-905 (lines=31) @@ | ||
| 872 | /** |
|
| 873 | * 複数配送処理がクリックされた場合の処理 |
|
| 874 | */ |
|
| 875 | public function shippingMultipleChange(Application $app, Request $request) |
|
| 876 | { |
|
| 877 | $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']); |
|
| 878 | if (!$Order) { |
|
| 879 | $app->addError('front.shopping.order.error'); |
|
| 880 | return $app->redirect($app->url('shopping_error')); |
|
| 881 | } |
|
| 882 | ||
| 883 | $form = $app['eccube.service.shopping']->getShippingForm($Order); |
|
| 884 | ||
| 885 | if ('POST' === $request->getMethod()) { |
|
| 886 | $form->handleRequest($request); |
|
| 887 | ||
| 888 | if ($form->isValid()) { |
|
| 889 | $data = $form->getData(); |
|
| 890 | $message = $data['message']; |
|
| 891 | $Order->setMessage($message); |
|
| 892 | // 受注情報を更新 |
|
| 893 | $app['orm.em']->flush(); |
|
| 894 | // 複数配送設定へリダイレクト |
|
| 895 | return $app->redirect($app->url('shopping_shipping_multiple')); |
|
| 896 | } else { |
|
| 897 | return $app->render('Shopping/index.twig', array( |
|
| 898 | 'form' => $form->createView(), |
|
| 899 | 'Order' => $Order, |
|
| 900 | )); |
|
| 901 | } |
|
| 902 | } |
|
| 903 | ||
| 904 | return $app->redirect($app->url('shopping')); |
|
| 905 | } |
|
| 906 | ||
| 907 | ||
| 908 | /** |
|