• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ModuleFrontController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ModuleFrontController的典型用法代码示例。如果您正苦于以下问题:PHP ModuleFrontController类的具体用法?PHP ModuleFrontController怎么用?PHP ModuleFrontController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ModuleFrontController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: initContent

 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     $baseSsl = Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__;
     $this->context->smarty->assign(array('nbProducts' => $cart->nbProducts(), 'cust_currency' => $cart->id_currency, 'currencies' => $this->module->getCurrency((int) $cart->id_currency), 'total' => $cart->getOrderTotal(true, Cart::BOTH), 'isoCode' => $this->context->language->iso_code, 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'base_dir_ssl' => $baseSsl));
     $currency = new Currency($this->context->cart->id_currency);
     $step = isset($_GET['step']) ? $_GET['step'] : null;
     switch ($step) {
         case 'checkout':
             $response = $this->module->checkout($cart->getOrderTotal(), $cart->id, $currency->iso_code, $this->context->customer->secure_key, $this->context->link->getModuleLink('mtgox', 'payment'));
             if ($response['result'] == "success") {
                 header('Location: ' . $response['return']['payment_url']);
                 exit;
             } else {
                 exit('Fatal error. Could not checkout. Please try again');
             }
             break;
         case 'success':
             return $this->setTemplate('success.tpl');
             break;
         case 'failure':
             return $this->setTemplate('failure.tpl');
             break;
         case 'callback':
             $this->module->parseIpn($_POST);
             break;
         default:
             return $this->setTemplate('confirm.tpl');
             break;
     }
 }
开发者ID:neofutur,项目名称:prestashop-mtgox,代码行数:35,代码来源:payment.php


示例2: initContent

 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $this->display_column_left = false;
     parent::initContent();
     $this->context->smarty->assign(array('total' => $this->context->cart->getOrderTotal(true, Cart::BOTH), 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'));
     $this->setTemplate('validation.tpl');
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:10,代码来源:validation.php


示例3: initContent

 public function initContent()
 {
     global $smarty;
     parent::initContent();
     $this->setTemplate('tppaymentform.tpl');
     $smarty->assign(array('jslinkForm' => $this->getAmbientUrlForm(), 'publicKey' => $this->getPublicKey(), 'email' => $this->getMail(), 'name' => $this->getCompleteName(), 'orderId' => Tools::getValue('order')));
 }
开发者ID:TodoPago,项目名称:Plugin-PrestaShop,代码行数:7,代码来源:tppaymentform.php


示例4: initContent

 public function initContent()
 {
     parent::initContent();
     //Generate Kwixo form
     $this->context->smarty->assign(array('form' => KwixoFrontController::generateForm()));
     $this->setTemplate('payment_execution.tpl');
 }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:7,代码来源:MyFrontController15.php


示例5: initContent

 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $shop_name = htmlentities(Configuration::get('PS_SHOP_NAME'), NULL, 'utf-8');
     $shop_url = Tools::getHttpHost(true, true);
     $customer = Context::getContext()->customer;
     if (!preg_match("#.*\\.html\$#Ui", Tools::getValue('mail')) or !preg_match("#.*\\.html\$#Ui", Tools::getValue('mail'))) {
         die(Tools::redirect());
     }
     $file = file_get_contents(dirname(__FILE__) . '/../../mails/' . strval(preg_replace('#\\.{2,}#', '.', Tools::getValue('mail'))));
     $file = str_replace('{shop_name}', $shop_name, $file);
     $file = str_replace('{shop_url}', $shop_url . __PS_BASE_URI__, $file);
     $file = str_replace('{shop_logo}', $shop_url . _PS_IMG_ . 'logo.jpg', $file);
     $file = str_replace('{firstname}', $customer->firstname, $file);
     $file = str_replace('{lastname}', $customer->lastname, $file);
     $file = str_replace('{email}', $customer->email, $file);
     $file = str_replace('{firstname_friend}', 'XXXXX', $file);
     $file = str_replace('{lastname_friend}', 'xxxxxx', $file);
     $file = str_replace('{link}', 'authentication.php?create_account=1', $file);
     $discount_type = (int) Configuration::get('REFERRAL_DISCOUNT_TYPE');
     if ($discount_type == 1) {
         $file = str_replace('{discount}', Discount::display((double) Configuration::get('REFERRAL_PERCENTAGE'), $discount_type, new Currency($this->context->currency->id)), $file);
     } else {
         $file = str_replace('{discount}', Discount::display((double) Configuration::get('REFERRAL_DISCOUNT_VALUE_' . $this->context->currency->id), $discount_type, new Currency($this->context->currency->id)), $file);
     }
     $this->context->smarty->assign(array('content' => $file));
     $this->setTemplate('email.tpl');
 }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:31,代码来源:email.php


示例6: initContent

 public function initContent()
 {
     parent::initContent();
     $this->paypal = new PayPal();
     $this->context = Context::getContext();
     $this->id_module = (int) Tools::getValue('id_module');
     $this->id_order = (int) Tools::getValue('id_order');
     $order = new Order($this->id_order);
     $order_state = new OrderState($order->current_state);
     $paypal_order = PayPalOrder::getOrderById($this->id_order);
     if ($order_state->template[$this->context->language->id] == 'payment_error') {
         $this->context->smarty->assign(array('message' => $order_state->name[$this->context->language->id], 'logs' => array($this->paypal->l('An error occurred while processing payment.')), 'order' => $paypal_order, 'price' => Tools::displayPrice($paypal_order['total_paid'], $this->context->currency)));
         return $this->setTemplate('error.tpl');
     }
     $order_currency = new Currency((int) $order->id_currency);
     $display_currency = new Currency((int) $this->context->currency->id);
     $price = Tools::convertPriceFull($paypal_order['total_paid'], $order_currency, $display_currency);
     $this->context->smarty->assign(array('is_guest' => $this->context->customer->is_guest || $this->context->customer->id == false, 'order' => $paypal_order, 'price' => Tools::displayPrice($price, $this->context->currency->id), 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()));
     if ($this->context->customer->is_guest || $this->context->customer->id == false) {
         $this->context->smarty->assign(array('id_order' => (int) $this->id_order, 'id_order_formatted' => sprintf('#%06d', (int) $this->id_order), 'order_reference' => $order->reference));
         /* If guest we clear the cookie for security reason */
         $this->context->customer->mylogout();
     }
     if ($this->context->getMobileDevice() == true) {
         $this->setTemplate('order-confirmation-mobile.tpl');
     } else {
         $this->setTemplate('order-confirmation.tpl');
     }
 }
开发者ID:ventsiwad,项目名称:presta_addons,代码行数:29,代码来源:submit.php


示例7: initContent

 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     try {
         if (!Maestrano::param('connec.enabled')) {
             return false;
         }
         $client = new Maestrano_Connec_Client();
         $notification = json_decode(file_get_contents('php://input'), false);
         $entity_name = strtoupper(trim($notification->entity));
         $entity_id = $notification->id;
         switch ($entity_name) {
             case "PERSONS":
                 $customerMapper = new CustomerMapper();
                 $customerMapper->fetchConnecResource($entity_id);
                 break;
             case "ITEMS":
                 $productMapper = new ProductMapper();
                 $productMapper->fetchConnecResource($entity_id);
                 break;
             case "TAXCODES":
                 $taxMapper = new TaxMapper();
                 $taxMapper->fetchConnecResource($entity_id);
                 break;
         }
     } catch (Exception $e) {
         error_log("Caught exception in subscribe " . json_encode($e->getMessage()));
     }
 }
开发者ID:baljinderimpinge,项目名称:maestrano_presta,代码行数:32,代码来源:subscribe.php


示例8: init

 public function init()
 {
     parent::init();
     require_once $this->module->getLocalPath() . 'MailAlert.php';
     $this->id_product = (int) Tools::getValue('id_product');
     $this->id_product_attribute = (int) Tools::getValue('id_product_attribute');
 }
开发者ID:pacxs,项目名称:pacxscom,代码行数:7,代码来源:actions.php


示例9: initContent

 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $this->display_column_left = false;
     $link = new Link();
     parent::initContent();
     $this->setTemplate('warning_page.tpl');
 }
开发者ID:rizdaprasetya,项目名称:vtweb-prestashop-binfilter,代码行数:10,代码来源:warning.php


示例10: initContent

 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $id_cart = Tools::GetValue('id_cart');
     $cart = new Cart((int) $id_cart);
     $liqpay = new Liqpay();
     $total = $cart->getOrderTotal(true, 3);
     $liqpay->validateOrder(intval($cart->id), Configuration::get('PS_OS_PREPARATION'), $total, $liqpay->displayName);
     $currency = new Currency((int) $cart->id_currency);
     $private_key = Configuration::get('LIQPAY_PRIVATE_KEY');
     $public_key = Configuration::get('LIQPAY_PUBLIC_KEY');
     $amount = number_format($cart->getOrderTotal(true, Cart::BOTH), 1, '.', '');
     $currency = $currency->iso_code == 'RUR' ? 'RUB' : $currency->iso_code;
     $order_id = '000' . $id_cart;
     $description = 'Order #' . $order_id;
     $result_url = 'http://' . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . __PS_BASE_URI__ . 'index.php?controller=history';
     $server_url = 'http://' . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . $liqpay->getPath() . 'validation.php';
     $type = 'buy';
     $version = '3';
     $language = Configuration::get('PS_LOCALE_LANGUAGE') == 'en' ? 'en' : 'ru';
     $data = base64_encode(json_encode(array('version' => $version, 'public_key' => $public_key, 'amount' => $amount, 'currency' => $currency, 'description' => $description, 'order_id' => $order_id, 'type' => $type, 'language' => $language)));
     $signature = base64_encode(sha1($private_key . $data . $private_key, 1));
     $this->context->smarty->assign(compact('data', 'signature'));
     $this->setTemplate('redirect.tpl');
 }
开发者ID:litalex,项目名称:plugin-prestashop,代码行数:28,代码来源:redirect.php


示例11: initContent

 public function initContent()
 {
     parent::initContent();
     $params = KwixoURLCallFrontController::ManageUrlCall();
     $payment_ok = $params['payment_status'];
     $errors = $params['errors'];
     $id_order = $params['id_order'];
     if ($id_order != false) {
         $order = new Order($id_order);
         $cart = new Cart($order->id_cart);
         $products = $cart->getProducts();
         $amount = $order->total_paid_tax_incl;
         $total_shipping = $order->total_shipping;
     } else {
         $products = false;
         $amount = false;
         $total_shipping = false;
     }
     $link = new Link();
     $this->context->smarty->assign('payment_ok', $payment_ok);
     $this->context->smarty->assign('errors', $errors);
     $this->context->smarty->assign('amount', $amount);
     $this->context->smarty->assign('total_shipping', $total_shipping);
     $this->context->smarty->assign('products', $products);
     $this->context->smarty->assign('path_order', $link->getPageLink('order', true));
     $this->context->smarty->assign('path_history', $link->getPageLink('history', true));
     $this->context->smarty->assign('path_contact', $link->getPageLink('contact', true));
     $this->setTemplate('urlcall.tpl');
 }
开发者ID:ventsiwad,项目名称:presta_addons,代码行数:29,代码来源:MyUrlCallFrontController15.php


示例12: initContent

 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     $this->context->smarty->assign(array('payment_status' => $this->module->payment_status, 'nbProducts' => $cart->nbProducts(), 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'errors' => $this->errors));
     $this->setTemplate('error.tpl');
 }
开发者ID:handaehan,项目名称:yandex-money-cms-prestashop,代码行数:7,代码来源:paymentcard.php


示例13: initContent

 public function initContent()
 {
     parent::initContent();
     $ordernumber = Tools::getValue('InvId');
     $this->context->smarty->assign('ordernumber', $ordernumber);
     if (Configuration::get('robokassa_postvalidate')) {
         if (!$ordernumber) {
             robokassa::validateAnsver($this->module->l('Cart number is not set'));
         }
         $cart = new Cart((int) $ordernumber);
         if (!Validate::isLoadedObject($cart)) {
             robokassa::validateAnsver($this->module->l('Cart does not exist'));
         }
         if (!($ordernumber = Order::getOrderByCartId($cart->id))) {
             $this->setTemplate('waitingPayment.tpl');
         }
     }
     if (!$ordernumber) {
         robokassa::validateAnsver($this->module->l('Order number is not set'));
     }
     $order = new Order((int) $ordernumber);
     if (!Validate::isLoadedObject($order)) {
         robokassa::validateAnsver($this->module->l('Order does not exist'));
     }
     $customer = new Customer((int) $order->id_customer);
     if ($customer->id != $this->context->cookie->id_customer) {
         robokassa::validateAnsver($this->module->l('You are not logged in'));
     }
     if ($order->hasBeenPaid()) {
         Tools::redirectLink(__PS_BASE_URI__ . 'order-confirmation.php?key=' . $customer->secure_key . '&id_cart=' . (int) $order->id_cart . '&id_module=' . (int) $this->module->id . '&id_order=' . (int) $order->id);
     } else {
         $this->setTemplate('waitingPayment.tpl');
     }
 }
开发者ID:WhisperingTree,项目名称:etagerca,代码行数:34,代码来源:success.php


示例14: initContent

 public function initContent()
 {
     $meta = array();
     parent::initContent();
     $colums = Context::getContext()->theme->hasColumns(Context::getContext()->controller->page_name);
     if ($colums) {
         $hide_column_left = isset($colums['left_column']) && !empty($colums['left_column']) ? 0 : 1;
         $hide_column_right = isset($colums['right_column']) && !empty($colums['right_column']) ? 0 : 1;
     }
     /*  if ( Tools::getvalue('id_category') && Tools::getvalue('id_category') != Null) {
             $this->context->smarty->assign(BlogCategory::GetMetaByCategory(Tools::getvalue('id_category')));
         }
         if (Tools::getvalue('id_post') && Tools::getvalue('id_post') != Null) {
             $this->context->smarty->assign(SmartBlogPost::GetPostMetaByPost(Tools::getvalue('id_post')));
         }
         if (Tools::getvalue('id_category') == Null && Tools::getvalue('id_post') == Null) {
             $meta['meta_title'] = Configuration::get('smartblogmetatitle');
             $meta['meta_description'] = Configuration::get('smartblogmetadescrip');
             $meta['meta_keywords'] = Configuration::get('smartblogmetakeyword');
             $this->context->smarty->assign($meta);
         }
         */
     $this->context->smarty->assign($meta);
     if (Configuration::get('smartshowcolumn') == 0) {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displaySmartBlogLeft'), 'hide_right_column' => '', 'hide_left_column' => '', 'HOOK_RIGHT_COLUMN' => Hook::exec('displaySmartBlogRight')));
     } elseif (Configuration::get('smartshowcolumn') == 1) {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displaySmartBlogLeft'), 'hide_right_column' => '1', 'hide_left_column' => '', 'HOOK_RIGHT_COLUMN' => ''));
     } elseif (Configuration::get('smartshowcolumn') == 2) {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => '', 'hide_right_column' => '', 'hide_left_column' => '1', 'HOOK_RIGHT_COLUMN' => Hook::exec('displaySmartBlogRight')));
     } elseif (Configuration::get('smartshowcolumn') == 3) {
         $this->context->smarty->assign(array('hide_right_column' => $hide_column_right, 'hide_left_column' => $hide_column_left));
     } else {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displaySmartBlogLeft'), 'hide_right_column' => '', 'hide_left_column' => '', 'HOOK_RIGHT_COLUMN' => Hook::exec('displaySmartBlogRight')));
     }
 }
开发者ID:johnulist,项目名称:smartblog,代码行数:35,代码来源:FrontController.php


示例15: initContent

 public function initContent()
 {
     parent::initContent();
     $id = $_GET['id'];
     $id_lang = $this->context->language->id;
     $product = new Product((int) $id);
     $link = new Link();
     $url = $link->getProductLink($product);
     $features = Db::getInstance()->ExecuteS('
 		SELECT fl.name feature_name, fvl.value feature_value
 		FROM ' . _DB_PREFIX_ . 'feature_product fp
 		LEFT JOIN ' . _DB_PREFIX_ . 'feature_lang fl ON (fl.id_feature = fp.id_feature AND fl.id_lang=' . $id_lang . ' )
 		LEFT JOIN ' . _DB_PREFIX_ . 'feature_value_lang fvl ON (fvl.id_feature_value = fp.id_feature_value AND fvl.id_lang=' . $id_lang . ')
 		WHERE fp.id_product=' . $id);
     //	print_r($features);
     $images = Image::getImages((int) $id_lang, (int) $product->id);
     //Limitamos el numero de fotos a cuatro solamente
     while (count($images) > 3) {
         $var = array_pop($images);
     }
     $this->context->smarty->assign(array('product' => $product, 'lang' => $id_lang, 'image' => $images, 'dir' => Tools::getHttpHost(true) . __PS_BASE_URI__ . 'modules/pdfproduct', 'email' => Configuration::get('PS_SHOP_EMAIL'), 'url' => $url, 'address' => Configuration::get('ADDRESS_SHOP'), 'background' => Configuration::get('BACKGROUND')));
     $html = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'pdfproduct/views/templates/front/custom_template_content.tpl');
     $dompdf = new DOMPDF();
     $dompdf->set_option('enable_remote', TRUE);
     $dompdf->load_html($html);
     $dompdf->set_paper('a4', 'portrait');
     $dompdf->render();
     $dompdf->stream('producto');
     //$this->setTemplate('custom_template_content.tpl');
     //file_put_contents($filename, $dompdf->output());
     //$pdf = new PDF($product, 'CustomPdf', Context::getContext()->smarty);
     //$img_file = Tools::getHttpHost(true).__PS_BASE_URI__. '/modules/pdfproduct/views/images/background.jpg';
     //$pdf->pdf_renderer->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
     //$pdf->render();
 }
开发者ID:hesselek,项目名称:printed_module,代码行数:35,代码来源:controllerPdf.php


示例16: initContent

 public function initContent()
 {
     parent::initContent();
     // Get class instance
     $su = new Sofortueberweisung();
     $this->setTemplate('tpl-frontend-cancel.tpl');
 }
开发者ID:pedalracer,项目名称:free_modules_1.5,代码行数:7,代码来源:cancel.php


示例17: setMedia

 public function setMedia()
 {
     if (Tools::getValue("ajax") != "true") {
         parent::setMedia();
     }
     $this->addJqueryPlugin(array("idTabs"));
 }
开发者ID:sho5kubota,项目名称:guidingyou2,代码行数:7,代码来源:AgileModuleFrontController.php


示例18: display

 /**
  * Displays order confirmation page.
  */
 public function display()
 {
     $cart = $this->context->cart;
     $this->context->smarty->assign(array('order_total' => $cart->getOrderTotal(true, Cart::BOTH), 'is_empty' => $cart->nbProducts() == 0));
     $this->setTemplate('confirmation.tpl');
     parent::display();
 }
开发者ID:payneteasy,项目名称:php-plugin-prestashop,代码行数:10,代码来源:confirmation.php


示例19: initContent

 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     $this->context->smarty->assign(array('payment_link' => '', 'nbProducts' => $cart->nbProducts(), 'cust_currency' => $cart->id_currency, 'currencies' => $this->module->getCurrency((int) $cart->id_currency), 'total' => $cart->getOrderTotal(true, Cart::BOTH), 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'));
     $this->setTemplate('redirect.tpl');
 }
开发者ID:petr-repyev,项目名称:yandex-money-cms-prestashop,代码行数:7,代码来源:redirect.php


示例20: initContent

 public function initContent()
 {
     parent::initContent();
     $this->context = Context::getContext();
     $this->context->smarty->assign('version', $this->_whichVersion());
     $this->setTemplate('error.tpl');
 }
开发者ID:kennedimalheiros,项目名称:prestashop,代码行数:7,代码来源:error.php



注:本文中的ModuleFrontController类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ModuleGraph类代码示例发布时间:2022-05-23
下一篇:
PHP ModuleBuilderController类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap