本文整理汇总了PHP中vRequest::getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP vRequest::getVar方法的具体用法?PHP vRequest::getVar怎么用?PHP vRequest::getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vRequest
的用法示例。
在下文中一共展示了vRequest::getVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$this->vendorId = VmConfig::isSuperVendor();
// TODO add icon for media view
$this->SetViewTitle();
$model = VmModel::getModel('media');
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
$this->media = $model->getFile();
$this->addStandardEditViewCommands();
} else {
$virtuemart_product_id = vRequest::getInt('virtuemart_product_id');
if (is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0) {
$virtuemart_product_id = (int) $virtuemart_product_id[0];
} else {
$virtuemart_product_id = (int) $virtuemart_product_id;
}
$cat_id = vRequest::getInt('virtuemart_category_id', 0);
JToolBarHelper::custom('synchronizeMedia', 'new', 'new', vmText::_('COM_VIRTUEMART_TOOLS_SYNC_MEDIA_FILES'), false);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model, null, null, 'searchMedia');
$options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_TYPES'), 'product' => vmText::_('COM_VIRTUEMART_PRODUCT'), 'category' => vmText::_('COM_VIRTUEMART_CATEGORY'), 'manufacturer' => vmText::_('COM_VIRTUEMART_MANUFACTURER'), 'vendor' => vmText::_('COM_VIRTUEMART_VENDOR'));
$this->lists['search_type'] = VmHTML::selectList('search_type', vRequest::getVar('search_type'), $options, 1, '', 'onchange="this.form.submit();"');
$options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_ROLES'), 'file_is_displayable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DISPLAYABLE'), 'file_is_downloadable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DOWNLOADABLE'), 'file_is_forSale' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_SET_FORSALE'));
$this->lists['search_role'] = VmHTML::selectList('search_role', vRequest::getVar('search_role'), $options, 1, '', 'onchange="this.form.submit();"');
$this->files = $model->getFiles(false, false, $virtuemart_product_id, $cat_id);
$this->pagination = $model->getPagination();
}
parent::display($tpl);
}
示例2: mailAskquestion
/**
* Send the ask question email.
* @author Kohl Patrick, Christopher Roussel
*/
public function mailAskquestion()
{
vRequest::vmCheckToken();
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
$model = tmsModel::getModel('vendor');
$mainframe = JFactory::getApplication();
$vars = array();
$min = tsmConfig::get('asks_minimum_comment_length', 50) + 1;
$max = tsmConfig::get('asks_maximum_comment_length', 2000) - 1;
$commentSize = vRequest::getString('comment');
if (function_exists('mb_strlen')) {
$commentSize = mb_strlen($commentSize);
} else {
$commentSize = strlen($commentSize);
}
$validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL);
$virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id', 1);
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
//$vendorUser = JFactory::getUser($userId);
if ($commentSize < $min || $commentSize > $max || !$validMail) {
$this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE), tsmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS'));
return;
}
$user = JFactory::getUser();
$fromMail = vRequest::getVar('email');
//is sanitized then
$fromName = vRequest::getVar('name', '');
//is sanitized then
$fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
$fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
if (!empty($user->id)) {
if (empty($fromMail)) {
$fromMail = $user->email;
}
if (empty($fromName)) {
$fromName = $user->name;
}
}
$vars['user'] = array('name' => $fromName, 'email' => $fromMail);
$VendorEmail = $model->getVendorEmail($virtuemart_vendor_id);
$vars['vendor'] = array('vendor_store_name' => $fromName);
if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars, 'vendor')) {
$string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
} else {
$string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
}
$mainframe->enqueueMessage(tsmText::_($string));
// Display it all
$view = $this->getView('vendor', 'html');
$view->setLayout('mail_confirmed');
$view->display();
}
示例3: edit
/**
* Handle the edit task
*/
function edit($view=0){
//We set here the virtuemart_user_id, when no virtuemart_user_id is set to 0, for adding a new user
//In every other case the virtuemart_user_id is sent.
$cid = vRequest::getVar('virtuemart_user_id');
if(!isset($cid)) vRequest::setVar('virtuemart_user_id', (int)0);
parent::edit('edit');
}
示例4: languagepack
/**
* @return null
* @throws KlarnaApiException
*/
public function languagepack()
{
$sSubAction = vRequest::getWord('subAction');
if (!isset($this->template['name']) || $this->template['name'] == '') {
$this->template['name'] = "default";
}
if ($sSubAction == "klarna_box") {
$sNewISO = vRequest::getWord('newIso');
$sCountry = vRequest::getWord('country');
$iSum = vRequest::getFloat('sum', 0);
$iInvoiceFee = vRequest::getFloat('fee', 0);
$iFlag = vRequest::getInt('flag');
$sType = vRequest::getWord('type');
$aParams = vRequest::getVar('params');
$aValues = vRequest::getVar('values');
// foreach($aValues as $key => $value) {
// $aValues[$key] = utf8_encode($value);
// }
// foreach($aParams as $key => $value) {
// $aParams[$key] = utf8_decode($value);
// }
if ($sType != "part" && $sType != "invoice" && $sType != "spec") {
throw new KlarnaApiException("Invalid parameters");
}
$this->api->setCountry($sCountry);
if ($sType == 'spec') {
$types = array(KlarnaPClass::SPECIAL);
} else {
$types = array(KlarnaPClass::CAMPAIGN, KlarnaPClass::ACCOUNT, KlarnaPClass::FIXED);
}
$oApi = new KlarnaAPI($sCountry, $sNewISO, $sType, $iSum, $iFlag, $this->api, $types, VMKLARNAPLUGINWEBROOT);
// $oApi->addSetupValue ('web_root', $this->webroot);
// $oApi->setPaths ();
$oApi->addSetupValue('eid', $this->eid);
if ($sType == 'invoice') {
$oApi->setInvoiceFee($iInvoiceFee);
}
$oApi->setCurrency($this->api->getCurrency());
if (count($this->coSetup) > 0) {
$oApi->addMultipleSetupValues($this->coSetup);
}
return $oApi->retrieveLayout($aParams, $aValues);
// if ($sType == 'spec') {
// return $oApi->retrieveHTML($aParams, $aValues, null, $this->template);
// } else {
// return $oApi->retrieveHTML ($aParams, $aValues);
// }
} else {
if ($sSubAction == 'jsLanguagePack') {
$sNewISO = vRequest::getWord('newIso');
$sFetch = "";
} else {
throw new KlarnaApiException("Invalid sub-action");
}
}
}
示例5: display
function display($tpl = null)
{
$db = JFactory::getDBO();
if ($field = vRequest::getVar('field')) {
if (strpos($field, 'plugin') !== false) {
JForm::addFieldPath(JPATH_VM_ADMINISTRATOR . DS . 'fields');
$table = '#__extensions';
$field = substr($field, 6);
$q = 'SELECT `params`,`element`,`type` FROM `' . $table . '` WHERE `element` = "' . $field . '"';
$db->setQuery($q);
$this->userField = $db->loadObject();
//$this->userField->element = substr($this->userField->type, 6);
if (!class_exists('vmPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
}
vmPlugin::loadJLang('plg_vmuserfield_' . $this->userField->element, 'vmuserfield', $this->userField->element);
$path = JPATH_ROOT . DS . 'plugins' . DS . 'vmuserfield' . DS . $this->userField->element . DS . $this->userField->element . '.xml';
// Get the payment XML.
$formFile = JPath::clean($path);
if (file_exists($formFile)) {
if (!class_exists('VmConfig')) {
require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
}
if (!class_exists('VmTable')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'vmtable.php';
}
$this->userField->form = JForm::getInstance($this->userField->element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$this->userField->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
/*
$this->userField->params->userfield_params = $this->userField->params;
VmTable::bindParameterable($this->userField->params,'userfield_params',$varsToPush);*/
if (empty($this->userField->userfield_params)) {
$this->userField->userfield_params = '';
}
$this->userField->params->userfield_params = $this->userField->userfield_params;
VmTable::bindParameterable($this->userField->params, 'userfield_params', $varsToPush);
$this->userField->form->bind($this->userField);
} else {
$this->userField->form = false;
vmdebug('renderUserfieldPlugin could not find xml for ' . $this->userField->type . ' at ' . $path);
}
//vmdebug('renderUserfieldPlugin ',$this->userField->form);
if ($this->userField->form) {
$form = $this->userField->form;
ob_start();
include JPATH_VM_ADMINISTRATOR . DS . 'fields' . DS . 'formrenderer.php';
$body = ob_get_contents();
ob_end_clean();
echo $body;
}
}
}
jExit();
}
示例6: display
function display($tpl = null) {
//Load helpers
if (!class_exists('CurrencyDisplay'))
require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php');
if (!class_exists('VmHTML'))
require(VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php');
// Get the data
$model = VmModel::getModel('product');
// Create filter
$this->addStandardDefaultViewLists($model);
$inventorylist = $model->getProductListing();
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
// Apply currency
$currencydisplay = CurrencyDisplay::getInstance();
foreach ($inventorylist as $virtuemart_product_id => $product) {
//TODO oculd be interesting to show the price for each product, and all stored ones $product->product_in_stock
$price = isset($product->allPrices[$product->selectedPrice]['product_price'])? $product->allPrices[$product->selectedPrice]['product_price']:0;
$product->product_instock_value = $currencydisplay->priceDisplay($price,'',$product->product_in_stock,false);
$product->product_price_display = $currencydisplay->priceDisplay($price,'',1,false);
$product->weigth_unit_display= ShopFunctions::renderWeightUnit($product->product_weight_uom);
}
$this->assignRef('inventorylist', $inventorylist);
$options = array();
$options[] = JHtml::_('select.option', '', vmText::_('COM_VIRTUEMART_DISPLAY_STOCK').':');
$options[] = JHtml::_('select.option', 'stocklow', vmText::_('COM_VIRTUEMART_STOCK_LEVEL_LOW'));
$options[] = JHtml::_('select.option', 'stockout', vmText::_('COM_VIRTUEMART_STOCK_LEVEL_OUT'));
$this->lists['stockfilter'] = JHtml::_('select.genericlist', $options, 'search_type', 'onChange="document.adminForm.submit(); return false;"', 'value', 'text', vRequest::getVar('search_type'));
$this->lists['filter_product'] = vRequest::getVar('filter_product');
// $this->assignRef('lists', $lists);
/* Toolbar */
$this->SetViewTitle('PRODUCT_INVENTORY');
JToolBarHelper::publish();
JToolBarHelper::unpublish();
parent::display($tpl);
}
示例7: CloneShipment
/**
* Clone a shipment
*
* @author Valérie Isaksen
*/
public function CloneShipment()
{
$mainframe = Jfactory::getApplication();
/* Load the view object */
$view = $this->getView('shipmentmethod', 'html');
$model = VmModel::getModel('shipmentmethod');
$msgtype = '';
$cids = vRequest::getVar($this->_cidName, vRequest::getInt('virtuemart_shipment_id'));
foreach ($cids as $cid) {
if ($model->createClone($cid)) {
$msg = vmText::_('COM_VIRTUEMART_SHIPMENT_CLONED_SUCCESSFULLY');
} else {
$msg = vmText::_('COM_VIRTUEMART_SHIPMENT_NOT_CLONED_SUCCESSFULLY');
$msgtype = 'error';
}
}
$mainframe->redirect('index.php?option=com_virtuemart&view=shipmentmethod', $msg, $msgtype);
}
示例8: getInventoryFilter
/**
* Collect the filters for the query
* @author Max Milbers
*/
private function getInventoryFilter()
{
// Check some filters
$filters = array();
if ($search = vRequest::getVar('filter_inventory', false)) {
$db = JFactory::getDBO();
$search = '"%' . $db->escape($search, true) . '%"';
$filters[] = '`#__tsmart_products`.`product_name` LIKE ' . $search;
}
if (vRequest::getInt('stockfilter', 0) == 1) {
$filters[] = '`#__tsmart_products`.`product_in_stock` > 0';
}
if ($catId = vRequest::getInt('tsmart_category_id', 0) > 0) {
$filters[] = '`#__tsmart_categories`.`tsmart_category_id` = ' . $catId;
}
$filters[] = '(`#__tsmart_shoppergroups`.`default` = 1 OR `#__tsmart_shoppergroups`.`default` is NULL)';
return ' WHERE ' . implode(' AND ', $filters) . $this->_getOrdering();
}
示例9: PaymentResponseReceived
/**
* ResponseReceived()
* From the payment page, the user returns to the shop. The order email is sent, and the cart emptied.
*
*/
function PaymentResponseReceived()
{
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmpayment');
$return_context = "";
$dispatcher = JDispatcher::getInstance();
$html = "";
$paymentResponse = vmText::_('COM_VIRTUEMART_CART_THANKYOU');
$returnValues = $dispatcher->trigger('plgVmOnPaymentResponseReceived', array('html' => &$html, &$paymentResponse));
$view = $this->getView('vmplg', 'html');
$layoutName = vRequest::getVar('layout', 'default');
$view->setLayout($layoutName);
$view->assignRef('paymentResponse', $paymentResponse);
$view->assignRef('paymentResponseHtml', $html);
// Display it all
$view->display();
}
示例10: display
function display($tpl = null)
{
$latestVersion = vRequest::getVar('latestverison', '');
JToolBarHelper::title(vmText::_('COM_VIRTUEMART_UPDATE_MIGRATION'), 'head vm_config_48');
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$this->assignRef('checkbutton_style', $checkbutton_style);
$this->assignRef('downloadbutton_style', $downloadbutton_style);
$this->assignRef('latestVersion', $latestVersion);
$freshInstall = vRequest::getInt('redirected', 0);
if ($freshInstall) {
$this->setLayout('install');
}
parent::display($tpl);
}
示例11: ClonePayment
/**
* Clone a payment
*
* @author Valérie Isaksen
*/
public function ClonePayment()
{
$mainframe = Jfactory::getApplication();
/* Load the view object */
$view = $this->getView('paymentmethod', 'html');
$model = VmModel::getModel('paymentmethod');
$msgtype = '';
//$cids = vRequest::getInt('virtuemart_product_id',0);
$cids = vRequest::getVar($this->_cidName, vRequest::getVar('virtuemart_payment_id'));
//jimport( 'joomla.utilities.arrayhelper' );
JArrayHelper::toInteger($cids);
foreach ($cids as $cid) {
if ($model->createClone($cid)) {
$msg = vmText::_('COM_VIRTUEMART_PAYMENT_CLONED_SUCCESSFULLY');
} else {
$msg = vmText::_('COM_VIRTUEMART_PAYMENT_NOT_CLONED_SUCCESSFULLY');
$msgtype = 'error';
}
}
$mainframe->redirect('index.php?option=com_virtuemart&view=paymentmethod', $msg, $msgtype);
}
示例12: display
function display($tpl = null)
{
$mainframe = Jfactory::getApplication();
$option = vRequest::getCmd('option');
//Load helpers
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
/* Get the review IDs to retrieve (input variable may be cid, cid[] or virtuemart_rating_review_id */
$cids = vRequest::getInt('cid', vRequest::getVar('virtuemart_rating_review_id', 0));
if ($cids && !is_array($cids)) {
$cids = array($cids);
}
// Figure out maximum rating scale (default is 5 stars)
$this->max_rating = VmConfig::get('vm_maximum_rating_scale', 5);
$model = VmModel::getModel();
$this->SetViewTitle('REVIEW_RATE');
/* Get the task */
$task = vRequest::getCmd('task');
switch ($task) {
case 'edit':
/* Get the data
$rating = $model->getRating($cids);
$this->addStandardEditViewCommands();
break;*/
/* Get the data
$rating = $model->getRating($cids);
$this->addStandardEditViewCommands();
break;*/
case 'listreviews':
/* Get the data */
$this->addStandardDefaultViewLists($model);
$virtuemart_product_id = vRequest::getInt('virtuemart_product_id');
if (is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0) {
$virtuemart_product_id = (int) $virtuemart_product_id[0];
} else {
$virtuemart_product_id = (int) $virtuemart_product_id;
}
$this->reviewslist = $model->getReviews($virtuemart_product_id);
$lists = array();
$lists['filter_order'] = $mainframe->getUserStateFromRequest($option . 'filter_order', 'filter_order', '', 'cmd');
$lists['filter_order_Dir'] = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
$this->pagination = $model->getPagination();
$this->addStandardDefaultViewCommands(false, true);
break;
case 'edit_review':
JToolBarHelper::divider();
// Get the data
$this->rating = $model->getReview($cids);
if (!empty($this->rating)) {
$this->SetViewTitle('REVIEW_RATE', $this->rating->product_name . " (" . $this->rating->customer . ")");
JToolBarHelper::custom('saveReview', 'save', 'save', vmText::_('COM_VIRTUEMART_SAVE'), false);
JToolBarHelper::custom('applyReview', 'apply', 'apply', vmText::_('COM_VIRTUEMART_APPLY'), false);
} else {
$this->SetViewTitle('REVIEW_RATE', 'ERROR');
}
JToolBarHelper::custom('cancelEditReview', 'cancel', 'cancel', vmText::_('COM_VIRTUEMART_CANCEL'), false);
break;
default:
$this->addStandardDefaultViewCommands(false, true);
$this->addStandardDefaultViewLists($model);
$this->ratingslist = $model->getRatings();
$this->pagination = $model->getPagination();
break;
}
parent::display($tpl);
}
示例13: convertCurrencyTo
/**
*
* @author Max Milbers
* @param unknown_type $currency
* @param unknown_type $price
* @param unknown_type $shop
*/
function convertCurrencyTo($currency, $price, $shop = true)
{
if (empty($currency)) {
// vmdebug('empty $currency ',$price);
return $price;
}
// If both currency codes match, do nothing
if (is_Object($currency) and $currency->_currency_id == $this->_vendorCurrency or !is_Object($currency) and $currency == $this->_vendorCurrency) {
// vmdebug(' $currency == $this->_vendorCurrency ',$price);
return $price;
}
if (is_Object($currency)) {
$exchangeRate = (double) $currency->exchangeRateShopper;
vmdebug('convertCurrencyTo OBJECT ' . $exchangeRate);
} else {
static $currency_exchange_rate = array();
if (!isset($currency_exchange_rate[$currency])) {
$q = 'SELECT `currency_exchange_rate` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id` ="' . (int) $currency . '" ';
$this->_db->setQuery($q);
$currency_exchange_rate[$currency] = (double) $this->_db->loadResult();
}
if (!empty($currency_exchange_rate[$currency])) {
$exchangeRate = $currency_exchange_rate[$currency];
} else {
$exchangeRate = 0;
}
}
if (!empty($exchangeRate)) {
if ($shop) {
$price = $price / $exchangeRate;
} else {
$price = $price * $exchangeRate;
}
} else {
$currencyCode = self::ensureUsingCurrencyCode($currency);
$vendorCurrencyCode = self::ensureUsingCurrencyCode($this->_vendorCurrency);
$globalCurrencyConverter = vRequest::getVar('globalCurrencyConverter');
if ($shop) {
$price = $this->_currencyConverter->convert($price, $currencyCode, $vendorCurrencyCode);
//vmdebug('convertCurrencyTo Use dynamic rate in shop '.$oldprice .' => '.$price);
} else {
//vmdebug('convertCurrencyTo Use dynamic rate to shopper currency '.$price);
$price = $this->_currencyConverter->convert($price, $vendorCurrencyCode, $currencyCode);
}
// vmdebug('convertCurrencyTo my currency ',$this->exchangeRateShopper);
}
return $price;
}
示例14: renderMailLayout
function renderMailLayout()
{
$this->setLayout('mail_html_question');
$this->comment = vRequest::getString('comment');
$this->user = JFactory::getUser();
if (empty($this->user->id)) {
$fromMail = vRequest::getVar('email');
//is sanitized then
$fromName = vRequest::getVar('name', '');
//is sanitized then
$fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
$fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
} else {
$fromMail = $this->user->email;
$fromName = $this->user->name;
}
$vars['user'] = array('name' => $fromName, 'email' => $fromMail);
$vendorModel = VmModel::getModel('vendor');
if (empty($this->vendor)) {
$this->vendor = $vendorModel->getVendor();
$this->vendor->vendor_store_name = $fromName;
}
$vendorModel->addImages($this->vendor);
$virtuemart_product_id = vRequest::getInt('virtuemart_product_id', 0);
$productModel = VmModel::getModel('product');
if (empty($this->product)) {
$this->product = $productModel->getProduct($virtuemart_product_id);
}
$productModel->addImages($this->product);
$this->subject = Jtext::_('COM_VIRTUEMART_QUESTION_ABOUT') . $this->product->product_name;
$this->vendorEmail = $this->user['email'];
// in this particular case, overwrite the value for fix the recipient name
$this->vendor->vendor_name = $this->user['name'];
if (VmConfig::get('order_mail_html')) {
$tpl = 'mail_html_question';
} else {
$tpl = 'mail_raw_question';
}
$this->setLayout($tpl);
parent::display();
}
示例15: plgVmOnSelfCallFE
/**
* For Express Checkout
* @param $type
* @param $name
* @param $render
* @return bool|null
*/
function plgVmOnSelfCallFE($type, $name, &$render) {
if ($name != $this->_name || $type != 'vmpayment') {
return FALSE;
}
$action = vRequest::getCmd('action');
$virtuemart_paymentmethod_id = vRequest::getInt('pm');
//Load the method
if (!($this->_currentMethod = $this->getVmPluginMethod($virtuemart_paymentmethod_id))) {
return NULL; // Another method was selected, do nothing
}
if (!$this->selectedThisElement($this->_currentMethod->payment_element)) {
return FALSE;
}
if ($action != 'SetExpressCheckout') {
return false;
}
$expressCheckout = vRequest::getVar('SetExpressCheckout', '');
if($expressCheckout=='done') {
if (!class_exists('VirtueMartCart')) {
require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php');
}
$cart = VirtueMartCart::getCart();
$cart->prepareCartData();
$cart->virtuemart_paymentmethod_id = $virtuemart_paymentmethod_id;
$cart->setCartIntoSession();
//$this->_currentMethod = $currentMethod;
$paypalInterface = $this->_loadPayPalInterface();
$paypalInterface->setCart($cart);
$paypalInterface->setTotal($cart->cartPrices['billTotal']);
$paypalInterface->loadCustomerData();
// will perform $this->getExpressCheckoutDetails();
$paypalInterface->getExtraPluginInfo($this->_currentMethod);
if (!$paypalInterface->validate()) {
VmInfo('VMPAYMENT_PAYPAL_PAYMENT_NOT_VALID');
return false;
} else {
$app = JFactory::getApplication();
$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart&Itemid=' . vRequest::getInt('Itemid'), false));
}
} elseif($expressCheckout=='cancel') {
$this->customerData->clear();
if (!class_exists('VirtueMartCart')) {
require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php');
}
$cart = VirtueMartCart::getCart();
$cart->virtuemart_paymentmethod_id = 0;
$cart->setCartIntoSession();
$app = JFactory::getApplication();
$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart&Itemid=' . vRequest::getInt('Itemid'), false), vmText::_('VMPAYMENT_PAYPAL_PAYMENT_CANCELLED'));
}
}