app/Customize/Controller/Mypage/MypageController.php line 359

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Customize\Controller\Mypage;
  13. use Customize\Entity\JewelLocation;
  14. use Customize\Event\CustomizeEvents;
  15. use Customize\Repository\AdjusterRepository;
  16. use Customize\Repository\BreathredRepository;
  17. use Customize\Repository\BroochRepository;
  18. use Customize\Repository\CatchyRepository;
  19. use Customize\Repository\CustomBreathredRepository;
  20. use Customize\Repository\CustomBroochRepository;
  21. use Customize\Repository\CustomEarringRepository;
  22. use Customize\Repository\CustomNecklaceRepository;
  23. use Customize\Repository\CustomPendantRepository;
  24. use Customize\Repository\CustomPierceRepository;
  25. use Customize\Repository\CustomProductRepository;
  26. use Customize\Repository\CustomRingRepository;
  27. use Customize\Repository\CustomShippoRingRepository;
  28. use Customize\Repository\EarringRepository;
  29. use Customize\Repository\HikiwaRepository;
  30. use Customize\Repository\JewelLocationRepository;
  31. use Customize\Repository\JewelPartRepository;
  32. use Customize\Repository\JewelRepository;
  33. use Customize\Repository\NecklaceRepository;
  34. use Eccube\Controller\AbstractController;
  35. use Eccube\Entity\BaseInfo;
  36. use Eccube\Entity\Customer;
  37. use Eccube\Entity\Order;
  38. use Eccube\Entity\Product;
  39. use Eccube\Event\EccubeEvents;
  40. use Eccube\Event\EventArgs;
  41. use Eccube\Exception\CartException;
  42. use Eccube\Form\Type\Front\CustomerLoginType;
  43. use Eccube\Repository\BaseInfoRepository;
  44. use Eccube\Repository\CustomerFavoriteProductRepository;
  45. use Eccube\Repository\OrderRepository;
  46. use Eccube\Repository\ProductRepository;
  47. use Customize\Service\CartService;
  48. use Customize\Repository\OrderItemRepositoryExtension;
  49. use Customize\Repository\PendantRepository;
  50. use Customize\Repository\PierceRepository;
  51. use Customize\Repository\ProductClassRepository;
  52. use Customize\Repository\RakuwaRepository;
  53. use Customize\Repository\RepairRepository;
  54. use Customize\Repository\RingRepository;
  55. use Customize\Repository\ShippoRingRepository;
  56. use Eccube\Service\PurchaseFlow\PurchaseContext;
  57. use Eccube\Service\PurchaseFlow\PurchaseFlow;
  58. use Exception;
  59. use Knp\Component\Pager\PaginatorInterface;
  60. use phpDocumentor\Reflection\Types\Null_;
  61. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  62. use Symfony\Component\Finder\Finder;
  63. use Symfony\Component\HttpFoundation\JsonResponse;
  64. use Symfony\Component\HttpFoundation\Request;
  65. use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
  66. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  67. use Symfony\Component\Routing\Annotation\Route;
  68. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  69. class MypageController extends AbstractController
  70. {
  71.     /**
  72.      * @var ProductRepository
  73.      */
  74.     protected $productRepository;
  75.     /**
  76.      * @var CustomerFavoriteProductRepository
  77.      */
  78.     protected $customerFavoriteProductRepository;
  79.     /**
  80.      * @var BaseInfo
  81.      */
  82.     protected $BaseInfo;
  83.     /**
  84.      * @var CartService
  85.      */
  86.     protected $cartService;
  87.     /**
  88.      * @var OrderRepository
  89.      */
  90.     protected $orderRepository;
  91.     /**
  92.      * @var PurchaseFlow
  93.      */
  94.     protected $purchaseFlow;
  95.     /**
  96.      * @var OrderItemRepositoryExtension
  97.      */
  98.     protected $orderItemRepositoryExtension;
  99.     /**
  100.      * @var CustomRingRepository
  101.      */
  102.     protected $customRingRepository;
  103.     /**
  104.      * @var CustomPierceRepository
  105.      */
  106.     protected $customPierceRepository;
  107.     /**
  108.      * @var RingRepository
  109.      */
  110.     protected $ringRepository;
  111.     /**
  112.      * @var PierceRepository
  113.      */
  114.     protected $pierceRepository;
  115.     /**
  116.      * @var BroochRepository
  117.      */
  118.     protected $broochRepository;
  119.     /**
  120.      * @var CustomBroochRepository
  121.      */
  122.     protected $customBroochRepository;
  123.     /**
  124.      * @var JewelRepository
  125.      */
  126.     protected $jewelRepository;
  127.     /**
  128.      * @var JewelLocationRepository
  129.      */
  130.     protected $jewelLocationRepository;
  131.     /**
  132.      * @var JewelPartRepository
  133.      */
  134.     protected $jewelPartRepository;
  135.     /**
  136.      * @var CatchyRepository
  137.      */
  138.     protected $catchyRepository;
  139.     /**
  140.      * @var AdjusterRepository
  141.      */
  142.     protected $adjusterRepository;
  143.     /**
  144.      * @var ShippoRingRepository
  145.      */
  146.     protected $shippoRingRepository;
  147.     /**
  148.      * @var CustomShippoRingRepository
  149.      */
  150.     protected $customShippoRingRepository;
  151.     /**
  152.      * @var EarringRepository
  153.      */
  154.     protected $earringRepository;
  155.     /**
  156.      * @var CustomEarringRepository
  157.      */
  158.     protected $customEarringRepository;
  159.     /**
  160.      * @var RepairRepository
  161.      */
  162.     protected $repairRepository;
  163.     /**
  164.      * @var ProductClassRepository
  165.      */
  166.     protected $productClassRepository;
  167.     /**
  168.      * @var CustomProductRepository
  169.      */
  170.     protected $customProductRepository;
  171.    
  172.     /**
  173.      * @var PendantRepository
  174.      */
  175.     protected $pendantRepository;
  176.     /**
  177.      * @var CustomPendantRepository
  178.      */
  179.     protected $customPendantRepository;
  180.     /**
  181.      * @var BreathredRepository
  182.      */
  183.     protected $breathredRepository;
  184.     /**
  185.      * @var CustomBreathredRepository
  186.      */
  187.     protected $customBreathredRepository;
  188.     /**
  189.      * @var NecklaceRepository
  190.      */
  191.     protected $necklaceRepository;
  192.     /**
  193.      * @var CustomNecklaceRepository
  194.      */
  195.     protected $customNecklaceRepository;
  196.     /**
  197.      * @var HikiwaRepository
  198.      */
  199.     protected $hikiwaRepository;
  200.     /**
  201.      * @var RakuwaRepository
  202.      */
  203.     protected $rakuwaRepository;
  204.     /**
  205.      * MypageController constructor.
  206.      *
  207.      * @param OrderRepository $orderRepository
  208.      * @param CustomerFavoriteProductRepository $customerFavoriteProductRepository
  209.      * @param CartService $cartService
  210.      * @param BaseInfoRepository $baseInfoRepository
  211.      * @param PurchaseFlow $purchaseFlow
  212.      * @param OrderItemRepositoryExtension $orderItemRepositoryExtension
  213.      * @param CustomRingRepository $customRingRepository
  214.      * @param RingRepository $ringRepository
  215.      * @param JewelPartRepository $jewelPartRepository
  216.      * @param JewelRepository $jewelRepository
  217.      * @param PierceRepository $pierceRepository
  218.      * @param CustomPierceRepository $customPierceRepository
  219.      * @param CatchyRepository $catchyRepository
  220.      * @param RepairRepository $repairRepository
  221.      * @param CustomProductRepository $customProductRepository
  222.      * @param ProductClassRepository $productClassRepository
  223.      * @param JewelLocationRepository $jewelLocationRepository
  224.      * @param ShippoRingRepository $shippoRingRepository
  225.      * @param CustomShippoRingRepository $customShippoRingRepository
  226.      * @param BroochRepository $broochRepository
  227.      * @param CustomBroochRepository $customBroochRepository
  228.      * @param CustomPendantRepository $customPendantRepository
  229.      * @param PendantRepository $pendantRepository
  230.      * @param NecklaceRepository $necklaceRepository
  231.      * @param EarringRepository $earringRepository
  232.      * @param CustomEarringRepository $customEarringRepository
  233.      * @param BreathredRepository $breathredRepository
  234.      * @param CustomBreathredRepository $customBreathredRepository
  235.      * @param HikiwaRepository $hikiwaRepository
  236.      * @param AdjusterRepository $adjusterRepository
  237.      * @param CustomNecklaceRepository $customNecklaceRepository
  238.      * @param RakuwaRepository $rakuwaRepository
  239.      */
  240.     public function __construct(
  241.         OrderRepository $orderRepository,
  242.         CustomerFavoriteProductRepository $customerFavoriteProductRepository,
  243.         CartService $cartService,
  244.         BaseInfoRepository $baseInfoRepository,
  245.         PurchaseFlow $purchaseFlow,
  246.         OrderItemRepositoryExtension $orderItemRepositoryExtension,
  247.         CustomRingRepository $customRingRepository,
  248.         RingRepository $ringRepository,
  249.         JewelRepository $jewelRepository,
  250.         JewelPartRepository $jewelPartRepository,
  251.         PierceRepository $pierceRepository,
  252.         CustomPierceRepository $customPierceRepository,
  253.         CatchyRepository $catchyRepository,
  254.         RepairRepository $repairRepository,
  255.         CustomProductRepository $customProductRepository,
  256.         ProductClassRepository $productClassRepository,
  257.         JewelLocationRepository $jewelLocationRepository,
  258.         ShippoRingRepository $shippoRingRepository,
  259.         CustomShippoRingRepository $customShippoRingRepository,
  260.         BroochRepository $broochRepository,
  261.         CustomBroochRepository $customBroochRepository,
  262.         PendantRepository $pendantRepository,
  263.         CustomPendantRepository $customPendantRepository,
  264.         NecklaceRepository $necklaceRepository,
  265.         EarringRepository $earringRepository,
  266.         CustomEarringRepository $customEarringRepository,
  267.         BreathredRepository $breathredRepository,
  268.         CustomBreathredRepository $customBreathredRepository,
  269.         HikiwaRepository $hikiwaRepository,
  270.         AdjusterRepository $adjusterRepository,
  271.         CustomNecklaceRepository $customNecklaceRepository,
  272.         RakuwaRepository $rakuwaRepository
  273.     ) {
  274.         $this->orderRepository $orderRepository;
  275.         $this->customerFavoriteProductRepository $customerFavoriteProductRepository;
  276.         $this->BaseInfo $baseInfoRepository->get();
  277.         $this->cartService $cartService;
  278.         $this->purchaseFlow $purchaseFlow;
  279.         $this->orderItemRepositoryExtension $orderItemRepositoryExtension;
  280.         $this->customRingRepository $customRingRepository;
  281.         $this->ringRepository $ringRepository;
  282.         $this->jewelPartRepository $jewelPartRepository;
  283.         $this->jewelRepository $jewelRepository;
  284.         $this->pierceRepository $pierceRepository;
  285.         $this->customPierceRepository $customPierceRepository;
  286.         $this->catchyRepository $catchyRepository;
  287.         $this->repairRepository $repairRepository;
  288.         $this->customProductRepository $customProductRepository;
  289.         $this->productClassRepository $productClassRepository;
  290.         $this->jewelLocationRepository $jewelLocationRepository;
  291.         $this->shippoRingRepository $shippoRingRepository;
  292.         $this->customShippoRingRepository $customShippoRingRepository;
  293.         $this->broochRepository $broochRepository;
  294.         $this->customBroochRepository $customBroochRepository;
  295.         $this->pendantRepository $pendantRepository;
  296.         $this->customPendantRepository $customPendantRepository;
  297.         $this->necklaceRepository $necklaceRepository;
  298.         $this->earringRepository $earringRepository;
  299.         $this->customEarringRepository $customEarringRepository;
  300.         $this->breathredRepository $breathredRepository;
  301.         $this->customBreathredRepository $customBreathredRepository;
  302.         $this->hikiwaRepository $hikiwaRepository;
  303.         $this->adjusterRepository $adjusterRepository;
  304.         $this->customNecklaceRepository $customNecklaceRepository;
  305.         $this->rakuwaRepository $rakuwaRepository;
  306.     }
  307.     /**
  308.      * ログイン画面.
  309.      *
  310.      * @Route("/mypage/login", name="mypage_login", methods={"GET", "POST"})
  311.      * @Template("Mypage/login.twig")
  312.      */
  313.     public function login(Request $requestAuthenticationUtils $utils)
  314.     {
  315.         if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
  316.             log_info('認証済のためログイン処理をスキップ');
  317.             return $this->redirectToRoute('mypage');
  318.         }
  319.         /* @var $form \Symfony\Component\Form\FormInterface */
  320.         $builder $this->formFactory
  321.             ->createNamedBuilder(''CustomerLoginType::class);
  322.         $builder->get('login_memory')->setData((bool) $request->getSession()->get('_security.login_memory'));
  323.         if ($this->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
  324.             $Customer $this->getUser();
  325.             if ($Customer instanceof Customer) {
  326.                 $builder->get('login_email')
  327.                     ->setData($Customer->getEmail());
  328.             }
  329.         }
  330.         $event = new EventArgs(
  331.             [
  332.                 'builder' => $builder,
  333.             ],
  334.             $request
  335.         );
  336.         $this->eventDispatcher->dispatch(EccubeEvents::FRONT_MYPAGE_MYPAGE_LOGIN_INITIALIZE$event);
  337.         $form $builder->getForm();
  338.         return [
  339.             'error' => $utils->getLastAuthenticationError(),
  340.             'form' => $form->createView(),
  341.         ];
  342.     }
  343.     
  344. /**
  345.      * マイページ.
  346.      *
  347.      * @Route("/mypage/", name="mypage", methods={"GET"})
  348.      * @Template("Mypage/index.twig")
  349.      */
  350.     public function index(Request $requestPaginatorInterface $paginator)
  351.     {
  352.         $session $request->getSession();
  353.         $session->remove('customize_base');
  354.         $session->remove('customize_type');
  355.         $session->remove('customize_jewel1');
  356.         $session->remove('customize_jewel1_shape');
  357.         
  358.         $Customer $this->getUser();
  359.         // 購入処理中/決済処理中ステータスの受注を非表示にする.
  360.         $this->entityManager
  361.             ->getFilters()
  362.             ->enable('incomplete_order_status_hidden');
  363.         // paginator
  364.         $qb $this->orderRepository->getQueryBuilderByCustomer($Customer);
  365.         $event = new EventArgs(
  366.             [
  367.                 'qb' => $qb,
  368.                 'Customer' => $Customer,
  369.             ],
  370.             $request
  371.         );
  372.         $this->eventDispatcher->dispatch(EccubeEvents::FRONT_MYPAGE_MYPAGE_INDEX_SEARCH$event);
  373.         $pagination $paginator->paginate(
  374.             $qb,
  375.             $request->get('pageno'1),
  376.             $this->eccubeConfig['eccube_search_pmax']
  377.         );
  378.         //custom ringのイメージ
  379.         $order_item = [];
  380.         $items $pagination->getItems();
  381.         foreach($items as $item){
  382.             $orders $this->orderItemRepositoryExtension->CustomFindWithID($item['id']);
  383.             $items_list = [];
  384.             foreach($orders as $order){
  385.                 $item_name $order->getProductName();
  386.                 $custom $order['product_code'];
  387.                 if($item_name != '手数料' &&  $item_name != '送料'){
  388.                     
  389.                     if(strpos($item_name,'カスタム') !== false || strpos($item_name,'七宝リング') !== false ){
  390.                         $is_repair false;
  391.                         if($item_name == 'カスタム修理'){
  392.                             $repair $this->repairRepository->repairFindWithID($custom)[0];
  393.                             $product_id $repair->getProductId();
  394.                             $prod $this->customProductRepository->customProductFind($product_id)[0];
  395.                             $item_name $prod->getName();
  396.                             
  397.                             if(str_contains($item_name,'カスタム') || str_contains($item_name,'七宝リング')){
  398.                                 $custom $repair->getCustomId();
  399.                                 $is_repair true;
  400.                                 
  401.                             }
  402.                             else{
  403.                                 $item_id $repair->getOriginalProductClassId();
  404.                                 $item $this->productClassRepository->find($item_id);
  405.                                 
  406.                                 // $temp = null;
  407.                                 $is_repair true;
  408.                                 // $temp['output_image'] = $item->getProduct()->getProductImage()[0];
  409.                                 // $temp['base'] = null;
  410.                                 // $temp['repair'] = $is_repair;
  411.                                 // $temp['prod'] = $item->getProduct();
  412.                                 
  413.                                 //array_push($items_list,$temp);
  414.                                 //break;
  415.                             }
  416.                         }
  417.                         
  418.                         switch($item_name){
  419.                             case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_RING):
  420.                                 $custom $this->customRingRepository->CustomFindWithID($custom)[0];
  421.                                 $ring $this->ringRepository->CustomFindWithID($custom->getRingBaseId())[0];
  422.                                 $socket $ring->getSocket();
  423.                                 $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  424.                                 $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  425.                                 if($jewel1->getJewelShape() == 'Only'){
  426.                                     $jewel_part1_shape 'only';
  427.                                 }
  428.                                 else{
  429.                                     $jewel_part1_shape '11';
  430.                                 }
  431.                                 if($socket == 2){
  432.                                     $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  433.         
  434.                                     $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  435.         
  436.                                     if($jewel2->getJewelShape() == 'Only'){
  437.                                         $jewel_part2_shape 'only';
  438.                                     }
  439.                                     else{
  440.             
  441.                                         $jewel_part2_shape '11';
  442.                                     }
  443.                                 }
  444.                                 if($custom->getEmpty() != null){
  445.                                     
  446.                                     $t unserialize($custom->getEmpty());
  447.                                 }
  448.                                 else{
  449.                                     $t null;
  450.                                 }
  451.                                 if($t){
  452.                                     $temp['empty'] = $t;
  453.                                 }
  454.                                 else{
  455.                                     $temp['empty'] = null;
  456.                                 }
  457.                                 $temp['output_image'] = 'customOutput/customRing/' $custom->getOutputImage();
  458.                                 $temp['pendant'] = null;
  459.                                 $temp['pendant_name'] = null;
  460.                                 $temp['base_path'] = 'customRing/ring/'.$ring->getRingShape() .'/'$ring->getRingType() .'/'$ring->getImageName();
  461.                                 $temp['base_name'] = $ring->getName();
  462.                                 $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  463.                                 $temp['jewel1_name'] = $jewel1->getName();
  464.                                 $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  465.                                 $temp['jewel_part1_name'] = $jewel_part1->getname();
  466.                                 if($socket == 2){
  467.                                     $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  468.                                     $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  469.                                     $temp['jewel2_name'] = $jewel2->getName();
  470.                                     $temp['jewel_part2_name'] = $jewel_part2->getname();
  471.                                 }
  472.                                 else{
  473.                                     $temp['jewel2_path'] = null;
  474.                                     $temp['jewel2_name'] = null;
  475.                                     $temp['jewel_part2_path'] = null;
  476.                                     $temp['jewel_part2_name'] = null;
  477.                                 }
  478.                                 $temp['catchy'] = null;
  479.                                 $temp['catchy_name'] = null;
  480.                                 $temp['hikiwa'] = null;
  481.                                 $temp['hikiwa_name'] = null;
  482.                                 $temp['adjuster'] = null;
  483.                                 $temp['adjuster_name'] = null;
  484.                                 $temp['repair'] = $is_repair;
  485.                                 array_push($items_list,$temp);
  486.                                 break;
  487.                             case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_PIERCE):
  488.                                 $custom $this->customPierceRepository->CustomFindWithID($custom)[0];
  489.                                 $pierce $this->pierceRepository->CustomFindWithID($custom->getPierceBaseId())[0];
  490.                                 $socket $pierce->getSocket();
  491.                                 $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  492.                                 $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  493.                                 
  494.                                 if($jewel1->getJewelShape() == 'Only'){
  495.                                     $jewel_part1_shape 'only';
  496.                                 }
  497.                                 else{
  498.                                     $jewel_part1_shape '11';
  499.                                 }
  500.                                 if($socket == 2){
  501.                                     $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  502.                                     $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  503.                                     if($jewel2->getJewelShape() == 'Only'){
  504.                                         $jewel_part2_shape 'only';
  505.                                     }
  506.                                     else{
  507.                                         $jewel_part2_shape '11';
  508.                                     }
  509.                                 }
  510.                                 if($custom->getEmpty() != null){
  511.                                     
  512.                                     $t unserialize($custom->getEmpty());
  513.                                 }
  514.                                 else{
  515.                                     $t null;
  516.                                 }
  517.                                 if($t){
  518.                                     $temp['empty'] = $t;
  519.                                 }
  520.                                 else{
  521.                                     $temp['empty'] = null;
  522.                                 }
  523.                                 $catchy $this->catchyRepository->CustomFindWithID($custom->getCatchyId())[0];
  524.                                 $temp['output_image'] = 'customOutput/customPierce/' $custom->getOutputImage();
  525.                                 $temp['pendant'] = null;
  526.                                 $temp['pendant_name'] = null;
  527.                                 $temp['base_path'] = 'customRing/pierce/'.$pierce->getPierceShape() .'/'$pierce->getPierceType() .'/list/'$pierce->getImageName();
  528.                                 $temp['base_name'] = $pierce->getName();
  529.                                 $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  530.                                 $temp['jewel1_name'] = $jewel1->getName();
  531.                                 $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  532.                                 $temp['jewel_part1_name'] = $jewel_part1->getname();
  533.                                 if($socket == 2){
  534.                                     $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  535.                                     $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  536.                                     $temp['jewel2_name'] = $jewel2->getName();
  537.                                     $temp['jewel_part2_name'] = $jewel_part2->getname();
  538.                                 }
  539.                                 else{
  540.                                     $temp['jewel2_path'] = null;
  541.                                     $temp['jewel2_name'] = null;
  542.                                     $temp['jewel_part2_path'] = null;
  543.                                     $temp['jewel_part2_name'] = null;
  544.                                 }
  545.                                 $temp['catchy'] = 'customRing/catchy/'.$catchy->getImageName();
  546.                                 $temp['catchy_name'] = $catchy->getName();
  547.                                
  548.                                 $temp['hikiwa'] = null;
  549.                                 $temp['hikiwa_name'] = null;
  550.                                 $temp['adjuster'] = null;
  551.                                 $temp['adjuster_name'] = null;
  552.                                 $temp['repair'] = $is_repair;
  553.                                 array_push($items_list,$temp);
  554.                                 break;
  555.                             case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_BROOCH):
  556.                                 $custom $this->customBroochRepository->CustomFindWithID($custom)[0];
  557.                                 
  558.                                 $brooch $this->broochRepository->CustomFindWithID($custom->getBroochBaseId())[0];
  559.                                 $socket $brooch->getSocket();
  560.                                 $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  561.                                 
  562.                                 $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  563.                                 if($jewel1->getJewelShape() == 'Only'){
  564.                                     $jewel_part1_shape 'only';
  565.                                 }
  566.                                 else{
  567.                                     $jewel_part1_shape '11';
  568.                                 }
  569.                                 if($custom->getEmpty() != null){
  570.                                     
  571.                                     $t unserialize($custom->getEmpty());
  572.                                 }
  573.                                 else{
  574.                                     $t null;
  575.                                 }
  576.                                 if($t){
  577.                                     $temp['empty'] = $t;
  578.                                 }
  579.                                 else{
  580.                                     $temp['empty'] = null;
  581.                                 }
  582.                                 $temp['output_image'] = 'customOutput/customBrooch/' $custom->getOutputImage();
  583.                                 $temp['pendant'] = null;
  584.                                 $temp['pendant_name'] = null;
  585.                                 $temp['base_path'] = 'customRing/brooch/'.$brooch->getBroochShape() .'/'$brooch->getBroochType() .'/list/'$brooch->getImageName();
  586.                                 $temp['base_name'] = $brooch->getName();
  587.                                 $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  588.                                 $temp['jewel1_name'] = $jewel1->getName();
  589.                                 $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  590.                                 $temp['jewel_part1_name'] = $jewel_part1->getname();
  591.                                
  592.                                 $temp['jewel2_path'] = null;
  593.                                 $temp['jewel2_name'] = null;
  594.                                 $temp['jewel_part2_path'] = null;
  595.                                 $temp['jewel_part2_name'] = null;
  596.                                 $temp['catchy'] = null;
  597.                                 $temp['catchy_name'] = null;
  598.                                 $temp['hikiwa'] = null;
  599.                                 $temp['hikiwa_name'] = null;
  600.                                 $temp['adjuster'] = null;
  601.                                 $temp['adjuster_name'] = null;
  602.                                 $temp['repair'] = $is_repair;
  603.                                 array_push($items_list,$temp);
  604.                                 break;
  605.                             case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_SHIPPORING):
  606.                                 $custom $this->customShippoRingRepository->CustomFindWithID($custom)[0];
  607.                                 $shippoRing $this->shippoRingRepository->CustomFindWithID($custom->getRingBaseId())[0];
  608.                                 $temp['empty'] = null;
  609.                                 $temp['output_image'] = 'customOutput/ShippoRing/' $custom->getOutputImage();
  610.                                 $temp['pendant'] = null;
  611.                                 $temp['pendant_name'] = null;
  612.                                 $temp['base_path'] = 'customRing/shippoRing/'.$shippoRing->getShippoRingShape() .'/'$shippoRing->getShippoRingType() .'/'$shippoRing->getShippoRingColor() .'/' $shippoRing->getImageName();
  613.                                 $temp['base_name'] = $shippoRing->getShippoRingName();
  614.                                 $temp['jewel1_path'] = null;
  615.                                 $temp['jewel1_name'] = null;
  616.                                 $temp['jewel_part1_path'] = null;
  617.                                 $temp['jewel_part1_name'] = null;
  618.                                 
  619.                                 $temp['jewel2_path'] = null;
  620.                                 $temp['jewel2_name'] = null;
  621.                                 $temp['jewel_part2_path'] = null;
  622.                                 $temp['jewel_part2_name'] = null;
  623.                                 $temp['catchy'] = null;
  624.                                 $temp['catchy_name'] = null;
  625.                                
  626.                                 $temp['hikiwa'] = null;
  627.                                 $temp['hikiwa_name'] = null;
  628.                                 $temp['adjuster'] = null;
  629.                                 $temp['adjuster_name'] = null;
  630.                                 $temp['repair'] = $is_repair;
  631.                                     
  632.                                 array_push($items_list,$temp);
  633.                                 break;
  634.                             case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_PENDANT):
  635.                                 $custom $this->customPendantRepository->CustomFindWithID($custom)[0];
  636.                                 
  637.                                 $pendant $this->pendantRepository->CustomFindWithID($custom->getPendantBaseId())[0];
  638.                                 $socket $pendant->getSocket();
  639.                                 $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  640.                                 $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  641.                                 if($jewel1->getJewelShape() == 'Only'){
  642.                                     $jewel_part1_shape 'only';
  643.                                 }
  644.                                 else{
  645.                                     $jewel_part1_shape '11';
  646.                                 }
  647.                                 if($custom->getEmpty() != null){
  648.                                     
  649.                                     $t unserialize($custom->getEmpty());
  650.                                 }
  651.                                 else{
  652.                                     $t null;
  653.                                 }
  654.                                 if($t){
  655.                                     $temp['empty'] = $t;
  656.                                 }
  657.                                 else{
  658.                                     $temp['empty'] = null;
  659.                                 }
  660.                                 $chain $this->necklaceRepository->CustomFindWithID($custom->getPendantChainId())[0];
  661.                                 $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  662.                                 $adjuster =$this->adjusterRepository->CustomFindWithID($custom->getAdjusterId())[0];
  663.                                 $temp['output_image'] = 'customOutput/customPendant/' $custom->getOutputImage();
  664.                                 $temp['pendant'] = 'customRing/pendant/'.$pendant->getPendantShape() .'/'$pendant->getPendantType() .'/list/'$pendant->getImageName();
  665.                                 $temp['pendant_name'] = null;
  666.                                 $temp['base_path'] = 'customRing/necklace/'.$chain->getNecklaceShape() .'/'$chain->getNecklaceType() .'/list/'$chain->getImageName();
  667.                                 $temp['base_name'] = $chain->getNecklaceName();
  668.                                 $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  669.                                 $temp['jewel1_name'] = $jewel1->getName();
  670.                                 $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  671.                                 $temp['jewel_part1_name'] = $jewel_part1->getname();
  672.                                
  673.                                 $temp['jewel2_path'] = null;
  674.                                 $temp['jewel2_name'] = null;
  675.                                 $temp['jewel_part2_path'] = null;
  676.                                 $temp['jewel_part2_name'] = null;
  677.                                 $temp['catchy'] = null;
  678.                                 $temp['catchy_name'] = null;
  679.                                 $temp['hikiwa'] = 'customRing/hikiwa/' $hikiwa->getHikiwaShape() . '/'$hikiwa->getHikiwaType() . '/'$hikiwa->getImageName();
  680.                                 $temp['hikiwa_name'] = $hikiwa->getHikiwaName();
  681.                                 $temp['adjuster'] = 'customRing/adjuster/' $adjuster->getAdjusterShape() . '/' $adjuster->getAdjusterType() . '/' $adjuster->getImageName();
  682.                                 $temp['adjuster_name'] = $adjuster->getAdjusterName();
  683.                                 $temp['repair'] = $is_repair;
  684.                                 array_push($items_list,$temp);
  685.                                 
  686.                                 break;
  687.                             case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_NECKLACE):
  688.                                 $custom $this->customNecklaceRepository->CustomFindWithID($custom)[0];
  689.                                 
  690.                                 $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  691.                                 $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  692.                                 if($jewel1->getJewelShape() == 'Only'){
  693.                                     $jewel_part1_shape 'only';
  694.                                 }
  695.                                 else{
  696.                                     $jewel_part1_shape '11';
  697.                                 }
  698.                                 if($custom->getEmpty() != null){
  699.                                     
  700.                                     $t unserialize($custom->getEmpty());
  701.                                 }
  702.                                 else{
  703.                                     $t null;
  704.                                 }
  705.                                 if($t){
  706.                                     $temp['empty'] = $t;
  707.                                 }
  708.                                 else{
  709.                                     $temp['empty'] = null;
  710.                                 }
  711.                                 $chain $this->necklaceRepository->CustomFindWithID($custom->getNecklaceBaseId())[0];
  712.                                 if($custom->getHikiwaId() != 0){
  713.                                     $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  714.                                     $temp['hikiwa'] = 'customRing/hikiwa/' $hikiwa->getHikiwaShape() . '/'$hikiwa->getHikiwaType() . '/'$hikiwa->getImageName();
  715.                                     $temp['hikiwa_name'] = $hikiwa->getHikiwaName();
  716.                                 }
  717.                                 else{
  718.                                     $rakuwa $this->rakuwaRepository->CustomFindWithID($custom->getRakuwaId())[0];
  719.                                     $temp['hikiwa'] = 'customRing/rakuwa/' $rakuwa->getRakuwaShape() . '/'$rakuwa->getRakuwaType() . '/'$rakuwa->getImageName();
  720.                                     $temp['hikiwa_name'] = $rakuwa->getRakuwaName();
  721.                                 }
  722.                                 $temp['output_image'] = 'customOutput/customNecklace/' $custom->getOutputImage();
  723.                                 $temp['pendant'] =null;
  724.                                 $temp['pendant_name'] = null;
  725.                                 $temp['base_path'] = 'customRing/necklace/'.$chain->getNecklaceShape() .'/'$chain->getNecklaceType() .'/list/'$chain->getImageName();
  726.                                 $temp['base_name'] = $chain->getNecklaceName();
  727.                                 $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  728.                                 $temp['jewel1_name'] = $jewel1->getName();
  729.                                 $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  730.                                 $temp['jewel_part1_name'] = $jewel_part1->getname();
  731.                                 
  732.                                 $temp['jewel2_path'] = null;
  733.                                 $temp['jewel2_name'] = null;
  734.                                 $temp['jewel_part2_path'] = null;
  735.                                 $temp['jewel_part2_name'] = null;
  736.                                 $temp['catchy'] = null;
  737.                                 $temp['catchy_name'] = null;
  738.                                 $temp['adjuster'] = null;
  739.                                 $temp['adjuster_name'] = null;
  740.                                 $temp['repair'] = $is_repair;
  741.                                 array_push($items_list,$temp);
  742.                                 
  743.                                 break;
  744.                             case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_EARRING):
  745.                                 $custom $this->customEarringRepository->CustomFindWithID($custom)[0];
  746.                                 $earring $this->earringRepository->CustomFindWithID($custom->getEarringBaseId())[0];
  747.                                 $socket $earring->getSocket();
  748.                                 $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  749.                                 $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  750.                                 
  751.                                 if($jewel1->getJewelShape() == 'Only'){
  752.                                     $jewel_part1_shape 'only';
  753.                                 }
  754.                                 else{
  755.                                     $jewel_part1_shape '11';
  756.                                 }
  757.                                 if($socket == 2){
  758.                                     $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  759.         
  760.                                     $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  761.         
  762.                                     if($jewel2->getJewelShape() == 'Only'){
  763.                                         $jewel_part2_shape 'only';
  764.                                     }
  765.                                     else{
  766.                                         $jewel_part2_shape '11';
  767.                                     }
  768.                                 }
  769.                                 if($custom->getEmpty() != null){
  770.                                     
  771.                                     $t unserialize($custom->getEmpty());
  772.                                 }
  773.                                 else{
  774.                                     $t null;
  775.                                 }
  776.                                 if($t){
  777.                                     $temp['empty'] = $t;
  778.                                 }
  779.                                 else{
  780.                                     $temp['empty'] = null;
  781.                                 }
  782.                                 $custom $this->customEarringRepository->CustomFindWithID($custom)[0];
  783.                                 $earring $this->earringRepository->CustomFindWithID($custom->getEarringBaseId())[0];
  784.                                 $socket $earring->getSocket();
  785.                                 $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  786.                                 $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  787.                                 
  788.                                 if($jewel1->getJewelShape() == 'Only'){
  789.                                     $jewel_part1_shape 'only';
  790.                                 }
  791.                                 else{
  792.                                     $jewel_part1_shape '11';
  793.                                 }
  794.                                 if($socket == 2){
  795.                                     $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  796.                                     $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  797.                                     if($jewel2->getJewelShape() == 'Only'){
  798.                                         $jewel_part2_shape 'only';
  799.                                     }
  800.                                     else{
  801.                                         $jewel_part2_shape '11';
  802.                                     }
  803.                                 }
  804.         
  805.                                 $temp['output_image'] = 'customOutput/customEarring/' $custom->getOutputImage();
  806.                                 $temp['pendant'] = null;
  807.                                 $temp['pendant_name'] = null;
  808.                                 $temp['base_path'] = 'customRing/earring/'.$earring->getEarringShape() .'/'$earring->getEarringType() .'/list/'$earring->getImageName();
  809.                                 $temp['base_name'] = $earring->getName();
  810.                                 $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  811.                                 $temp['jewel1_name'] = $jewel1->getName();
  812.                                 $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  813.                                 $temp['jewel_part1_name'] = $jewel_part1->getname();
  814.                                 if($socket == 2){
  815.                                     $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  816.                                     $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  817.                                     $temp['jewel2_name'] = $jewel2->getName();
  818.                                     $temp['jewel_part2_name'] = $jewel_part2->getname();
  819.                                 }
  820.                                 else{
  821.                                     $temp['jewel2_path'] = null;
  822.                                     $temp['jewel2_name'] = null;
  823.                                     $temp['jewel_part2_path'] = null;
  824.                                     $temp['jewel_part2_name'] = null;
  825.                                 }
  826.                                 $temp['catchy'] = null;
  827.                                 $temp['catchy_name'] = null;
  828.                                 $temp['hikiwa'] = null;
  829.                                 $temp['hikiwa_name'] = null;
  830.                                 $temp['adjuster'] = null;
  831.                                 $temp['adjuster_name'] = null;
  832.                                 $temp['repair'] = $is_repair;
  833.                                 array_push($items_list,$temp);
  834.                                 break;
  835.                             case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_BREATHED):
  836.                                 $custom $this->customBreathredRepository->CustomFindWithID($custom)[0];
  837.                                 $breathred $this->breathredRepository->CustomFindWithID($custom->getBreathredBaseId())[0];
  838.                                 $socket $breathred->getSocket();
  839.                                 $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  840.                                 $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  841.                                 
  842.                                 if($jewel1->getJewelShape() == 'Only'){
  843.                                     $jewel_part1_shape 'only';
  844.                                 }
  845.                                 else{
  846.                                     $jewel_part1_shape '11';
  847.                                 }
  848.                                 if($socket == 2){
  849.                                     $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  850.                                     $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  851.         
  852.                                     if($jewel2->getJewelShape() == 'Only'){
  853.                                         $jewel_part2_shape 'only';
  854.                                     }
  855.                                     else{
  856.                                         $jewel_part2_shape '11';
  857.                                     }
  858.                                 }
  859.                                 if($custom->getEmpty() != null){
  860.                                     
  861.                                     $t unserialize($custom->getEmpty());
  862.                                 }
  863.                                 else{
  864.                                     $t null;
  865.                                 }
  866.                                 if($t){
  867.                                     $temp['empty'] = $t;
  868.                                 }
  869.                                 else{
  870.                                     $temp['empty'] = null;
  871.                                 }
  872.                                 $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  873.                                 $adjuster =$this->adjusterRepository->CustomFindWithID($custom->getAdjusterId())[0];
  874.         
  875.                                 $temp['output_image'] = 'customOutput/customBreathred/' $custom->getOutputImage();
  876.                                 $temp['pendant'] = null;
  877.                                 $temp['pendant_name'] = null;
  878.                                 $temp['base_path'] = 'customRing/breathred/'.$breathred->getBreathredShape() .'/'$breathred->getBreathredType() .'/list/'$breathred->getImageName();
  879.                                 $temp['base_name'] = $breathred->getName();
  880.                                 $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  881.                                 $temp['jewel1_name'] = $jewel1->getName();
  882.                                 $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  883.                                 $temp['jewel_part1_name'] = $jewel_part1->getname();
  884.                                 if($socket == 2){
  885.                                     $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  886.                                     $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  887.                                     $temp['jewel2_name'] = $jewel2->getName();
  888.                                     $temp['jewel_part2_name'] = $jewel_part2->getname();
  889.                                 }
  890.                                 else{
  891.                                     $temp['jewel2_path'] = null;
  892.                                     $temp['jewel2_name'] = null;
  893.                                     $temp['jewel_part2_path'] = null;
  894.                                     $temp['jewel_part2_name'] = null;
  895.                                 }
  896.                                 $temp['catchy'] = null;
  897.                                 $temp['catchy_name'] = null;
  898.                                 $temp['hikiwa'] = 'customRing/hikiwa/' $hikiwa->getHikiwaShape() . '/'$hikiwa->getHikiwaType() . '/'$hikiwa->getImageName();;
  899.                                 $temp['hikiwa_name'] = $hikiwa->getHikiwaName();
  900.                                 $temp['adjuster'] = 'customRing/adjuster/' $adjuster->getAdjusterShape() . '/' $adjuster->getAdjusterType() . '/' $adjuster->getImageName();
  901.                                 $temp['adjuster_name'] = $adjuster->getAdjusterName();
  902.                                 $temp['repair'] = $is_repair;
  903.                                 array_push($items_list,$temp);
  904.                                 break;
  905.                             
  906.                             default:
  907.                                 $temp['output_image'] = $item->getProduct()->getProductImage()[0];
  908.                                 $temp['pendant'] = null;
  909.                                 $temp['pendant_name'] = null;
  910.                                 $temp['base_path'] = null;
  911.                                 $temp['base_name'] = null;
  912.                                 $temp['jewel1_path'] = null;
  913.                                 $temp['jewel1_name'] = null;
  914.                                 $temp['jewel_part1_path'] = null;
  915.                                 $temp['jewel_part1_name'] = null;
  916.                                 
  917.                                 $temp['jewel2_path'] = null;
  918.                                 $temp['jewel2_name'] = null;
  919.                                 $temp['jewel_part2_path'] = null;
  920.                                 $temp['jewel_part2_name'] = null;
  921.                                 $temp['catchy'] = null;
  922.                                 $temp['catchy_name'] = null;
  923.                             
  924.                                 $temp['hikiwa'] = null;
  925.                                 $temp['hikiwa_name'] = null;
  926.                                 $temp['adjuster'] = null;
  927.                                 $temp['adjuster_name'] = null;
  928.                                 $temp['repair'] = $is_repair;
  929.                                 array_push($items_list,$temp);
  930.                                 break;
  931.                         }
  932.                         }
  933.                         else{
  934.                             array_push($items_listNULL);
  935.                         }
  936.                             
  937.                     }
  938.                     else{
  939.                         array_push($items_listNULL);
  940.                     }
  941.                         
  942.                         
  943.                 }
  944.                 array_push($order_item$items_list);
  945.             }
  946.             
  947.             return [
  948.                 'pagination' => $pagination,
  949.                 'order_item' => $order_item
  950.             ];
  951.     }
  952.             
  953.       
  954.     // /**
  955.     //  * マイページ.
  956.     //  *
  957.     //  * @Route("/mypage/", name="mypage", methods={"GET"})
  958.     //  * @Template("Mypage/index.twig")
  959.     //  */
  960.     // public function index(Request $request, PaginatorInterface $paginator)
  961.     // {
  962.         
  963.     //     $Customer = $this->getUser();
  964.     //     // 購入処理中/決済処理中ステータスの受注を非表示にする.
  965.     //     $this->entityManager
  966.     //         ->getFilters()
  967.     //         ->enable('incomplete_order_status_hidden');
  968.     //     // paginator
  969.     //     $qb = $this->orderRepository->getQueryBuilderByCustomer($Customer);
  970.     //     $event = new EventArgs(
  971.     //         [
  972.     //             'qb' => $qb,
  973.     //             'Customer' => $Customer,
  974.     //         ],
  975.     //         $request
  976.     //     );
  977.     //     $this->eventDispatcher->dispatch(EccubeEvents::FRONT_MYPAGE_MYPAGE_INDEX_SEARCH, $event);
  978.     //     $pagination = $paginator->paginate(
  979.     //         $qb,
  980.     //         $request->get('pageno', 1),
  981.     //         $this->eccubeConfig['eccube_search_pmax']
  982.     //     );
  983.     //     //custom ringのイメージ
  984.     //     $order_item = [];
  985.     //     $items = $pagination->getItems();
  986.     //     foreach($items as $item){
  987.     //         $orders = $this->orderItemRepositoryExtension->CustomFindWithID($item['id']);
  988.     //         $items_list = [];
  989.     //         foreach($orders as $order){
  990.     //             $item_name = $order->getProductName();
  991.     //             $code = $order['product_code'];
  992.     //             if($item_name != '手数料' &&  $item_name != '送料'){
  993.                     
  994.     //                 if(strpos($item_name,'カスタム') !== false || strpos($item_name,'七宝リング') !== false ){
  995.     //                     $is_repair = false;
  996.     //                     if($item_name == 'カスタム修理'){
  997.     //                         $repair = $this->repairRepository->repairFindWithID($code)[0];
  998.     //                         $product_id = $repair->getProductId();
  999.     //                         $prod = $this->customProductRepository->customProductFind($product_id)[0];
  1000.     //                         $item_name = $prod->getName();
  1001.     //                         if(str_contains($item_name,'カスタム')){
  1002.     //                             $code = $repair->getCustomId();
  1003.     //                             $is_repair = true;
  1004.     //                         }
  1005.     //                         else{
  1006.     //                             $item_id = $repair->getOriginalProductClassId();
  1007.     //                             $item = $this->productClassRepository->find($item_id);
  1008.                                 
  1009.     //                             $temp = null;
  1010.     //                             $is_repair = true;
  1011.     //                             $temp['base'] = null;
  1012.     //                             $temp['repair'] = $is_repair;
  1013.     //                             $temp['prod'] = $item->getProduct();
  1014.                                 
  1015.     //                             array_push($items_list,$temp);
  1016.     //                             break;
  1017.     //                         }
  1018.     //                     }
  1019.                         
  1020.     //                     else if(str_contains($item_name, '七宝リング')){
  1021.                             
  1022.     //                         $custom = $this->customShippoRingRepository->CustomFindWithID(intval($code))[0];
  1023.     //                         $shippo = $this->shippoRingRepository->CustomFindWithID($custom->getRingBaseId())[0];
  1024.     //                         $temp['base'] = $shippo;
  1025.     //                         $temp['repair'] = $is_repair;
  1026.     //                         array_push($items_list,$temp);
  1027.     //                         break;
  1028.     //                     }
  1029.                         
  1030.     //                     switch($item_name){
  1031.     //                         case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_RING):
  1032.     //                             $custom = $this->customRingRepository->CustomFindWithID(intval($code));
  1033.     //                             $custom = $custom[0];
  1034.     //                             $base = $this->ringRepository->CustomFindWithID($custom->getRingBaseId());
  1035.     //                             $base = $base[0];
  1036.     //                             $base_image = 'customRing/ring/'.$base->getRingShape().'/'.$base->getRingType().'/'.$base->getImageName();
  1037.     //                             $catchy = NULL;
  1038.     //                             $hikiwa = NULL;
  1039.     //                             $adjuster = NULL;
  1040.     //                             $item_type = 'ring';
  1041.     //                             $jewel_location = $this->jewelLocationRepository->CustomFindWithShapeAndSocket($base->getRingShape(), $base->getSocket(), $base->getProductId())[0];
  1042.     //                             $base_type = $base->getRingType();
  1043.     //                             $base_shape = $base->getRingShape();
  1044.     //                             break;
  1045.     //                         case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_PIERCE):
  1046.     //                             $custom = $this->customPierceRepository->CustomFindWithID(intval($code));
  1047.     //                             $custom = $custom[0];
  1048.     //                             $base = $this->pierceRepository->CustomFindWithID($custom->getPierceBaseId());
  1049.     //                             $base = $base[0];
  1050.     //                             $base_image = 'customRing/pierce/'.$base->getPierceShape().'/'.$base->getPierceType().'/main/'.$base->getImageName();
  1051.     //                             $catchy = $this->catchyRepository->CustomFindWithID($custom->getCatchyId());
  1052.     //                             $catchy = $catchy[0];
  1053.     //                             $hikiwa = NULL;
  1054.     //                             $adjuster = NULL;
  1055.     //                             $item_type = 'pierce';
  1056.     //                             $jewel_location = $this->jewelLocationRepository->CustomFindWithShapeAndSocket($base->getPierceShape(), $base->getSocket(), $base->getProductId())[0];
  1057.     //                             $base_type = $base->getPierceType();
  1058.     //                             $base_shape = $base->getPierceShape();
  1059.     //                             break;
  1060.     //                         case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_BROOCH):
  1061.     //                             $custom = $this->customBroochRepository->CustomFindWithID(intval($code));
  1062.                                 
  1063.     //                             $custom = $custom[0];
  1064.     //                             $base = $this->broochRepository->CustomFindWithID($custom->getBroochBaseId());
  1065.     //                             $base = $base[0];
  1066.     //                             $base_image = 'customRing/brooch/'.$base->getBroochShape().'/'.$base->getBroochType().'/main/'.$base->getImageName();
  1067.     //                             $catchy = NULL;
  1068.     //                             $hikiwa = NULL;
  1069.     //                             $adjuster = NULL;
  1070.     //                             $item_type = 'brooch';
  1071.     //                             $jewel_location = $this->jewelLocationRepository->CustomFindWithShapeAndSocket($base->getBroochShape(), $base->getSocket(), $base->getProductId())[0];
  1072.     //                             $base_type = $base->getBroochType();
  1073.     //                             $base_shape = $base->getBroochShape();
  1074.     //                             break;
  1075.     //                         case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_PENDANT):
  1076.     //                             $custom = $this->customPendantRepository->CustomFindWithID(intval($code));
  1077.                                 
  1078.     //                             $custom = $custom[0];
  1079.     //                             $pendant = $this->pendantRepository->CustomFindWithID($custom->getPendantBaseId());
  1080.     //                             $pendant = $pendant[0];
  1081.     //                             #$base_image = 'customRing/pendant/'.$pendant->getPendantShape().'/'.$pendant->getPendantType().'/'.$pendant->getImageName();
  1082.     //                             $catchy = NULL;
  1083.     //                             $adjuster = NULL;
  1084.     //                             $hikiwa = $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  1085.     //                             #$hikiwa = 'customRing/hikiwa/' . $hikiwa->getHikiwaShape() . '/' . $hikiwa->getHikiwaType() .'/'. $hikiwa->getImageName();
  1086.     //                             $item_type = 'pendant';
  1087.     //                             $base = $this->necklaceRepository->CustomFindWithID($custom->getPendantChainId())[0];
  1088.     //                             $jewel_location = $this->jewelLocationRepository->CustomFindWithShapeAndSocket($base->getNecklaceShape(), $base->getSocket(), $base->getProductId())[0];
  1089.     //                             $base_type = $pendant->getPendantType();
  1090.     //                             $base_shape = $pendant->getPendantShape();
  1091.     //                             $base_image = 'customRing/necklace/'.$base->getNecklaceShape().'/'.$base->getNecklaceType().'/main/'.$base->getImageName();
  1092.     //                             $temp['pendant'] = $pendant;
  1093.     //                             break;
  1094.     //                         case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_EARRING):
  1095.     //                             $custom = $this->customEarringRepository->CustomFindWithID(intval($code));
  1096.     //                             $custom = $custom[0];
  1097.     //                             $base = $this->earringRepository->CustomFindWithID($custom->getEarringBaseId());
  1098.     //                             $base = $base[0];
  1099.     //                             $base_image = 'customRing/earring/'.$base->getEarringShape().'/'.$base->getEarringType().'/main/'.$base->getImageName();
  1100.     //                             $catchy = NULL;
  1101.     //                             $hikiwa = NULL;
  1102.     //                             $adjuster = NULL;
  1103.     //                             $item_type = 'earring';
  1104.     //                             $jewel_location = $this->jewelLocationRepository->CustomFindWithShapeAndSocket($base->getEarringShape(), $base->getSocket(), $base->getProductId())[0];
  1105.     //                             $base_type = $base->getEarringType();
  1106.     //                             $base_shape = $base->getEarringShape();
  1107.     //                             break;
  1108.     //                         case $item_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_BREATHED):
  1109.     //                             $custom = $this->customBreathredRepository->CustomFindWithID(intval($code));
  1110.     //                             $custom = $custom[0];
  1111.     //                             $base = $this->breathredRepository->CustomFindWithID($custom->getBreathredBaseId());
  1112.     //                             $base = $base[0];
  1113.     //                             $base_image = 'customRing/breathred/'.$base->getBreathredShape().'/'.$base->getBreathredType().'/main/'.$base->getImageName();
  1114.     //                             $catchy = NULL;
  1115.     //                             $hikiwa = $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  1116.     //                             $adjuster = $this->adjusterRepository->CustomFindWithID($custom->getAdjusterId())[0];
  1117.     //                             $item_type = 'breathred';
  1118.     //                             $jewel_location = $this->jewelLocationRepository->CustomFindWithShapeAndSocket($base->getBreathredShape(), $base->getSocket(), $base->getProductId())[0];
  1119.     //                             $base_type = $base->getBreathredType();
  1120.     //                             $base_shape = $base->getBreathredShape();
  1121.     //                             break;
  1122.     //                         default:
  1123.     //                             throw new NotFoundHttpException();
  1124.     //                     }
  1125.     //                         //jewelのイメージ
  1126.     //                         $jewel1 = $this->jewelRepository->CustomFindWithID($custom['jewel_id']);
  1127.     //                         $jewel1 = $jewel1[0];
  1128.                             
  1129.     //                         //jewel part のイメージ
  1130.     //                         $jewel_part1 = $this->jewelPartRepository->CustomFindWithID($custom['jewel_part_id']);
  1131.     //                         $jewel_part1 = $jewel_part1[0];
  1132.                                 
  1133.     //                         if($base->getSocket() == 2 && $item_type != 'pendant'){
  1134.     //                             $jewel_id2 = $custom->getJewelId2();
  1135.     //                             $jewel2 = $this->jewelRepository->CustomFindWithID($jewel_id2);
  1136.     //                             $jewel2 = $jewel2[0];
  1137.     //                             $jewel_part_id2 = $custom->getJewelPartId2();
  1138.     //                             $jewel_part2 = $this->jewelPartRepository->CustomFindWithID($jewel_part_id2);
  1139.     //                             $jewel_part2 = $jewel_part2[0];
  1140.     //                         }else{
  1141.     //                             $jewel2 = NULL;
  1142.     //                             $jewel_part2 = NULL;
  1143.     //                         }
  1144.                                 
  1145.     //                         $temp['hikiwa'] = $hikiwa;
  1146.     //                         $temp['base'] = $base;
  1147.     //                         $temp['base_type'] = $base_type;
  1148.     //                         $temp['base_shape'] = $base_shape;
  1149.     //                         $temp['jewel1'] = $jewel1;
  1150.     //                         $temp['jewel2'] = $jewel2;
  1151.     //                         $temp['jewel_part1'] = $jewel_part1;
  1152.     //                         $temp['jewel_part2'] = $jewel_part2;
  1153.     //                         $temp['catchy'] = $catchy;
  1154.     //                         $temp['adjuster'] = $adjuster;
  1155.     //                         $temp['base_image'] = $base_image;
  1156.     //                         $temp['type'] = $item_type;
  1157.     //                         $temp['location'] = $jewel_location;
  1158.     //                         $temp['rotation1'] = $custom->getJewelRotation();
  1159.     //                         $temp['rotation2'] = $custom->getJewelRotation2();
  1160.     //                         $temp['repair'] = $is_repair;
  1161.     //                         array_push($items_list, $temp);
  1162.     //                     }
  1163.     //                     else{
  1164.     //                         array_push($items_list, NULL);
  1165.     //                     }
  1166.                             
  1167.     //                 }
  1168.     //                 else{
  1169.     //                     array_push($items_list, NULL);
  1170.     //                 }
  1171.                         
  1172.                         
  1173.     //             }
  1174.     //             array_push($order_item, $items_list);
  1175.     //         }
  1176.             
  1177.     //         return [
  1178.     //             'pagination' => $pagination,
  1179.     //             'order_item' => $order_item
  1180.     //         ];
  1181.     // }
  1182.             
  1183.             
  1184.    
  1185.    
  1186.         /**
  1187.      * 購入履歴詳細を表示する.
  1188.      *
  1189.      * @Route("/mypage/history/{order_no}", name="mypage_history", methods={"GET"})
  1190.      * @Template("Mypage/history.twig")
  1191.      */
  1192.     public function history(Request $request$order_no)
  1193.     {
  1194.         $this->entityManager->getFilters()
  1195.             ->enable('incomplete_order_status_hidden');
  1196.         $Order $this->orderRepository->findOneBy(
  1197.             [
  1198.                 'order_no' => $order_no,
  1199.                 'Customer' => $this->getUser(),
  1200.             ]
  1201.         );
  1202.         $event = new EventArgs(
  1203.             [
  1204.                 'Order' => $Order,
  1205.             ],
  1206.             $request
  1207.         );
  1208.         $this->eventDispatcher->dispatch(EccubeEvents::FRONT_MYPAGE_MYPAGE_HISTORY_INITIALIZE$event);
  1209.         /** @var Order $Order */
  1210.         $Order $event->getArgument('Order');
  1211.         if (!$Order) {
  1212.             throw new NotFoundHttpException();
  1213.         }
  1214.         $stockOrder true;
  1215.         foreach ($Order->getOrderItems() as $orderItem) {
  1216.             if ($orderItem->isProduct() && $orderItem->getQuantity() < 0) {
  1217.                 $stockOrder false;
  1218.                 break;
  1219.             }
  1220.         }
  1221.         
  1222.         $orders $this->orderItemRepositoryExtension->CustomFindWithID($Order['id']);
  1223.         $custom_images = array();
  1224.         foreach($orders as $item ){
  1225.             if(str_contains($item->getProductName(), 'カスタム') || str_contains($item->getProductName(), '七宝リング')){
  1226.                 $code $item->getProductCode();
  1227.                 $product_name $item->getProductName();
  1228.                 $is_repair false;
  1229.                 if($product_name == 'カスタム修理'){
  1230.                     $repair $this->repairRepository->repairFindWithID($code)[0];
  1231.                     $product_id $repair->getProductId();
  1232.                     $prod $this->customProductRepository->customProductFind($product_id)[0];
  1233.                     $product_name $prod->getName();
  1234.                     if(str_contains($product_name,'カスタム') || str_contains($product_name,'七宝リング')){
  1235.                         $code $repair->getCustomId();
  1236.                         $is_repair true;
  1237.                         
  1238.                     }
  1239.                     else{
  1240.                         $item_id $repair->getOriginalProductClassId();
  1241.                         $item $this->productClassRepository->find($item_id);
  1242.                         
  1243.                         //$temp = null;
  1244.                         $is_repair true;
  1245.                         // $temp['base'] = null;
  1246.                         // $temp['repair'] = $is_repair;
  1247.                         // $temp['prod'] = $item->getProduct();
  1248.                         
  1249.                         // array_push($custom_images,$temp);
  1250.                         // break;
  1251.                     }
  1252.                 }
  1253.                 switch($product_name){
  1254.                     case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_RING):
  1255.                         $custom $this->customRingRepository->CustomFindWithID($code)[0];
  1256.                         $ring $this->ringRepository->CustomFindWithID($custom->getRingBaseId())[0];
  1257.                         $socket $ring->getSocket();
  1258.                         $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1259.                         $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1260.                         if($jewel1->getJewelShape() == 'Only'){
  1261.                             $jewel_part1_shape 'only';
  1262.                         }
  1263.                         else{
  1264.                             $jewel_part1_shape '11';
  1265.                         }
  1266.                         if($socket == 2){
  1267.                             $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  1268.                             $jewel2_name $jewel2->getJewelName();
  1269.                             $jewel2_image $jewel2->getImageName();
  1270.                             $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  1271.                             $jewel_part2_name $jewel_part2->getJewelPartName();
  1272.                             $jewel_part2_image $jewel_part2->getImageName();
  1273.                             if($jewel2->getJewelShape() == 'Only'){
  1274.                                 $jewel_part2_shape 'only';
  1275.                             }
  1276.                             else{
  1277.                                 $jewel_part2_shape '11';
  1278.                             }
  1279.                         }
  1280.                         
  1281.                         $temp['output_image'] = 'customOutput/customRing/' $custom->getOutputImage();
  1282.                         $temp['pendant'] = null;
  1283.                         $temp['pendant_name'] = null;
  1284.                         $temp['base_path'] = 'customRing/ring/'.$ring->getRingShape() .'/'$ring->getRingType() .'/'$ring->getImageName();
  1285.                         $temp['base_name'] = $ring->getName();
  1286.                         $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  1287.                         $temp['jewel1_name'] = $jewel1->getName();
  1288.                         $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  1289.                         $temp['jewel_part1_name'] = $jewel_part1->getname();
  1290.                         if($socket == 2){
  1291.                             $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  1292.                             $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  1293.                             $temp['jewel2_name'] = $jewel2->getName();
  1294.                             $temp['jewel_part2_name'] = $jewel_part2->getname();
  1295.                         }
  1296.                         else{
  1297.                             $temp['jewel2_path'] = null;
  1298.                             $temp['jewel2_name'] = null;
  1299.                             $temp['jewel_part2_path'] = null;
  1300.                             $temp['jewel_part2_name'] = null;
  1301.                         }
  1302.                         $temp['catchy'] = null;
  1303.                         $temp['catchy_name'] = null;
  1304.                     
  1305.                         $temp['hikiwa'] = null;
  1306.                         $temp['hikiwa_name'] = null;
  1307.                         $temp['adjuster'] = null;
  1308.                         $temp['adjuster_name'] = null;
  1309.                         $temp['repair'] = $is_repair;
  1310.                         array_push($custom_images,$temp);
  1311.                         break;
  1312.                     case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_PIERCE):
  1313.                         $custom $this->customPierceRepository->CustomFindWithID($code)[0];
  1314.                         $pierce $this->pierceRepository->CustomFindWithID($custom->getPierceBaseId())[0];
  1315.                         $socket $pierce->getSocket();
  1316.                         $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1317.                         $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1318.                         
  1319.                         if($jewel1->getJewelShape() == 'Only'){
  1320.                             $jewel_part1_shape 'only';
  1321.                         }
  1322.                         else{
  1323.                             $jewel_part1_shape '11';
  1324.                         }
  1325.                         if($socket == 2){
  1326.                             $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  1327.                             $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  1328.                             if($jewel2->getJewelShape() == 'Only'){
  1329.                                 $jewel_part2_shape 'only';
  1330.                             }
  1331.                             else{
  1332.                                 $jewel_part2_shape '11';
  1333.                             }
  1334.                         }
  1335.                         $catchy $this->catchyRepository->CustomFindWithID($custom->getCatchyId())[0];
  1336.                         $temp['output_image'] = 'customOutput/customPierce/' $custom->getOutputImage();
  1337.                         $temp['pendant'] = null;
  1338.                         $temp['pendant_name'] = null;
  1339.                         $temp['base_path'] = 'customRing/pierce/'.$pierce->getPierceShape() .'/'$pierce->getPierceType() .'/'$pierce->getImageName();
  1340.                         $temp['base_name'] = $pierce->getName();
  1341.                         $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  1342.                         $temp['jewel1_name'] = $jewel1->getName();
  1343.                         $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  1344.                         $temp['jewel_part1_name'] = $jewel_part1->getname();
  1345.                         if($socket == 2){
  1346.                             $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  1347.                             $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  1348.                             $temp['jewel2_name'] = $jewel2->getName();
  1349.                             $temp['jewel_part2_name'] = $jewel_part2->getname();
  1350.                         }
  1351.                         else{
  1352.                             $temp['jewel2_path'] = null;
  1353.                             $temp['jewel2_name'] = null;
  1354.                             $temp['jewel_part2_path'] = null;
  1355.                             $temp['jewel_part2_name'] = null;
  1356.                         }
  1357.                         $temp['catchy'] = 'customRing/catchy/'.$catchy->getImageName();
  1358.                         $temp['catchy_name'] = $catchy->getName();
  1359.                     
  1360.                         $temp['hikiwa'] = null;
  1361.                         $temp['hikiwa_name'] = null;
  1362.                         $temp['adjuster'] = null;
  1363.                         $temp['adjuster_name'] = null;
  1364.                         $temp['repair'] = $is_repair;
  1365.                         array_push($custom_images,$temp);
  1366.                         break;
  1367.                     case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_BROOCH):
  1368.                         $custom $this->customBroochRepository->CustomFindWithID($code)[0];
  1369.                         
  1370.                         $brooch $this->broochRepository->CustomFindWithID($custom->getBroochBaseId())[0];
  1371.                         $socket $brooch->getSocket();
  1372.                         $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1373.                         
  1374.                         $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1375.                         if($jewel1->getJewelShape() == 'Only'){
  1376.                             $jewel_part1_shape 'only';
  1377.                         }
  1378.                         else{
  1379.                             $jewel_part1_shape '11';
  1380.                         }
  1381.                         
  1382.                         $temp['output_image'] = 'customOutput/customBrooch/' $custom->getOutputImage();
  1383.                         $temp['pendant'] = null;
  1384.                         $temp['pendant_name'] = null;
  1385.                         $temp['base_path'] = 'customRing/brooch/'.$brooch->getBroochShape() .'/'$brooch->getBroochType() .'/list/'$brooch->getImageName();
  1386.                         $temp['base_name'] = $brooch->getName();
  1387.                         $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  1388.                         $temp['jewel1_name'] = $jewel1->getName();
  1389.                         $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  1390.                         $temp['jewel_part1_name'] = $jewel_part1->getname();
  1391.                         
  1392.                         $temp['jewel2_path'] = null;
  1393.                         $temp['jewel2_name'] = null;
  1394.                         $temp['jewel_part2_path'] = null;
  1395.                         $temp['jewel_part2_name'] = null;
  1396.                         $temp['catchy'] = null;
  1397.                         $temp['catchy_name'] = null;
  1398.                     
  1399.                         $temp['hikiwa'] = null;
  1400.                         $temp['hikiwa_name'] = null;
  1401.                         $temp['adjuster'] = null;
  1402.                         $temp['adjuster_name'] = null;
  1403.                         $temp['repair'] = $is_repair;
  1404.                         array_push($custom_images,$temp);
  1405.                         break;
  1406.                     case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_SHIPPORING):
  1407.                         $custom $this->customShippoRingRepository->CustomFindWithID($code)[0];
  1408.                         $shippoRing $this->shippoRingRepository->CustomFindWithID($custom->getRingBaseId())[0];
  1409.                         
  1410.                         $temp['output_image'] = 'customOutput/ShippoRing/' $custom->getOutputImage();
  1411.                         $temp['pendant'] = null;
  1412.                         $temp['pendant_name'] = null;
  1413.                         $temp['base_path'] = 'customRing/shippoRing/'.$shippoRing->getShippoRingShape() .'/'$shippoRing->getShippoRingType() .'/'$shippoRing->getShippoRingColor() .'/' $shippoRing->getImageName();
  1414.                         $temp['base_name'] = $shippoRing->getShippoRingName();
  1415.                         $temp['jewel1_path'] = null;
  1416.                         $temp['jewel1_name'] = null;
  1417.                         $temp['jewel_part1_path'] = null;
  1418.                         $temp['jewel_part1_name'] = null;
  1419.                         
  1420.                         $temp['jewel2_path'] = null;
  1421.                         $temp['jewel2_name'] = null;
  1422.                         $temp['jewel_part2_path'] = null;
  1423.                         $temp['jewel_part2_name'] = null;
  1424.                         $temp['catchy'] = null;
  1425.                         $temp['catchy_name'] = null;
  1426.                        
  1427.                         $temp['hikiwa'] = null;
  1428.                         $temp['hikiwa_name'] = null;
  1429.                         $temp['adjuster'] = null;
  1430.                         $temp['adjuster_name'] = null;
  1431.                         $temp['repair'] = $is_repair;
  1432.                             
  1433.                         array_push($custom_images,$temp);
  1434.                         break;
  1435.                     case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_PENDANT):
  1436.                         $custom $this->customPendantRepository->CustomFindWithID($code)[0];
  1437.                         
  1438.                         $pendant $this->pendantRepository->CustomFindWithID($custom->getPendantBaseId())[0];
  1439.                         $socket $pendant->getSocket();
  1440.                         $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1441.                         $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1442.                         if($jewel1->getJewelShape() == 'Only'){
  1443.                             $jewel_part1_shape 'only';
  1444.                         }
  1445.                         else{
  1446.                             $jewel_part1_shape '11';
  1447.                         }
  1448.                         $adjuster =$this->adjusterRepository->CustomFindWithID($custom->getAdjusterId())[0];
  1449.                         $chain $this->necklaceRepository->CustomFindWithID($custom->getPendantChainId())[0];
  1450.                         if($custom->getHikiwaId() != 0){
  1451.                             $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  1452.                             $temp['hikiwa'] = 'customRing/hikiwa/' $hikiwa->getHikiwaShape() . '/'$hikiwa->getHikiwaType() . '/'$hikiwa->getImageName();
  1453.                             $temp['hikiwa_name'] = $hikiwa->getHikiwaName();
  1454.                         }
  1455.                         else{
  1456.                             $rakuwa $this->rakuwaRepository->CustomFindWithID($custom->getRakuwaId())[0];
  1457.                             $temp['hikiwa'] = 'customRing/rakuwa/' $rakuwa->getRakuwaShape() . '/'$rakuwa->getRakuwaType() . '/'$rakuwa->getImageName();
  1458.                             $temp['hikiwa_name'] = $rakuwa->getRakuwaName();
  1459.                         }
  1460.                         $temp['output_image'] = 'customOutput/customPendant/' $custom->getOutputImage();
  1461.                         $temp['pendant'] = 'customRing/pendant/'.$pendant->getPendantShape() .'/'$pendant->getPendantType() .'/list/'$pendant->getImageName();
  1462.                         $temp['pendant_name'] = null;
  1463.                         $temp['base_path'] = 'customRing/necklace/'.$chain->getNecklaceShape() .'/'$chain->getNecklaceType() .'/list/'$chain->getImageName();
  1464.                         $temp['base_name'] = $chain->getNecklaceName();
  1465.                         $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  1466.                         $temp['jewel1_name'] = $jewel1->getName();
  1467.                         $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  1468.                         $temp['jewel_part1_name'] = $jewel_part1->getname();
  1469.                         
  1470.                         $temp['jewel2_path'] = null;
  1471.                         $temp['jewel2_name'] = null;
  1472.                         $temp['jewel_part2_path'] = null;
  1473.                         $temp['jewel_part2_name'] = null;
  1474.                         $temp['catchy'] = null;
  1475.                         $temp['catchy_name'] = null;
  1476.                         
  1477.                         $temp['adjuster'] = 'customRing/adjuster/' $adjuster->getAdjusterShape() . '/' $adjuster->getAdjusterType() . '/' $adjuster->getImageName();
  1478.                         $temp['adjuster_name'] = $adjuster->getAdjusterName();
  1479.                         $temp['repair'] = $is_repair;
  1480.                         array_push($custom_images,$temp);
  1481.                         
  1482.                         break;
  1483.                     case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_NECKLACE):
  1484.                         $custom $this->customNecklaceRepository->CustomFindWithID($code)[0];
  1485.                         
  1486.                         $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1487.                         $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1488.                         if($jewel1->getJewelShape() == 'Only'){
  1489.                             $jewel_part1_shape 'only';
  1490.                         }
  1491.                         else{
  1492.                             $jewel_part1_shape '11';
  1493.                         }
  1494.                         
  1495.                         $chain $this->necklaceRepository->CustomFindWithID($custom->getNecklaceBaseId())[0];
  1496.                         if($custom->getHikiwaId() != 0){
  1497.                             $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  1498.                             $temp['hikiwa'] = 'customRing/hikiwa/' $hikiwa->getHikiwaShape() . '/'$hikiwa->getHikiwaType() . '/'$hikiwa->getImageName();
  1499.                             $temp['hikiwa_name'] = $hikiwa->getHikiwaName();
  1500.                         }
  1501.                         else{
  1502.                             $rakuwa $this->rakuwaRepository->CustomFindWithID($custom->getRakuwaId())[0];
  1503.                             $temp['hikiwa'] = 'customRing/rakuwa/' $rakuwa->getRakuwaShape() . '/'$rakuwa->getRakuwaType() . '/'$rakuwa->getImageName();
  1504.                             $temp['hikiwa_name'] = $rakuwa->getRakuwaName();
  1505.                         }
  1506.                         $temp['output_image'] = 'customOutput/customNecklace/' $custom->getOutputImage();
  1507.                         $temp['pendant'] =null;
  1508.                         $temp['pendant_name'] = null;
  1509.                         $temp['base_path'] = 'customRing/necklace/'.$chain->getNecklaceShape() .'/'$chain->getNecklaceType() .'/list/'$chain->getImageName();
  1510.                         $temp['base_name'] = $chain->getNecklaceName();
  1511.                         $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  1512.                         $temp['jewel1_name'] = $jewel1->getName();
  1513.                         $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  1514.                         $temp['jewel_part1_name'] = $jewel_part1->getname();
  1515.                         
  1516.                         $temp['jewel2_path'] = null;
  1517.                         $temp['jewel2_name'] = null;
  1518.                         $temp['jewel_part2_path'] = null;
  1519.                         $temp['jewel_part2_name'] = null;
  1520.                         $temp['catchy'] = null;
  1521.                         $temp['catchy_name'] = null;
  1522.                         $temp['adjuster'] = null;
  1523.                         $temp['adjuster_name'] = null;
  1524.                         $temp['repair'] = $is_repair;
  1525.                         array_push($custom_images,$temp);
  1526.                         
  1527.                         break;
  1528.                     case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_EARRING):
  1529.                         $custom $this->customEarringRepository->CustomFindWithID($code)[0];
  1530.                         $earring $this->earringRepository->CustomFindWithID($custom->getEarringBaseId())[0];
  1531.                         $socket $earring->getSocket();
  1532.                         $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1533.                         $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1534.                         
  1535.                         if($jewel1->getJewelShape() == 'Only'){
  1536.                             $jewel_part1_shape 'only';
  1537.                         }
  1538.                         else{
  1539.                             $jewel_part1_shape '11';
  1540.                         }
  1541.                         if($socket == 2){
  1542.                             $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  1543.                             $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  1544.                             if($jewel2->getJewelShape() == 'Only'){
  1545.                                 $jewel_part2_shape 'only';
  1546.                             }
  1547.                             else{
  1548.                                 $jewel_part2_shape '11';
  1549.                             }
  1550.                         }
  1551.                         $custom $this->customEarringRepository->CustomFindWithID($custom)[0];
  1552.                         $earring $this->earringRepository->CustomFindWithID($custom->getEarringBaseId())[0];
  1553.                         $socket $earring->getSocket();
  1554.                         $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1555.                         $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1556.                         
  1557.                         if($jewel1->getJewelShape() == 'Only'){
  1558.                             $jewel_part1_shape 'only';
  1559.                         }
  1560.                         else{
  1561.                             $jewel_part1_shape '11';
  1562.                         }
  1563.                         if($socket == 2){
  1564.                             $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  1565.                             $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  1566.                             if($jewel2->getJewelShape() == 'Only'){
  1567.                                 $jewel_part2_shape 'only';
  1568.                             }
  1569.                             else{
  1570.                                 $jewel_part2_shape '11';
  1571.                             }
  1572.                         }
  1573.                         $temp['output_image'] = 'customOutput/customEarring/' $custom->getOutputImage();
  1574.                         $temp['pendant'] = null;
  1575.                         $temp['pendant_name'] = null;
  1576.                         $temp['base_path'] = 'customRing/earring/'.$earring->getEarringShape() .'/'$earring->getEarringType() .'/list/'$earring->getImageName();
  1577.                         $temp['base_name'] = $earring->getName();
  1578.                         $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  1579.                         $temp['jewel1_name'] = $jewel1->getName();
  1580.                         $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  1581.                         $temp['jewel_part1_name'] = $jewel_part1->getname();
  1582.                         if($socket == 2){
  1583.                             $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  1584.                             $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  1585.                             $temp['jewel2_name'] = $jewel2->getName();
  1586.                             $temp['jewel_part2_name'] = $jewel_part2->getname();
  1587.                         }
  1588.                         else{
  1589.                             $temp['jewel2_path'] = null;
  1590.                             $temp['jewel2_name'] = null;
  1591.                             $temp['jewel_part2_path'] = null;
  1592.                             $temp['jewel_part2_name'] = null;
  1593.                         }
  1594.                         $temp['catchy'] = null;
  1595.                         $temp['catchy_name'] = null;
  1596.                         $temp['hikiwa'] = null;
  1597.                         $temp['hikiwa_name'] = null;
  1598.                         $temp['adjuster'] = null;
  1599.                         $temp['adjuster_name'] = null;
  1600.                         $temp['repair'] = $is_repair;
  1601.                         array_push($custom_images,$temp);
  1602.                         break;
  1603.                     case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_BREATHED):
  1604.                         $custom $this->customBreathredRepository->CustomFindWithID($code)[0];
  1605.                         $breathred $this->breathredRepository->CustomFindWithID($custom->getBreathredBaseId())[0];
  1606.                         $socket $breathred->getSocket();
  1607.                         $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1608.                         $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1609.                         
  1610.                         if($jewel1->getJewelShape() == 'Only'){
  1611.                             $jewel_part1_shape 'only';
  1612.                         }
  1613.                         else{
  1614.                             $jewel_part1_shape '11';
  1615.                         }
  1616.                         if($socket == 2){
  1617.                             $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  1618.                             $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  1619.                             if($jewel2->getJewelShape() == 'Only'){
  1620.                                 $jewel_part2_shape 'only';
  1621.                             }
  1622.                             else{
  1623.                                 $jewel_part2_shape '11';
  1624.                             }
  1625.                         }
  1626.                         $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  1627.                         $adjuster =$this->adjusterRepository->CustomFindWithID($custom->getAdjusterId())[0];
  1628.                         $temp['output_image'] = 'customOutput/customBreathred/' $custom->getOutputImage();
  1629.                         $temp['pendant'] = null;
  1630.                         $temp['pendant_name'] = null;
  1631.                         $temp['base_path'] = 'customRing/breathred/'.$breathred->getBreathredShape() .'/'$breathred->getBreathredType() .'/list/'$breathred->getImageName();
  1632.                         $temp['base_name'] = $breathred->getName();
  1633.                         $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  1634.                         $temp['jewel1_name'] = $jewel1->getName();
  1635.                         $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  1636.                         $temp['jewel_part1_name'] = $jewel_part1->getname();
  1637.                         if($socket == 2){
  1638.                             $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  1639.                             $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  1640.                             $temp['jewel2_name'] = $jewel2->getName();
  1641.                             $temp['jewel_part2_name'] = $jewel_part2->getname();
  1642.                         }
  1643.                         else{
  1644.                             $temp['jewel2_path'] = null;
  1645.                             $temp['jewel2_name'] = null;
  1646.                             $temp['jewel_part2_path'] = null;
  1647.                             $temp['jewel_part2_name'] = null;
  1648.                         }
  1649.                         $temp['catchy'] = null;
  1650.                         $temp['catchy_name'] = null;
  1651.                         $temp['hikiwa'] = 'customRing/hikiwa/' $hikiwa->getHikiwaShape() . '/'$hikiwa->getHikiwaType() . '/'$hikiwa->getImageName();;
  1652.                         $temp['hikiwa_name'] = $hikiwa->getHikiwaName();
  1653.                         $temp['adjuster'] = 'customRing/adjuster/' $adjuster->getAdjusterShape() . '/' $adjuster->getAdjusterType() . '/' $adjuster->getImageName();
  1654.                         $temp['adjuster_name'] = $adjuster->getAdjusterName();
  1655.                         $temp['repair'] = $is_repair;
  1656.                         array_push($custom_images,$temp);
  1657.                         break;
  1658.                     
  1659.                     default:
  1660.                         $temp['output_image'] = $item->getProduct()->getProductImage()[0];
  1661.                         $temp['pendant'] =null;
  1662.                         $temp['pendant_name'] = null;
  1663.                         $temp['base_path'] = null;
  1664.                         $temp['base_name'] = null;
  1665.                         $temp['jewel1_path'] = null;
  1666.                         $temp['jewel1_name'] = null;
  1667.                         $temp['jewel_part1_path'] = null;
  1668.                         $temp['jewel_part1_name'] = null;
  1669.                         
  1670.                         $temp['jewel2_path'] = null;
  1671.                         $temp['jewel2_name'] = null;
  1672.                         $temp['jewel_part2_path'] = null;
  1673.                         $temp['jewel_part2_name'] = null;
  1674.                     
  1675.                         $temp['repair'] = $is_repair;
  1676.                         array_push($custom_images,$temp);
  1677.                         break;
  1678.                 }
  1679.             }
  1680.         }
  1681.            
  1682.         return [
  1683.             'Order' => $Order,
  1684.             'stockOrder' => $stockOrder,
  1685.             'order_item' => $custom_images
  1686.         ];
  1687.     }
  1688.     /**
  1689.      * 再購入を行う.
  1690.      *
  1691.      * @Route("/mypage/order/{order_no}", name="mypage_order", methods={"PUT"})
  1692.      */
  1693.     public function order(Request $request$order_no)
  1694.     {
  1695.         $this->isTokenValid();
  1696.         log_info('再注文開始', [$order_no]);
  1697.         $Customer $this->getUser();
  1698.         /* @var $Order \Eccube\Entity\Order */
  1699.         $Order $this->orderRepository->findOneBy(
  1700.             [
  1701.                 'order_no' => $order_no,
  1702.                 'Customer' => $Customer,
  1703.             ]
  1704.         );
  1705.         $event = new EventArgs(
  1706.             [
  1707.                 'Order' => $Order,
  1708.                 'Customer' => $Customer,
  1709.             ],
  1710.             $request
  1711.         );
  1712.         $this->eventDispatcher->dispatch(EccubeEvents::FRONT_MYPAGE_MYPAGE_ORDER_INITIALIZE$event);
  1713.         if (!$Order) {
  1714.             log_info('対象の注文が見つかりません', [$order_no]);
  1715.             throw new NotFoundHttpException();
  1716.         }
  1717.         // エラーメッセージの配列
  1718.         $errorMessages = [];
  1719.         foreach ($Order->getOrderItems() as $OrderItem) {
  1720.             try {
  1721.                 if ($OrderItem->getProduct() && $OrderItem->getProductClass()) {
  1722.                     $this->cartService->addProduct($OrderItem->getProductClass(), $OrderItem->getQuantity());
  1723.                     // 明細の正規化
  1724.                     $Carts $this->cartService->getCarts();
  1725.                     foreach ($Carts as $Cart) {
  1726.                         $result $this->purchaseFlow->validate($Cart, new PurchaseContext($Cart$this->getUser()));
  1727.                         // 復旧不可のエラーが発生した場合は追加した明細を削除.
  1728.                         if ($result->hasError()) {
  1729.                             $this->cartService->removeProduct($OrderItem->getProductClass());
  1730.                             foreach ($result->getErrors() as $error) {
  1731.                                 $errorMessages[] = $error->getMessage();
  1732.                             }
  1733.                         }
  1734.                         foreach ($result->getWarning() as $warning) {
  1735.                             $errorMessages[] = $warning->getMessage();
  1736.                         }
  1737.                     }
  1738.                     $this->cartService->save();
  1739.                 }
  1740.             } catch (CartException $e) {
  1741.                 log_info($e->getMessage(), [$order_no]);
  1742.                 $this->addRequestError($e->getMessage());
  1743.             }
  1744.         }
  1745.         foreach ($errorMessages as $errorMessage) {
  1746.             $this->addRequestError($errorMessage);
  1747.         }
  1748.         $event = new EventArgs(
  1749.             [
  1750.                 'Order' => $Order,
  1751.                 'Customer' => $Customer,
  1752.             ],
  1753.             $request
  1754.         );
  1755.         $this->eventDispatcher->dispatch(EccubeEvents::FRONT_MYPAGE_MYPAGE_ORDER_COMPLETE$event);
  1756.         if ($event->getResponse() !== null) {
  1757.             return $event->getResponse();
  1758.         }
  1759.         log_info('再注文完了', [$order_no]);
  1760.         return $this->redirect($this->generateUrl('cart'));
  1761.     }
  1762.     /**
  1763.      * お気に入り商品を表示する.
  1764.      *
  1765.      * @Route("/mypage/favorite", name="mypage_favorite", methods={"GET"})
  1766.      * @Template("Mypage/favorite.twig")
  1767.      */
  1768.     public function favorite(Request $requestPaginatorInterface $paginator)
  1769.     {
  1770.         if (!$this->BaseInfo->isOptionFavoriteProduct()) {
  1771.             throw new NotFoundHttpException();
  1772.         }
  1773.         $Customer $this->getUser();
  1774.         // paginator
  1775.         $qb $this->customerFavoriteProductRepository->getQueryBuilderByCustomer($Customer);
  1776.         $event = new EventArgs(
  1777.             [
  1778.                 'qb' => $qb,
  1779.                 'Customer' => $Customer,
  1780.             ],
  1781.             $request
  1782.         );
  1783.         $this->eventDispatcher->dispatch(EccubeEvents::FRONT_MYPAGE_MYPAGE_FAVORITE_SEARCH$event);
  1784.         $pagination $paginator->paginate(
  1785.             $qb,
  1786.             $request->get('pageno'1),
  1787.             $this->eccubeConfig['eccube_search_pmax'],
  1788.             ['wrap-queries' => true]
  1789.         );
  1790.         return [
  1791.             'pagination' => $pagination,
  1792.         ];
  1793.     }
  1794.     /**
  1795.      * お気に入り商品を削除する.
  1796.      *
  1797.      * @Route("/mypage/favorite/{id}/delete", name="mypage_favorite_delete", methods={"DELETE"}, requirements={"id" = "\d+"})
  1798.      */
  1799.     public function delete(Request $requestProduct $Product)
  1800.     {
  1801.         $this->isTokenValid();
  1802.         $Customer $this->getUser();
  1803.         log_info('お気に入り商品削除開始', [$Customer->getId(), $Product->getId()]);
  1804.         $CustomerFavoriteProduct $this->customerFavoriteProductRepository->findOneBy(['Customer' => $Customer'Product' => $Product]);
  1805.         if ($CustomerFavoriteProduct) {
  1806.             $this->customerFavoriteProductRepository->delete($CustomerFavoriteProduct);
  1807.         } else {
  1808.             throw new BadRequestHttpException();
  1809.         }
  1810.         $event = new EventArgs(
  1811.             [
  1812.                 'Customer' => $Customer,
  1813.                 'CustomerFavoriteProduct' => $CustomerFavoriteProduct,
  1814.             ], $request
  1815.         );
  1816.         $this->eventDispatcher->dispatch(EccubeEvents::FRONT_MYPAGE_MYPAGE_DELETE_COMPLETE$event);
  1817.         log_info('お気に入り商品削除完了', [$Customer->getId(), $CustomerFavoriteProduct->getId()]);
  1818.         return $this->redirect($this->generateUrl('mypage_favorite'));
  1819.     }
  1820.     /**
  1821.      * 
  1822.      *
  1823.      * @Route("/mypage/start_customize", name="start_customize", methods={"POST"})
  1824.      */
  1825.     public function customize(Request $request)
  1826.     {
  1827.         if ($request->isXmlHttpRequest()) {
  1828.             $doct $this->getDoctrine()->getManager();
  1829.    
  1830.             $product_id intval($request->request->get('product_id'));
  1831.             $custom_id intval($request->request->get('product_code'));  
  1832.             $product $this->customProductRepository->customProductFind($product_id)[0];
  1833.             $product_name $product->getName();
  1834.             
  1835.             switch($product_name){
  1836.                 case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_RING):
  1837.                     $custom $this->customRingRepository->CustomFindWithID($custom_id)[0];
  1838.                     $ring $this->ringRepository->CustomFindWithID($custom->getRingBaseId())[0];
  1839.                     $socket $ring->getSocket();
  1840.                     $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1841.                     $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1842.                     if($jewel1->getJewelShape() == 'Only'){
  1843.                         $jewel_part1_shape 'only';
  1844.                     }
  1845.                     else{
  1846.                         $jewel_part1_shape '11';
  1847.                     }
  1848.                     if($socket == 2){
  1849.                         $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  1850.                         $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  1851.     
  1852.                         if($jewel2->getJewelShape() == 'Only'){
  1853.                             $jewel_part2_shape 'only';
  1854.                         }
  1855.                         else{
  1856.                             $jewel_part2_shape '11';
  1857.                         }
  1858.                     }
  1859.                     $t $custom->getEmpty();
  1860.                     if($t){
  1861.                         $t unserialize($t);
  1862.                         $temp['empty'] = $t;
  1863.                     }else{
  1864.                         $temp['empty'] = null;
  1865.                     }
  1866.                     
  1867.                     $temp['output_image'] = 'customOutput/customRing/' $custom->getOutputImage();
  1868.                     $temp['pendant'] = null;
  1869.                     $temp['pendant_name'] = null;
  1870.                     $temp['base_path'] = 'customRing/ring/'.$ring->getRingShape() .'/'$ring->getRingType() .'/'$ring->getImageName();
  1871.                     $temp['base_name'] = $ring->getName();
  1872.                     $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  1873.                     $temp['jewel1_name'] = $jewel1->getName();
  1874.                     $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  1875.                     $temp['jewel_part1_name'] = $jewel_part1->getname();
  1876.                     if($socket == 2){
  1877.                         $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  1878.                         $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  1879.                         $temp['jewel2_name'] = $jewel2->getName();
  1880.                         $temp['jewel_part2_name'] = $jewel_part2->getname();
  1881.                         $temp['jewel2_id'] = $jewel2->getId();
  1882.                         $temp['jewel_part2_id'] = $jewel_part2->getId();
  1883.                     }
  1884.                     else{
  1885.                         $temp['jewel2_path'] = null;
  1886.                         $temp['jewel2_name'] = null;
  1887.                         $temp['jewel_part2_path'] = null;
  1888.                         $temp['jewel_part2_name'] = null;
  1889.                         $temp['jewel2_id'] = null;
  1890.                         $temp['jewel_part2_id'] = null;
  1891.                     }
  1892.                     $temp['size'] = $ring->getSize();
  1893.                     $temp['catchy'] = null;
  1894.                     $temp['catchy_name'] = null;
  1895.                     $temp['hikiwa'] = null;
  1896.                     $temp['hikiwa_name'] = null;
  1897.                     $temp['adjuster'] = null;
  1898.                     $temp['adjuster_name'] = null;
  1899.                     $temp['pendant_id'] = null;
  1900.                     $temp['base_id'] = $ring->getId();
  1901.                     $temp['base_type'] = 'ring';
  1902.                     $temp['jewel1_id'] = $jewel1->getId();
  1903.                     $temp['jewel_part1_id'] = $jewel_part1->getId();
  1904.                     $temp['product_name'] = $product_name;
  1905.                     $temp['custom_id'] = $custom_id;
  1906.                     break;
  1907.                 case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_PIERCE):
  1908.                     $custom $this->customPierceRepository->CustomFindWithID($custom_id)[0];
  1909.                     $pierce $this->pierceRepository->CustomFindWithID($custom->getPierceBaseId())[0];
  1910.                     $socket $pierce->getSocket();
  1911.                     $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1912.                     $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1913.                     
  1914.                     if($jewel1->getJewelShape() == 'Only'){
  1915.                         $jewel_part1_shape 'only';
  1916.                     }
  1917.                     else{
  1918.                         $jewel_part1_shape '11';
  1919.                     }
  1920.                     if($socket == 2){
  1921.                         $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  1922.                         $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  1923.     
  1924.                         if($jewel2->getJewelShape() == 'Only'){
  1925.                             $jewel_part2_shape 'only';
  1926.                         }
  1927.                         else{
  1928.                             $jewel_part2_shape '11';
  1929.                         }
  1930.                     }
  1931.                     $t $custom->getEmpty();
  1932.                     if($t){
  1933.                         $t unserialize($t);
  1934.                         $temp['empty'] = $t;
  1935.                     }else{
  1936.                         $temp['empty'] = null;
  1937.                     }
  1938.                     $catchy $this->catchyRepository->CustomFindWithID($custom->getCatchyId())[0];
  1939.     
  1940.                     $temp['output_image'] = 'customOutput/customPierce/' $custom->getOutputImage();
  1941.                     $temp['pendant'] = null;
  1942.                     $temp['pendant_name'] = null;
  1943.                     $temp['base_path'] = 'customRing/pierce/'.$pierce->getPierceShape() .'/'$pierce->getPierceType() .'/'$pierce->getImageName();
  1944.                     $temp['base_name'] = $pierce->getName();
  1945.                     $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  1946.                     $temp['jewel1_name'] = $jewel1->getName();
  1947.                     $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  1948.                     $temp['jewel_part1_name'] = $jewel_part1->getname();
  1949.                     if($socket == 2){
  1950.                         $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  1951.                         $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  1952.                         $temp['jewel2_name'] = $jewel2->getName();
  1953.                         $temp['jewel_part2_name'] = $jewel_part2->getname();
  1954.                         $temp['jewel2_id'] = $jewel2->getId();
  1955.                         $temp['jewel_part2_id'] = $jewel_part2->getId();
  1956.                     }
  1957.                     else{
  1958.                         $temp['jewel2_path'] = null;
  1959.                         $temp['jewel2_name'] = null;
  1960.                         $temp['jewel_part2_path'] = null;
  1961.                         $temp['jewel_part2_name'] = null;
  1962.                         $temp['jewel2_id'] = null;
  1963.                         $temp['jewel_part2_id'] = null;
  1964.                     }
  1965.                    
  1966.                     $temp['size'] = null;
  1967.                     $temp['catchy'] = 'customRing/catchy/'.$catchy->getImageName();
  1968.                     $temp['catchy_name'] = $catchy->getName();
  1969.                     
  1970.                     $temp['hikiwa'] = null;
  1971.                     $temp['hikiwa_name'] = null;
  1972.                     $temp['adjuster'] = null;
  1973.                     $temp['adjuster_name'] = null;
  1974.                     $temp['pendant_id'] = null;
  1975.                     $temp['base_id'] = $pierce->getId();
  1976.                     $temp['base_type'] = 'pierce';
  1977.                     $temp['jewel1_id'] = $jewel1->getId();
  1978.                     $temp['jewel_part1_id'] = $jewel_part1->getId();
  1979.                     $temp['product_name'] = $product_name;
  1980.                     $temp['custom_id'] = $custom_id;
  1981.                     break;
  1982.                 case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_BROOCH):
  1983.                     $custom $this->customBroochRepository->CustomFindWithID($custom_id)[0];
  1984.                     
  1985.                     $brooch $this->broochRepository->CustomFindWithID($custom->getBroochBaseId())[0];
  1986.                     $socket $brooch->getSocket();
  1987.                     $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  1988.                     
  1989.                     $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  1990.                     if($jewel1->getJewelShape() == 'Only'){
  1991.                         $jewel_part1_shape 'only';
  1992.                     }
  1993.                     else{
  1994.                         $jewel_part1_shape '11';
  1995.                     }
  1996.                     $t $custom->getEmpty();
  1997.                     if($t){
  1998.                         $t unserialize($t);
  1999.                         $temp['empty'] = $t;
  2000.                     }else{
  2001.                         $temp['empty'] = null;
  2002.                     }
  2003.                     $temp['output_image'] = 'customOutput/customBrooch/' $custom->getOutputImage();
  2004.                     $temp['pendant'] = null;
  2005.                     $temp['pendant_name'] = null;
  2006.                     $temp['base_path'] = 'customRing/brooch/'.$brooch->getBroochShape() .'/'$brooch->getBroochType() .'/list/'$brooch->getImageName();
  2007.                     $temp['base_name'] = $brooch->getName();
  2008.                     $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  2009.                     $temp['jewel1_name'] = $jewel1->getName();
  2010.                     $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  2011.                     $temp['jewel_part1_name'] = $jewel_part1->getname();
  2012.                     
  2013.                     $temp['jewel2_path'] = null;
  2014.                     $temp['jewel2_name'] = null;
  2015.                     $temp['jewel_part2_path'] = null;
  2016.                     $temp['jewel_part2_name'] = null;
  2017.                     $temp['jewel2_id'] = null;
  2018.                     $temp['jewel_part2_id'] = null;
  2019.                     $temp['size'] = null;
  2020.                     $temp['catchy'] = null;
  2021.                     $temp['catchy_name'] = null;
  2022.                     $temp['hikiwa'] = null;
  2023.                     $temp['hikiwa_name'] = null;
  2024.                     $temp['adjuster'] = null;
  2025.                     $temp['adjuster_name'] = null;
  2026.                     $temp['pendant_id'] = null;
  2027.                     $temp['base_id'] = $brooch->getId();
  2028.                     $temp['base_type'] = 'brooch';
  2029.                     $temp['jewel1_id'] = $jewel1->getId();
  2030.                     $temp['jewel_part1_id'] = $jewel_part1->getId();
  2031.                     $temp['product_name'] = $product_name;
  2032.                     $temp['custom_id'] = $custom_id;
  2033.                     break;
  2034.                 case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_SHIPPORING):
  2035.                     $custom $this->customShippoRingRepository->CustomFindWithID($custom_id)[0];
  2036.                     $shippoRing $this->shippoRingRepository->CustomFindWithID($custom->getRingBaseId())[0];
  2037.                     
  2038.                     $temp['output_image'] = 'customOutput/ShippoRing/' $custom->getOutputImage();
  2039.                     $temp['pendant'] = null;
  2040.                     $temp['pendant_name'] = null;
  2041.                     $temp['base_path'] = 'customRing/shippoRing/'.$shippoRing->getShippoRingShape() .'/'$shippoRing->getShippoRingType() .'/'$shippoRing->getShippoRingColor() .'/' $shippoRing->getImageName();
  2042.                     $temp['base_name'] = $shippoRing->getShippoRingName();
  2043.                     $temp['jewel1_path'] = null;
  2044.                     $temp['jewel1_name'] = null;
  2045.                     $temp['jewel_part1_path'] = null;
  2046.                     $temp['jewel_part1_name'] = null;
  2047.                     $temp['jewel2_id'] = null;
  2048.                     $temp['jewel_part2_id'] = null;
  2049.                     $temp['jewel2_path'] = null;
  2050.                     $temp['jewel2_name'] = null;
  2051.                     $temp['jewel_part2_path'] = null;
  2052.                     $temp['jewel_part2_name'] = null;
  2053.                 
  2054.                     $temp['size'] = null;
  2055.                     $temp['catchy'] = null;
  2056.                     $temp['catchy_name'] = null;
  2057.                     
  2058.                     $temp['hikiwa'] = null;
  2059.                     $temp['hikiwa_name'] = null;
  2060.                     $temp['adjuster'] = null;
  2061.                     $temp['adjuster_name'] = null;
  2062.                     $temp['pendant_id'] = null;
  2063.                     $temp['base_id'] = $shippoRing->getId();
  2064.                     $temp['base_type'] = 'shippoRing';
  2065.                     $temp['jewel1_id'] =null;
  2066.                     $temp['jewel_part1_id'] = null;
  2067.                     $temp['product_name'] = $product_name;
  2068.                     $temp['custom_id'] = $custom_id;
  2069.                     break;
  2070.                 case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_PENDANT):
  2071.                     $custom $this->customPendantRepository->CustomFindWithID($custom_id)[0];
  2072.                     
  2073.                     $pendant $this->pendantRepository->CustomFindWithID($custom->getPendantBaseId())[0];
  2074.                     $socket $pendant->getSocket();
  2075.                     $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  2076.                     $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  2077.                     if($jewel1->getJewelShape() == 'Only'){
  2078.                         $jewel_part1_shape 'only';
  2079.                     }
  2080.                     else{
  2081.                         $jewel_part1_shape '11';
  2082.                     }
  2083.                     $t $custom->getEmpty();
  2084.                     if($t){
  2085.                         $t unserialize($t);
  2086.                         $temp['empty'] = $t;
  2087.                     }else{
  2088.                         $temp['empty'] = null;
  2089.                     }
  2090.                     $adjuster =$this->adjusterRepository->CustomFindWithID($custom->getAdjusterId())[0];
  2091.                     $chain $this->necklaceRepository->CustomFindWithID($custom->getPendantChainId())[0];
  2092.                     if($custom->getHikiwaId() != 0){
  2093.                         $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  2094.                     }else{
  2095.                         $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getRakuwaId())[0];
  2096.                     }
  2097.                         
  2098.                     $temp['output_image'] = 'customOutput/customPendant/' $custom->getOutputImage();
  2099.                     $temp['pendant'] = 'customRing/pendant/'.$pendant->getPendantShape() .'/'$pendant->getPendantType() .'/list/'$pendant->getImageName();
  2100.                     $temp['pendant_name'] = null;
  2101.                     $temp['base_path'] = 'customRing/necklace/'.$chain->getNecklaceShape() .'/'$chain->getNecklaceType() .'/list/'$chain->getImageName();
  2102.                     $temp['base_name'] = $chain->getNecklaceName();
  2103.                     $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  2104.                     $temp['jewel1_name'] = $jewel1->getName();
  2105.                     $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  2106.                     $temp['jewel_part1_name'] = $jewel_part1->getname();
  2107.                     
  2108.                     $temp['jewel2_path'] = null;
  2109.                     $temp['jewel2_name'] = null;
  2110.                     $temp['jewel_part2_path'] = null;
  2111.                     $temp['jewel_part2_name'] = null;
  2112.                     $temp['jewel2_id'] = null;
  2113.                     $temp['jewel_part2_id'] = null;
  2114.                     $temp['size'] = null;
  2115.                     $temp['catchy'] = null;
  2116.                     $temp['catchy_name'] = null;
  2117.                     $temp['hikiwa'] = 'customRing/hikiwa/' $hikiwa->getHikiwaShape() . '/'$hikiwa->getHikiwaType() . '/'$hikiwa->getImageName();
  2118.                     $temp['hikiwa_name'] = $hikiwa->getHikiwaName();
  2119.                     $temp['adjuster'] = 'customRing/adjuster/' $adjuster->getAdjusterShape() . '/' $adjuster->getAdjusterType() . '/' $adjuster->getImageName();
  2120.                     $temp['adjuster_name'] = $adjuster->getAdjusterName();
  2121.                     $temp['pendant_id'] = $pendant->getId();
  2122.                     $temp['base_id'] = $chain->getId();
  2123.                     $temp['base_type'] = 'necklace';
  2124.                     $temp['jewel1_id'] = $jewel1->getId();
  2125.                     $temp['jewel_part1_id'] = $jewel_part1->getId();
  2126.                     $temp['product_name'] = $product_name;
  2127.                     $temp['custom_id'] = $custom_id;
  2128.                     break;
  2129.                 case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_NECKLACE):
  2130.                     $custom $this->customNecklaceRepository->CustomFindWithID($custom_id)[0];
  2131.                     
  2132.                     $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  2133.                     $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  2134.                     if($jewel1->getJewelShape() == 'Only'){
  2135.                         $jewel_part1_shape 'only';
  2136.                     }
  2137.                     else{
  2138.                         $jewel_part1_shape '11';
  2139.                     }
  2140.                     $t $custom->getEmpty();
  2141.                     if($t){
  2142.                         $t unserialize($t);
  2143.                         $temp['empty'] = $t;
  2144.                     }else{
  2145.                         $temp['empty'] = null;
  2146.                     }
  2147.                     $chain $this->necklaceRepository->CustomFindWithID($custom->getNecklaceBaseId())[0];
  2148.                     
  2149.                     if($custom->getHikiwaId() != 0){
  2150.                         $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  2151.                     }else{
  2152.                         $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getRakuwaId())[0];
  2153.                     }
  2154.                     $temp['output_image'] = 'customOutput/customNecklace/' $custom->getOutputImage();
  2155.                     $temp['pendant'] =null;
  2156.                     $temp['pendant_name'] = null;
  2157.                     $temp['base_path'] = 'customRing/necklace/'.$chain->getNecklaceShape() .'/'$chain->getNecklaceType() .'/list/'$chain->getImageName();
  2158.                     $temp['base_name'] = $chain->getNecklaceName();
  2159.                     $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  2160.                     $temp['jewel1_name'] = $jewel1->getName();
  2161.                     $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  2162.                     $temp['jewel_part1_name'] = $jewel_part1->getname();
  2163.                     
  2164.                     $temp['jewel2_path'] = null;
  2165.                     $temp['jewel2_name'] = null;
  2166.                     $temp['jewel_part2_path'] = null;
  2167.                     $temp['jewel_part2_name'] = null;
  2168.                     $temp['jewel2_id'] = null;
  2169.                     $temp['jewel_part2_id'] = null;
  2170.                     $temp['size'] = null;
  2171.                     $temp['catchy'] = null;
  2172.                     $temp['catchy_name'] = null;
  2173.                     $temp['hikiwa'] = 'customRing/hikiwa/' $hikiwa->getHikiwaShape() . '/'$hikiwa->getHikiwaType() . '/'$hikiwa->getImageName();
  2174.                     $temp['hikiwa_name'] = $hikiwa->getHikiwaName();
  2175.                     $temp['adjuster'] = null;
  2176.                     $temp['adjuster_name'] = null;
  2177.                     
  2178.                     $temp['pendant_id'] = null;
  2179.                     $temp['base_id'] = $chain->getId();
  2180.                     $temp['base_type'] = 'necklace';
  2181.                     $temp['jewel1_id'] = $jewel1->getId();
  2182.                     $temp['jewel_part1_id'] = $jewel_part1->getId();
  2183.                     $temp['product_name'] = $product_name;
  2184.                     $temp['custom_id'] = $custom_id;
  2185.                     break;
  2186.                 case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_EARRING):
  2187.                     
  2188.                     $custom $this->customEarringRepository->CustomFindWithID($custom_id)[0];
  2189.                     $earring $this->earringRepository->CustomFindWithID($custom->getEarringBaseId())[0];
  2190.                     $socket $earring->getSocket();
  2191.                     $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  2192.                     $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  2193.                     
  2194.                     if($jewel1->getJewelShape() == 'Only'){
  2195.                         $jewel_part1_shape 'only';
  2196.                     }
  2197.                     else{
  2198.                         $jewel_part1_shape '11';
  2199.                     }
  2200.                     if($socket == 2){
  2201.                         $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  2202.                         $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  2203.                         if($jewel2->getJewelShape() == 'Only'){
  2204.                             $jewel_part2_shape 'only';
  2205.                         }
  2206.                         else{
  2207.                             $jewel_part2_shape '11';
  2208.                         }
  2209.                     }
  2210.                     $t $custom->getEmpty();
  2211.                     if($t){
  2212.                         $t unserialize($t);
  2213.                         $temp['empty'] = $t;
  2214.                     }else{
  2215.                         $temp['empty'] = null;
  2216.                     }
  2217.                     $temp['output_image'] = 'customOutput/customEarring/' $custom->getOutputImage();
  2218.                     $temp['pendant'] = null;
  2219.                     $temp['pendant_name'] = null;
  2220.                     $temp['base_path'] = 'customRing/earring/'.$earring->getEarringShape() .'/'$earring->getEarringType() .'/list/'$earring->getImageName();
  2221.                     $temp['base_name'] = $earring->getName();
  2222.                     $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  2223.                     $temp['jewel1_name'] = $jewel1->getName();
  2224.                     $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  2225.                     $temp['jewel_part1_name'] = $jewel_part1->getname();
  2226.                     if($socket == 2){
  2227.                         $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  2228.                         $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  2229.                         $temp['jewel2_name'] = $jewel2->getName();
  2230.                         $temp['jewel_part2_name'] = $jewel_part2->getname();
  2231.                         $temp['jewel2_id'] = $jewel2->getId();
  2232.                         $temp['jewel_part2_id'] = $jewel_part2->getId();
  2233.                     }
  2234.                     else{
  2235.                         $temp['jewel2_path'] = null;
  2236.                         $temp['jewel2_name'] = null;
  2237.                         $temp['jewel_part2_path'] = null;
  2238.                         $temp['jewel_part2_name'] = null;
  2239.                         $temp['jewel2_id'] = null;
  2240.                         $temp['jewel_part2_id'] = null;
  2241.                     }
  2242.                     
  2243.                     $temp['size'] = null;
  2244.                     $temp['catchy'] = null;
  2245.                     $temp['catchy_name'] = null;
  2246.                     $temp['hikiwa'] = null;
  2247.                     $temp['hikiwa_name'] = null;
  2248.                     $temp['adjuster'] = null;
  2249.                     $temp['adjuster_name'] = null;
  2250.                     $temp['pendant_id'] = null;
  2251.                     $temp['base_id'] = $earring->getId();
  2252.                     $temp['base_type'] = 'earring';
  2253.                     $temp['jewel1_id'] = $jewel1->getId();
  2254.                     $temp['jewel_part1_id'] = $jewel_part1->getId();
  2255.                     $temp['product_name'] = $product_name;
  2256.                     $temp['custom_id'] = $custom_id;
  2257.                     break;
  2258.                 case $product_name == trans(CustomizeEvents::ADMIN_PRODUCT_CUSTOM_BREATHED):
  2259.                     $custom $this->customBreathredRepository->CustomFindWithID($custom_id)[0];
  2260.                     $breathred $this->breathredRepository->CustomFindWithID($custom->getBreathredBaseId())[0];
  2261.                     $socket $breathred->getSocket();
  2262.                     $jewel1 $this->jewelRepository->CustomFindWithID($custom->getJewelId())[0];
  2263.                     $jewel_part1 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId())[0];
  2264.                     
  2265.                     if($jewel1->getJewelShape() == 'Only'){
  2266.                         $jewel_part1_shape 'only';
  2267.                     }
  2268.                     else{
  2269.                         $jewel_part1_shape '11';
  2270.                     }
  2271.                     if($socket == 2){
  2272.                         $jewel2 $this->jewelRepository->CustomFindWithID($custom->getJewelId2())[0];
  2273.                         $jewel_part2 $this->jewelPartRepository->CustomFindWithID($custom->getJewelPartId2())[0];
  2274.                         if($jewel2->getJewelShape() == 'Only'){
  2275.                             $jewel_part2_shape 'only';
  2276.                         }
  2277.                         else{
  2278.                             $jewel_part2_shape '11';
  2279.                         }
  2280.                     }
  2281.                     if($custom->getHikiwaId() != 0){
  2282.                         $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getHikiwaId())[0];
  2283.                     }else{
  2284.                         $hikiwa $this->hikiwaRepository->CustomFindWithID($custom->getRakuwaId())[0];
  2285.                     }
  2286.                     $adjuster =$this->adjusterRepository->CustomFindWithID($custom->getAdjusterId())[0];
  2287.                     $t $custom->getEmpty();
  2288.                     if($t){
  2289.                         $t unserialize($t);
  2290.                         $temp['empty'] = $t;
  2291.                     }else{
  2292.                         $temp['empty'] = null;
  2293.                     }
  2294.                     $temp['output_image'] = 'customOutput/customBreathred/' $custom->getOutputImage();
  2295.                     $temp['pendant'] = null;
  2296.                     $temp['pendant_name'] = null;
  2297.                     $temp['base_path'] = 'customRing/breathred/'.$breathred->getBreathredShape() .'/'$breathred->getBreathredType() .'/list/'$breathred->getImageName();
  2298.                     $temp['base_name'] = $breathred->getName();
  2299.                     $temp['jewel1_path'] = 'customRing/jewel/list/'.$jewel1->getImageName();
  2300.                     $temp['jewel1_name'] = $jewel1->getName();
  2301.                     $temp['jewel_part1_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part1_shape.'/'.$jewel_part1->getImageName();
  2302.                     $temp['jewel_part1_name'] = $jewel_part1->getname();
  2303.                     if($socket == 2){
  2304.                         $temp['jewel2_path'] = 'customRing/jewel/list/'.$jewel2->getImageName();
  2305.                         $temp['jewel_part2_path'] = 'customRing/jewel/jewelPart/list/'.$jewel_part2_shape.'/'.$jewel_part2->getImageName();
  2306.                         $temp['jewel2_name'] = $jewel2->getName();
  2307.                         $temp['jewel_part2_name'] = $jewel_part2->getname();
  2308.                         $temp['jewel2_id'] = $jewel2->getId();
  2309.                         $temp['jewel_part2_id'] = $jewel_part2->getId();
  2310.                     }
  2311.                     else{
  2312.                         $temp['jewel2_path'] = null;
  2313.                         $temp['jewel2_name'] = null;
  2314.                         $temp['jewel_part2_path'] = null;
  2315.                         $temp['jewel_part2_name'] = null;
  2316.                         $temp['jewel2_id'] = null;
  2317.                         $temp['jewel_part2_id'] = null;
  2318.                     }
  2319.                     
  2320.                     $temp['size'] = null;
  2321.                     $temp['catchy'] = null;
  2322.                     $temp['catchy_name'] = null;
  2323.                     $temp['hikiwa'] = 'customRing/hikiwa/' $hikiwa->getHikiwaShape() . '/'$hikiwa->getHikiwaType() . '/'$hikiwa->getImageName();;
  2324.                     $temp['hikiwa_name'] = $hikiwa->getHikiwaName();
  2325.                     $temp['adjuster'] = 'customRing/adjuster/' $adjuster->getAdjusterShape() . '/' $adjuster->getAdjusterType() . '/' $adjuster->getImageName();
  2326.                     $temp['adjuster_name'] = $adjuster->getAdjusterName();
  2327.                     
  2328.                     $temp['pendant_id'] = null;
  2329.                     $temp['base_id'] = $breathred->getId();
  2330.                     $temp['base_type'] = 'breathred';
  2331.                     $temp['jewel1_id'] = $jewel1->getId();
  2332.                     $temp['jewel_part1_id'] = $jewel_part1->getId();
  2333.                     $temp['product_name'] = $product_name;
  2334.                     $temp['custom_id'] = $custom_id;
  2335.                     break;
  2336.                 
  2337.                 default:
  2338.                     $product_class $this->productClassRepository->FindWithID($product_class_id);
  2339.                     $product_class $product_class[0];
  2340.                     if($product_class->getClassCategory1() != null){
  2341.                         $class_id $product_class->getClassCategory1()->getId();
  2342.                         $class $this->classCategoryRepository->FindWithID($class_id);
  2343.                         $class $class[0];
  2344.                         $ring_size 0.5;
  2345.                         try{
  2346.                             $ring_size floatval($class->getBackendName());
  2347.                         } catch( Exception $ex ){
  2348.                             
  2349.                         }
  2350.                     }
  2351.                     else{
  2352.                         $ring_size 0.5;
  2353.                     }
  2354.                     $temp['output_image'] = $product->getProductImage()[0];
  2355.                     $temp['pendant'] = null;
  2356.                     $temp['pendant_name'] = null;
  2357.                     $temp['base_path'] = null;
  2358.                     $temp['base_name'] = $product->getName();
  2359.                     $temp['jewel1_path'] = null;
  2360.                     $temp['jewel1_name'] = null;
  2361.                     $temp['jewel_part1_path'] = null;
  2362.                     $temp['jewel_part1_name'] = null;
  2363.                     $temp['jewel2_path'] = null;
  2364.                     $temp['jewel2_name'] = null;
  2365.                     $temp['jewel_part2_path'] = null;
  2366.                     $temp['jewel_part2_name'] = null;
  2367.                     $temp['size'] = $ring_size;
  2368.                     $temp['catchy'] = null;
  2369.                     $temp['catchy_name'] = null;
  2370.                     $temp['hikiwa'] = null;
  2371.                     $temp['hikiwa_name'] = null;
  2372.                     $temp['adjuster'] = null;
  2373.                     $temp['adjuster_name'] = null;
  2374.                     $temp['product_name'] = $product_name;
  2375.                     $temp['custom_id'] = $custom_id;
  2376.                     break;
  2377.                 
  2378.             }
  2379.     
  2380.             return new JsonResponse(array('status' => 'done''custom' => $temp ),200);
  2381.    
  2382.             #$session->set('jewel_rotation', $rotation);
  2383.    
  2384.    
  2385.             #return new JsonResponse(array('status' => 'done'), 200);
  2386.          }
  2387.          return new JsonResponse(array('status' => 'Error'), 400);
  2388.     }
  2389.     /**
  2390.      * 
  2391.      *
  2392.      * @Route("/mypage/customize_selected", name="customize_selected", methods={"POST"})
  2393.      */
  2394.     public function customizeSelected(Request $request)
  2395.     {
  2396.         if ($request->isXmlHttpRequest()) {
  2397.             $session $request->getSession();
  2398.             $customize_id =  $request->request->get('customize_part_id');
  2399.             $customize_type $request->request->get('customize_part_type');
  2400.             $customize_product_name =  $request->request->get('customize_product_name');
  2401.             $customize_custom_id $request->request->get('customize_custom_id');
  2402.             $customize_jewel $request->request->get('customize_jewel');
  2403.             $session->set('customize_part_id'$customize_id);
  2404.             $session->set('customize_part_type'$customize_type);
  2405.             $session->set('customize_product_name'$customize_product_name);
  2406.             $session->set('customize_custom_id'$customize_custom_id);
  2407.             $session->set('customize_jewel'$customize_jewel);
  2408.             
  2409.             return new JsonResponse(array('status' => 'done'),200);
  2410.    
  2411.    
  2412.    
  2413.             #return new JsonResponse(array('status' => 'done'), 200);
  2414.         }
  2415.         return new JsonResponse(array('status' => 'Error'), 400);
  2416.     }
  2417. }