Get Pref
public getPref ( ) : Eccube\Entity\Master\Pref | ||
리턴 | Eccube\Entity\Master\Pref |
/** * 受注再編集用フォーム作成. * * @param Order $Order * @return array */ public function createFormDataForEdit(Order $Order) { //受注アイテム $orderDetail = array(); $OrderDetailColl = $Order->getOrderDetails(); foreach ($OrderDetailColl as $OrderDetail) { $orderDetail[] = array('Product' => $OrderDetail->getProduct()->getId(), 'ProductClass' => $OrderDetail->getProductClass()->getId(), 'price' => $OrderDetail->getPrice(), 'quantity' => $OrderDetail->getQuantity(), 'tax_rate' => $OrderDetail->getTaxRate(), 'tax_rule' => $OrderDetail->getTaxRule()); } //受注お届け $shippings = array(); $ShippingsColl = $Order->getShippings(); foreach ($ShippingsColl as $Shippings) { $deliveryTime = ''; if (is_object($Shippings->getDeliveryTime())) { $deliveryTime = $Shippings->getDeliveryTime()->getId(); } $shippingDeliveryDate = array('year' => null, 'month' => null, 'day' => null); if ($Shippings->getShippingDeliveryDate() instanceof \DateTime) { $shippingDeliveryDate['year'] = $Shippings->getShippingDeliveryDate()->format('Y'); $shippingDeliveryDate['month'] = $Shippings->getShippingDeliveryDate()->format('m'); $shippingDeliveryDate['day'] = $Shippings->getShippingDeliveryDate()->format('d'); } $shippings[] = array('name' => array('name01' => $Shippings->getName01(), 'name02' => $Shippings->getName02()), 'kana' => array('kana01' => $Shippings->getKana01(), 'kana02' => $Shippings->getKana02()), 'company_name' => $Shippings->getCompanyName(), 'zip' => array('zip01' => $Shippings->getZip01(), 'zip02' => $Shippings->getZip02()), 'address' => array('pref' => $Shippings->getPref()->getId(), 'addr01' => $Shippings->getAddr01(), 'addr02' => $Shippings->getAddr02()), 'tel' => array('tel01' => $Shippings->getTel01(), 'tel02' => $Shippings->getTel02(), 'tel03' => $Shippings->getTel03()), 'fax' => array('fax01' => $Shippings->getFax01(), 'fax02' => $Shippings->getFax02(), 'fax03' => $Shippings->getFax03()), 'Delivery' => $Shippings->getDelivery()->getId(), 'DeliveryTime' => $deliveryTime, 'shipping_delivery_date' => $shippingDeliveryDate); } $Customer = $Order->getCustomer(); $customer_id = null; if (is_object($Customer)) { $customer_id = $Customer->getId(); } //受注フォーム $order = array('_token' => 'dummy', 'OrderStatus' => (string) $Order->getOrderStatus(), 'Customer' => (string) $customer_id, 'name' => array('name01' => $Order->getName01(), 'name02' => $Order->getName02()), 'kana' => array('kana01' => $Order->getKana01(), 'kana02' => $Order->getKana02()), 'zip' => array('zip01' => $Order->getZip01(), 'zip02' => $Order->getZip02()), 'address' => array('pref' => $Order->getPref()->getId(), 'addr01' => $Order->getAddr01(), 'addr02' => $Order->getAddr02()), 'email' => $Order->getEmail(), 'tel' => array('tel01' => $Order->getTel01(), 'tel02' => $Order->getTel02(), 'tel03' => $Order->getTel03()), 'fax' => array('fax01' => $Order->getFax01(), 'fax02' => $Order->getFax02(), 'fax03' => $Order->getFax03()), 'company_name' => $Order->getCompanyName(), 'message' => $Order->getMessage(), 'OrderDetails' => $orderDetail, 'discount' => $Order->getDiscount(), 'delivery_fee_total' => $Order->getDeliveryFeeTotal(), 'charge' => $Order->getCharge(), 'Payment' => $Order->getPayment()->getId(), 'Shippings' => $shippings, 'note' => $Order->getNote()); return $order; }
/** * 購入者情報を設定する. * * @param Order $Order */ protected function renderOrderData(Order $Order) { // 基準座標を設定する $this->setBasePosition(); // フォント情報のバックアップ $this->backupFont(); // ========================================= // 購入者情報部 // ========================================= // 郵便番号 $text = '〒 ' . $Order->getZip01() . ' - ' . $Order->getZip02(); $this->lfText(23, 43, $text, 10); // 購入者都道府県+住所1 $text = $Order->getPref() . $Order->getAddr01(); $this->lfText(27, 47, $text, 10); $this->lfText(27, 51, $Order->getAddr02(), 10); //購入者住所2 // 購入者氏名 $text = $Order->getName01() . ' ' . $Order->getName02() . ' 様'; $this->lfText(27, 59, $text, 11); // ========================================= // お買い上げ明細部 // ========================================= $this->SetFont(self::FONT_SJIS, '', 10); //ご注文日 $orderDate = $Order->getCreateDate()->format('Y/m/d H:i'); if ($Order->getOrderDate()) { $orderDate = $Order->getOrderDate()->format('Y/m/d H:i'); } $this->lfText(25, 125, $orderDate, 10); //注文番号 $this->lfText(25, 135, $Order->getId(), 10); // 総合計金額 $this->SetFont(self::FONT_SJIS, 'B', 15); $paymentTotalText = number_format($Order->getPaymentTotal()) . ' ' . self::MONETARY_UNIT; $this->setBasePosition(120, 95.5); $this->Cell(5, 7, '', 0, 0, '', 0, ''); $this->Cell(67, 8, $paymentTotalText, 0, 2, 'R', 0, ''); $this->Cell(0, 45, '', 0, 2, '', 0, ''); // フォント情報の復元 $this->restoreFont(); }