コード例 #1
0
 /**
  * @param \Enlight_View_Default $view
  * @param string $templatePath
  */
 protected function extendsTemplate($view, $templatePath)
 {
     $version = $this->bootstrap->get('shop')->getTemplate()->getVersion();
     if ($version >= 3) {
         $view->addTemplateDir($this->bootstrapPath . 'Views/responsive/');
     } else {
         $view->addTemplateDir($this->bootstrapPath . 'Views/emotion/');
         $view->extendsTemplate($templatePath);
     }
 }
コード例 #2
0
 /**
  * @param Enlight_View_Default $view
  */
 protected function loadWidget(Enlight_View_Default $view)
 {
     $view->addTemplateDir(__DIR__ . '/Views/Common');
     $version = Shopware()->Shop()->getTemplate()->getVersion();
     if ($version >= 3) {
         $view->addTemplateDir(__DIR__ . '/Views/Responsive');
     } else {
         $view->addTemplateDir(__DIR__ . '/Views/Emotion');
         $view->extendsTemplate('frontend/checkout/index_darwinpricing.tpl');
     }
     $widgetUrl = $this->getApiUrl('/widget');
     $darwinPricingWidget = $this->loadAsynchronousJavascript($widgetUrl);
     $view->assign('darwinPricingWidget', $darwinPricingWidget);
 }
コード例 #3
0
ファイル: DefaultTest.php プロジェクト: nvdnkpr/Enlight
 public function testExtendsTemplate()
 {
     $this->view->loadTemplate('string:{block name="prependBlock"}-fest-{/block}');
     $this->view->extendsTemplate('string:{block name="prependBlock"}-fest2-{/block}');
     $this->assertEquals('-fest-|string:-fest2-', $this->view->Template()->fetch());
 }
コード例 #4
0
 /**
  * @param \Enlight_View_Default $view
  * @param int $templateVersion
  */
 private function addInvoiceInstructionsToView($view, $templateVersion)
 {
     $paymentInstructionProvider = new PaymentInstructionProvider($this->bootstrap->get('db'));
     $orderData = $view->getAssign();
     $instruction = $paymentInstructionProvider->getInstructionsByOrderNumberAndTransactionId($orderData['sOrderNumber'], $orderData['sTransactionumber']);
     $view->assign('payPalPlusInvoiceInstruction', $instruction);
     $payment = $orderData['sPayment'];
     if ($payment['name'] !== 'paypal') {
         return;
     }
     $validator = new APIValidator($this->restClient);
     if ($validator->isAPIAvailable()) {
         $payment['description'] = $this->bootstrap->Config()->get('paypalPlusDescription', '');
         $view->assign('sPayment', $payment);
     }
     $this->bootstrap->registerMyTemplateDir();
     if ($templateVersion < 3) {
         $view->extendsTemplate('frontend/checkout/emotion/finish.tpl');
     }
 }