本文整理汇总了PHP中shopFunctionsF::getLastVisitedItemId方法的典型用法代码示例。如果您正苦于以下问题:PHP shopFunctionsF::getLastVisitedItemId方法的具体用法?PHP shopFunctionsF::getLastVisitedItemId怎么用?PHP shopFunctionsF::getLastVisitedItemId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shopFunctionsF
的用法示例。
在下文中一共展示了shopFunctionsF::getLastVisitedItemId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Override of display
*
* @return JController A JController object to support chaining.
* @since 11.1
*/
public function display($cachable = false, $urlparams = false){
if(VmConfig::get('use_as_catalog', 0)){
// Get a continue link
$virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId();
$categoryLink = '';
if ($virtuemart_category_id) {
$categoryLink = '&virtuemart_category_id=' . $virtuemart_category_id;
}
$ItemId = shopFunctionsF::getLastVisitedItemId();
$ItemIdLink = '';
if ($ItemId) {
$ItemIdLink = '&Itemid=' . $ItemId;
}
vmInfo('This is a catalogue, you cannot acccess the cart');
$continue_link = JRoute::_('index.php?option=com_virtuemart&view=category' . $categoryLink . $ItemIdLink, FALSE);
$app = JFactory::getApplication();
$app ->redirect($continue_link);
}
$document = JFactory::getDocument();
$viewType = $document->getType();
$viewName = vRequest::getCmd('view', $this->default_view);
$viewLayout = vRequest::getCmd('layout', 'default');
$view = $this->getView($viewName, $viewType, '', array('layout' => $viewLayout));
$view->assignRef('document', $document);
$cart = VirtueMartCart::getCart();
$cart->order_language = vRequest::getString('order_language', $cart->order_language);
$cart->prepareCartData();
$request = vRequest::getRequest();
$task = vRequest::getCmd('task');
if(($task == 'confirm' or isset($request['confirm'])) and !$cart->getInCheckOut()){
$cart->confirmDone();
$view = $this->getView('cart', 'html');
$view->setLayout('order_done');
$cart->_fromCart = false;
$view->display();
return true;
} else {
//$cart->_inCheckOut = false;
$redirect = (isset($request['checkout']) or $task=='checkout');
$cart->_inConfirm = false;
$cart->checkoutData($redirect);
}
$cart->_fromCart = false;
$view->display();
return $this;
}
示例2: prepareContinueLink
public function prepareContinueLink()
{
$virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId();
$categoryStr = '';
if ($virtuemart_category_id) {
$categoryStr = '&virtuemart_category_id=' . $virtuemart_category_id;
}
$ItemidStr = '';
$Itemid = shopFunctionsF::getLastVisitedItemId();
if (!empty($Itemid)) {
$ItemidStr = '&Itemid=' . $Itemid;
}
$this->continue_link = JRoute::_('index.php?option=com_virtuemart&view=category' . $categoryStr . $ItemidStr, FALSE);
//$this->continue_link_html = '<a class="continue_link" href="' . $continue_link . '" ><span>' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</span></a>';
$this->continue_link_html = '<a class="continue continue_link" href="' . $this->continue_link . '">' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
$this->cart_link = JRoute::_('index.php?option=com_virtuemart&view=cart' . $ItemidStr, FALSE);
return;
}
示例3: defined
* @author Max Milbers
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2014 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL2, see LICENSE.php
* @version $Id: cart.php 7682 2014-02-26 17:07:20Z Milbo $
*/
defined('_JEXEC') or die('Restricted access');
$products_per_row = $viewData['products_per_row'];
$currency = $viewData['currency'];
$showRating = $viewData['showRating'];
$verticalseparator = " vertical-separator";
$verticalseparator2 = " vertical-separator2";
echo shopFunctionsF::renderVmSubLayout('askrecomjs');
$product_model = VmModel::getModel('product');
$ItemidStr = '';
$Itemid = shopFunctionsF::getLastVisitedItemId();
if (!empty($Itemid)) {
$ItemidStr = '&Itemid=' . $Itemid;
}
foreach ($viewData['products'] as $type => $products) {
$rowsHeight = shopFunctionsF::calculateProductRowsHeights($products, $currency, $products_per_row);
if (!empty($type) and count($products) > 0) {
$productTitle = vmText::_('COM_VIRTUEMART_' . strtoupper($type) . '_PRODUCT');
?>
<div class="<?php
echo $type;
?>
-view">
<h4><?php
echo $productTitle;
?>
示例4: prepareContinueLink
function prepareContinueLink()
{
$virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId();
$categoryStr = '';
if ($virtuemart_category_id) {
$categoryStr = '&virtuemart_category_id=' . $virtuemart_category_id;
}
$ItemidStr = '';
$Itemid = shopFunctionsF::getLastVisitedItemId();
if (!empty($Itemid)) {
$ItemidStr = '&Itemid=' . $Itemid;
}
$lang = '';
if (VmConfig::$langCount > 1 and !empty(VmConfig::$vmlangSef)) {
$lang = '&lang=' . VmConfig::$vmlangSef;
}
$this->continue_link = JURI::root() . '/index.php?option=com_virtuemart&view=category' . $categoryStr . $lang . $ItemidStr;
$this->continue_link_html = '<a class="continue_link" href="' . $this->continue_link . '">' . vmText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
$this->cart_link = JURI::root() . 'index.php?option=com_virtuemart&view=cart' . $lang;
return;
}
示例5: display
public function display($cachable = false, $urlparams = false)
{
if (VmConfig::get('use_as_catalog', 0)) {
// Get a continue link
$virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId();
$categoryLink = '';
if ($virtuemart_category_id) {
$categoryLink = '&virtuemart_category_id=' . $virtuemart_category_id;
}
$ItemId = shopFunctionsF::getLastVisitedItemId();
$ItemIdLink = '';
if ($ItemId) {
$ItemIdLink = '&Itemid=' . $ItemId;
}
$continue_link = JRoute::_('index.php?option=com_virtuemart&view=category' . $categoryLink . $ItemIdLink, FALSE);
$app = JFactory::getApplication();
$app->redirect($continue_link, 'This is a catalogue, you cannot acccess the cart');
}
$document = JFactory::getDocument();
$viewType = $document->getType();
$tmpl = vRequest::getCmd('tmpl', false);
if ($viewType == 'raw' and $tmpl == 'component') {
$viewType = 'html';
}
$viewName = vRequest::getCmd('view', $this->default_view);
$viewLayout = vRequest::getCmd('layout', 'default');
$view = $this->getView($viewName, $viewType, '', array('layout' => $viewLayout));
$view->assignRef('document', $document);
$cart = VirtueMartCart::getCart();
$cart->order_language = vRequest::getString('order_language', $cart->order_language);
if (!isset($force)) {
$force = VmConfig::get('oncheckout_opc', true);
}
$cart->prepareCartData(false);
$html = true;
if ($cart->virtuemart_shipmentmethod_id == 0 and ($s_id = VmConfig::get('set_automatic_shipment', false)) > 0) {
vRequest::setVar('virtuemart_shipmentmethod_id', $s_id);
$cart->setShipmentMethod($force, !$html);
}
if ($cart->virtuemart_paymentmethod_id == 0 and ($s_id = VmConfig::get('set_automatic_payment', false)) > 0 and $cart->products) {
vRequest::setVar('virtuemart_paymentmethod_id', $s_id);
$cart->setPaymentMethod($force, !$html);
}
$request = vRequest::getRequest();
$task = vRequest::getCmd('task');
if (($task == 'confirm' or isset($request['confirm'])) and !$cart->getInCheckOut()) {
$cart->confirmDone();
$view = $this->getView('cart', 'html');
$view->setLayout('order_done');
$cart->_fromCart = false;
$view->display();
return true;
} else {
//$cart->_inCheckOut = false;
$redirect = (isset($request['checkout']) or $task == 'checkout');
$cart->_inConfirm = false;
$cart->checkoutData($redirect);
}
$cart->_fromCart = false;
$view->display();
return $this;
}
示例6: prepareContinueLink
function prepareContinueLink()
{
$virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId();
$categoryStr = '';
if ($virtuemart_category_id) {
$categoryStr = '&virtuemart_category_id=' . $virtuemart_category_id;
}
$ItemidStr = '';
$Itemid = shopFunctionsF::getLastVisitedItemId();
if (!empty($Itemid)) {
$ItemidStr = '&Itemid=' . $Itemid;
}
$lang = '';
if (VmConfig::$jLangCount > 1 and !empty(VmConfig::$vmlangSef)) {
$lang = '&lang=' . VmConfig::$vmlangSef;
}
$this->continue_link = JURI::root() . 'index.php?option=com_virtuemart&view=category' . $categoryStr . $lang . $ItemidStr;
$this->continue_link_html = '<a class="continue_link" href="' . $this->continue_link . '">' . vmText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
$juri = JUri::getInstance()->toString(array('host', 'port'));
$scheme = 'http';
if (VmConfig::get('useSSL', false)) {
$scheme .= 's';
}
$this->cart_link = $scheme . '://' . $juri . JURI::root(true) . '/index.php?option=com_virtuemart&view=cart' . $lang;
return;
}