本文整理汇总了PHP中ModuleFrontController::initContent方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleFrontController::initContent方法的具体用法?PHP ModuleFrontController::initContent怎么用?PHP ModuleFrontController::initContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleFrontController
的用法示例。
在下文中一共展示了ModuleFrontController::initContent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initContent
public function initContent()
{
$this->display_column_left = false;
parent::initContent();
$this->module->customerCardsPage();
$this->setTemplate('accountpage.tpl');
}
示例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');
}
示例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')));
}
示例4: initContent
public function initContent()
{
parent::initContent();
//Generate Kwixo form
$this->context->smarty->assign(array('form' => KwixoFrontController::generateForm()));
$this->setTemplate('payment_execution.tpl');
}
示例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');
}
示例6: 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();
}
示例7: 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');
}
示例8: 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')));
}
}
示例9: 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');
}
}
示例10: initContent
public function initContent()
{
$log = null;
$this->display_header = false;
$this->display_footer = false;
parent::initContent();
$transaction = Tools::getValue('transaction');
if (Tools::isEmpty($transaction)) {
die(Tools::displayError('Wrong use of the HTTP notifications. Please set up your sofortüberweisung.de notification to call this URL only with POST method.'));
}
$orderState = _PS_OS_PAYMENT_;
$baseDir = dirname(__FILE__);
$useSSL = true;
// Get class instance
$su = new Sofortueberweisung();
// Set order state to "awaiting payment"
$orderState = Configuration::get('_SU_OS_OK_');
$cartId = 0;
// Check incoming response
if ($su->checkResponse($_POST, $log)) {
// Get cartId from the response
$cartId = (int) Tools::getValue('user_variable_0');
// Get the cart object
$cart = new Cart($cartId);
// Get the customer object
$customer = new Customer((int) $cart->id_customer);
// Get order sum
$orderSum = (double) Tools::getValue('amount');
$currency_special = $cart->id_currency;
$message = 'Payment through Sofortüberweisung.de - Transaction-ID: ' . $transaction . ' ';
$secure_key = $customer->secure_key;
// Create order
$su->updateOrder($cartId, $orderState, $orderSum, $message, $currency_special, $secure_key);
}
}
示例11: 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;
}
}
示例12: initContent
public function initContent()
{
parent::initContent();
//EJEMPLO;APELLIDO2-EJEMPLO&COTITULAR=033333333P;COTITU-EJEMPLO;COTITU-APE1-
//EJEMPLO;COTITU-APE2-EJEMPLO
//$code =
$cart = $this->context->cart;
include dirname(__FILE__) . '/cripto.php';
// $url= 'http://prufrc.ebiosphere.com/WebComercios/Online/index.jsp?';
$url = 'https://comercios.fracciona.com/Online/index.jsp?';
$url .= encriptar('NPEDIDO') . '=' . encriptar($this->context->cookie->cod_frac) . '&';
$url .= encriptar('IMPORTE') . '=';
$url .= encriptar($cart->getOrderTotal(true, Cart::BOTH)) . '&';
$url .= encriptar('CODVENDEDOR') . '=';
$url .= encriptar(Configuration::get('FRACC_CODE')) . '&';
$url .= encriptar('TITULAR') . '=' . encriptar(Tools::getValue('dni')) . ';';
$url .= encriptar(Tools::getValue('nombre')) . ';' . encriptar(Tools::getValue('apellidoFirst')) . ';';
$url .= encriptar(Tools::getValue('apellidoLast')) . '&';
$url .= encriptar('EMAIL') . '=' . encriptar(Tools::getValue('email'));
if (!Tools::isEmpty(Tools::getValue('nombre2'))) {
$url .= encriptar('&COTITULAR') . '=' . encriptar(Tools::getValue('dni2')) . ';';
$url .= encriptar(Tools::getValue('nombre2')) . ';' . encriptar(Tools::getValue('apellidoFirst2')) . ';';
$url .= encriptar(Tools::getValue('apellidoLast2')) . '&' . encriptar(Tools::getValue('email2'));
}
//echo $url;
Tools::redirect($url);
}
示例13: initContent
/**
* @see FrontController::initContent()
*/
public function initContent()
{
$this->display_column_left = false;
parent::initContent();
$this->module->paymentConfirmation();
$this->setTemplate('confirm.tpl');
}
示例14: initContent
/**
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
$this->module->configurePaymentForm();
$this->context->smarty->assign(array('standalone' => true));
$this->setTemplate('../hook/payment.tpl');
}
示例15: initContent
/**
* @see FrontController::initContent()
*/
public function initContent()
{
$this->display_column_left = false;
parent::initContent();
if (!$this->isTokenValid()) {
die($this->module->l($this->module->displayName . ' Error: (invalid token)'));
}
$cart = $this->context->cart;
$address = new Address((int) $cart->id_address_invoice);
$customer = new Customer((int) $cart->id_customer);
$currency = $this->context->currency;
$country = new Country((int) $address->id_country);
if (!Configuration::get('SOFORTBANKING_USER_ID')) {
die($this->module->l($this->module->displayName . ' Error: (invalid or undefined userId)'));
}
if (!Configuration::get('SOFORTBANKING_PROJECT_ID')) {
die($this->module->l($this->module->displayName . ' Error: (invalid or undefined projectId)'));
}
if (!Validate::isLoadedObject($address) || !Validate::isLoadedObject($customer) || !Validate::isLoadedObject($currency)) {
die($this->module->l($this->module->displayName . ' Error: (invalid address or customer)'));
}
$parameters = array('user_id' => Configuration::get('SOFORTBANKING_USER_ID'), 'project_id' => Configuration::get('SOFORTBANKING_PROJECT_ID'), 'sender_holder' => '', '', '', 'sender_country_id' => $country->iso_code, 'amount' => number_format($cart->getOrderTotal(), 2, '.', ''), 'currency_id' => $currency->iso_code, 'reason_1' => time() . '-' . (int) $cart->id, 'reason_2' => $customer->firstname . ' ' . Tools::ucfirst(Tools::strtolower($customer->lastname)), 'user_variable_0' => $customer->secure_key, 'user_variable_1' => (int) $cart->id, 'user_variable_2' => '', 'user_variable_3' => '', 'user_variable_4' => '', 'user_variable_5' => '', 'project_password' => Configuration::get('SOFORTBANKING_PROJECT_PW'));
$this->context->smarty->assign(array('this_path' => $this->module->getPathUri(), 'nbProducts' => $cart->nbProducts(), 'total' => $cart->getOrderTotal(), 'version' => _PS_VERSION_, 'hash' => sha1(implode('|', $parameters)), 'gateway' => 'https://www.sofortueberweisung.de/payment/start', 'cprotect' => Configuration::get('SOFORTBANKING_CPROTECT'), 'parameters' => $parameters, 'mod_lang' => $this->isSupportedLang()));
$this->setTemplate(Configuration::get('SOFORTBANKING_REDIRECT') == 'Y' ? 'payment_redirect.tpl' : 'payment_execution.tpl');
}