Example #1
0
 /**
  * @param \Eccube\Entity\BaseInfo
  * @return bool
  */
 public function isEffective(\Eccube\Entity\BaseInfo $BaseInfo)
 {
     $downloable = clone $this->getOrder()->getPaymentDate();
     if ($BaseInfo->getDownloadableDays()) {
         $downloable->add(new \DateInterval("P" . $BaseInfo->getDownloadableDays() . "D"));
     }
     if ($BaseInfo->getDownloadableDaysUnlimited() === 1 && $this->getOrder()->getPaymentDate()) {
         return true;
     } elseif (new \DateTime() <= $downloable) {
         return true;
     } else {
         return false;
     }
 }
Example #2
0
 /**
  * Send password reset notification mail.
  *
  * @param $Customer 会員情報
  */
 public function sendPasswordResetCompleteMail(\Eccube\Entity\Customer $Customer, $password)
 {
     $body = $this->app->renderView('Mail/reset_complete_mail.twig', array('Customer' => $Customer, 'password' => $password));
     $message = \Swift_Message::newInstance()->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のお知らせ')->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))->setTo(array($Customer->getEmail()))->setBcc($this->BaseInfo->getEmail01())->setReplyTo($this->BaseInfo->getEmail03())->setReturnPath($this->BaseInfo->getEmail04())->setBody($body);
     $event = new EventArgs(array('message' => $message, 'Customer' => $Customer, 'BaseInfo' => $this->BaseInfo, 'password' => $password), null);
     $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_PASSWORD_RESET_COMPLETE, $event);
     $this->app->mail($message);
 }
 public function setUp()
 {
     // テスト時に Application やデータベース接続が不要な場合は、この行を削除してください.
     parent::setUp();
     // ダミーデータを生成する Faker
     $faker = $this->getFaker();
     // テスト用のデータを生成する.
     $BaseInfo = new BaseInfo();
     $BaseInfo->setCompanyName('company')->setShopName($faker->company)->setAddr01($faker->address)->setAddr02($faker->secondaryAddress)->setEmail01($faker->email)->setLatitude($faker->latitude)->setLongitude($faker->longitude)->setUpdateDate($faker->dateTime('now'));
     /*
      * ここでは Doctrine ORM を使用しているが、オブジェクトキャッシュ等により、
      * 期待した結果が得られない場合がある.
      * 必要に応じて、Doctrine DBAL や PDO を使用すること.
      */
     $this->app['orm.em']->persist($BaseInfo);
     $this->app['orm.em']->flush();
     $this->id = $BaseInfo->getId();
 }
Example #4
0
 /**
  * 支払方法を取得
  *
  * @param $deliveries
  * @param Order $Order
  * @return array
  */
 public function getFormPayments($deliveries, Order $Order)
 {
     $productTypes = $this->orderService->getProductTypes($Order);
     if ($this->BaseInfo->getOptionMultipleShipping() == Constant::ENABLED && count($productTypes) > 1) {
         // 複数配送時の支払方法
         $payments = $this->app['eccube.repository.payment']->findAllowedPayments($deliveries);
     } else {
         // 配送業者をセット
         $shippings = $Order->getShippings();
         $Shipping = $shippings[0];
         $payments = $this->app['eccube.repository.payment']->findPayments($Shipping->getDelivery(), true);
     }
     $payments = $this->getPayments($payments, $Order->getSubTotal());
     return $payments;
 }
 /**
  * PDFに店舗情報を設定する
  * ショップ名、ロゴ画像以外はdtb_helpに登録されたデータを使用する.
  */
 protected function renderShopData()
 {
     // 基準座標を設定する
     $this->setBasePosition();
     // 特定商取引法を取得する
     /* @var Help $Help */
     $Help = $this->app['eccube.repository.help']->get();
     // ショップ名
     $this->lfText(125, 60, $this->BaseInfo->getShopName(), 8, 'B');
     // URL
     $this->lfText(125, 63, $Help->getLawUrl(), 8);
     // 会社名
     $this->lfText(125, 68, $Help->getLawCompany(), 8);
     // 郵便番号
     $text = '〒 ' . $Help->getLawZip01() . ' - ' . $Help->getLawZip02();
     $this->lfText(125, 71, $text, 8);
     // 都道府県+所在地
     $lawPref = $Help->getLawPref() ? $Help->getLawPref()->getName() : null;
     $text = $lawPref . $Help->getLawAddr01();
     $this->lfText(125, 74, $text, 8);
     $this->lfText(125, 77, $Help->getLawAddr02(), 8);
     // 電話番号
     $text = 'TEL: ' . $Help->getLawTel01() . '-' . $Help->getLawTel02() . '-' . $Help->getLawTel03();
     //FAX番号が存在する場合、表示する
     if (strlen($Help->getLawFax01()) > 0) {
         $text .= ' FAX: ' . $Help->getLawFax01() . '-' . $Help->getLawFax02() . '-' . $Help->getLawFax03();
     }
     $this->lfText(125, 80, $text, 8);
     //TEL・FAX
     // メールアドレス
     if (strlen($Help->getLawEmail()) > 0) {
         $text = 'Email: ' . $Help->getLawEmail();
         $this->lfText(125, 83, $text, 8);
         // Email
     }
     // ロゴ画像(app配下のロゴ画像を優先して読み込む)
     $logoFile = $this->app['config']['OrderPdf']['const']['logo_file'];
     $originalPath = __DIR__ . '/../Resource/template/' . $logoFile;
     $userPath = $this->app['config']['template_realdir'] . '/../admin/OrderPdf/' . $logoFile;
     $logoFilePath = file_exists($userPath) ? $userPath : $originalPath;
     $this->Image($logoFilePath, 124, 46, 40);
 }
Example #6
0
 /**
  * @param  string $productClassId
  * @return \Eccube\Service\CartService
  */
 public function removeProduct($productClassId)
 {
     $this->cart->removeCartItemByIdentifier('Eccube\\Entity\\ProductClass', (string) $productClassId);
     // 支払方法の再設定
     if ($this->BaseInfo->getOptionMultipleShipping() == Constant::ENABLED) {
         // 複数配送対応
         $productTypes = array();
         foreach ($this->getCart()->getCartItems() as $item) {
             /* @var $ProductClass \Eccube\Entity\ProductClass */
             $ProductClass = $item->getObject();
             $productTypes[] = $ProductClass->getProductType();
         }
         // 配送業者を取得
         $deliveries = $this->entityManager->getRepository('Eccube\\Entity\\Delivery')->getDeliveries($productTypes);
         // 支払方法を取得
         $payments = $this->entityManager->getRepository('Eccube\\Entity\\Payment')->findAllowedPayments($deliveries);
         $this->getCart()->setPayments($payments);
     }
     return $this;
 }
 /**
  * 送信完了報告メールを送信する
  *
  * @return number
  */
 public function sendMailMagazineCompleateReportMail()
 {
     $subject = date('Y年m月d日H時i分') . ' 下記メールの配信が完了しました。';
     $mailData = array('email' => $this->BaseInfo->getEmail03(), 'subject' => $subject, 'body' => $this->lastSendMailBody);
     return $this->sendMail($mailData);
 }
Example #8
0
 /**
  * Send password reset notification mail.
  *
  * @param $Customer 会員情報
  */
 public function sendPasswordResetCompleteMail(\Eccube\Entity\Customer $Customer, $password)
 {
     $body = $this->app->renderView('Mail/reset_complete_mail.twig', array('Customer' => $Customer, 'password' => $password));
     $message = \Swift_Message::newInstance()->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のお知らせ')->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))->setTo(array($Customer->getEmail()))->setBcc($this->BaseInfo->getEmail01())->setReplyTo($this->BaseInfo->getEmail03())->setReturnPath($this->BaseInfo->getEmail04())->setBody($body);
     $this->app->mail($message);
 }