本文整理汇总了PHP中shopFunctionsF::setVmTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP shopFunctionsF::setVmTemplate方法的具体用法?PHP shopFunctionsF::setVmTemplate怎么用?PHP shopFunctionsF::setVmTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shopFunctionsF
的用法示例。
在下文中一共展示了shopFunctionsF::setVmTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($tpl = null)
{
$document = JFactory::getDocument();
$layoutName = $this->getLayout();
if (!$layoutName) {
$layoutName = JRequest::getWord('layout', 'default');
}
$this->assignRef('layoutName', $layoutName);
$format = JRequest::getWord('format');
JLoader::register('VirtueMartCart', JPATH_VM_SITE . '/helpers/cart.php');
$cart = VirtueMartCart::getCart();
$this->assignRef('cart', $cart);
$this->prepareContinueLink();
shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName);
parent::display($tpl);
}
示例2: display
public function display($tpl = null)
{
$document = JFactory::getDocument();
$layoutName = $this->getLayout();
if (!$layoutName) {
$layoutName = vRequest::getCmd('layout', 'default');
}
$this->assignRef('layoutName', $layoutName);
$format = vRequest::getCmd('format');
if (!class_exists('VirtueMartCart')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'cart.php';
}
$cart = VirtueMartCart::getCart();
$this->assignRef('cart', $cart);
$this->prepareContinueLink();
shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName);
parent::display($tpl);
}
示例3: display
//.........这里部分代码省略.........
$vendor = $vendorModel->getVendor();
//$this->assignRef('vendor',$vendor);
$categoryModel = VmModel::getModel('category');
$categoryId = JRequest::getInt('virtuemart_category_id', 0);
$this->assignRef('categoryModel', $categoryModel);
// $categoryId = 0; //The idea is that you can choose a parent catgory, this value should come from the joomla view parameter stuff
$category = $categoryModel->getCategory($categoryId);
//if($category->children) $categoryModel->addImages($category->children);
$cache = JFactory::getCache('com_virtuemart', 'callback');
$category->children = $cache->call(array('VirtueMartModelCategory', 'getChildCategoryList'), $vendorId, $categoryId);
//$category->children = $categoryModel->getChildCategoryList($vendorId, $categoryId);
$categoryModel->addImages($category->children, 1);
if (VmConfig::get('enable_content_plugin', 0)) {
// add content plugin //
$dispatcher = JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$category->text = $category->category_description;
if (!class_exists('JParameter')) {
require JPATH_LIBRARIES . DS . 'joomla' . DS . 'html' . DS . 'parameter.php';
}
$params = new JParameter('');
if (JVM_VERSION === 2) {
$results = $dispatcher->trigger('onContentPrepare', array('com_virtuemart.category', &$category, &$params, 0));
// More events for 3rd party content plugins
// This do not disturb actual plugins, because we don't modify $product->text
$res = $dispatcher->trigger('onContentAfterTitle', array('com_virtuemart.category', &$category, &$params, 0));
$category->event->afterDisplayTitle = trim(implode("\n", $res));
$res = $dispatcher->trigger('onContentBeforeDisplay', array('com_virtuemart.category', &$category, &$params, 0));
$category->event->beforeDisplayContent = trim(implode("\n", $res));
$res = $dispatcher->trigger('onContentAfterDisplay', array('com_virtuemart.category', &$category, &$params, 0));
$category->event->afterDisplayContent = trim(implode("\n", $res));
} else {
$results = $dispatcher->trigger('onPrepareContent', array(&$category, &$params, 0));
}
$category->category_description = $category->text;
}
//Add the category name to the pathway
// $pathway->addItem(strip_tags($category->category_name)); //Todo what should be shown up?
// Add the category name to the pathway
if ($category->parents) {
foreach ($category->parents as $c) {
$pathway->addItem(strip_tags($c->category_name), JRoute::_('index.php?option=com_virtuemart&view=categories&virtuemart_category_id=' . $c->virtuemart_category_id));
}
} else {
if (!empty($category->category_name)) {
$pathway->addItem(strip_tags($category->category_name, JRoute::_('index.php?option=com_virtuemart&view=categories&virtuemart_category_id=' . $category->virtuemart_category_id)));
} else {
$pathway->addItem(strip_tags(JText::_('COM_VIRTUEMART_CATEGORY_TOP_LEVEL'), JRoute::_('index.php?option=com_virtuemart&view=categories&virtuemart_category_id=' . $category->virtuemart_category_id)));
}
}
$this->assignRef('category', $category);
/* Set the titles */
if ($category->category_name) {
$document->setTitle($category->category_name);
} else {
$menus = JFactory::getApplication()->getMenu();
$menu = $menus->getActive();
if (!empty($menu)) {
if (!class_exists('JParameter')) {
require JPATH_VM_LIBRARIES . DS . 'joomla' . DS . 'html' . DS . 'parameter.php';
}
$menu_params = new JParameter($menu->params);
}
if (empty($menu) || !$menu_params->get('page_title')) {
$document->setTitle($vendor->vendor_store_name);
$category->category_name = $vendor->vendor_store_name;
} else {
$category->category_name = $menu_params->get('page_title');
}
}
//Todo think about which metatags should be shown in the categories view
if ($category->metadesc) {
$document->setDescription($category->metadesc);
} else {
$document->setDescription($category->category_description);
}
if ($category->metakey) {
$document->setMetaData('keywords', $category->metakey);
}
if ($category->metarobot) {
$document->setMetaData('robots', $category->metarobot);
}
//if ($mainframe->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', strip_tags($category->category_name));
//Maybe better category_name
//}
if ($mainframe->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $category->metaauthor);
}
if ($category->customtitle) {
$title = strip_tags($category->customtitle);
} else {
$title = strip_tags($category->category_name);
}
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
shopFunctionsF::setVmTemplate($this, $category->category_template, 0, $category->category_layout);
parent::display($tpl);
}
示例4: display
//.........这里部分代码省略.........
if ($task == 'addST') {
$this->address_type = 'ST';
}
if (!$new and empty($virtuemart_userinfo_id)) {
$virtuemart_userinfo_id = $this->_model->getBTuserinfo_id();
vmdebug('Try to get $virtuemart_userinfo_id by type BT', $virtuemart_userinfo_id);
}
$userFields = $this->_model->getUserInfoInUserFields($layoutName, $this->address_type, $virtuemart_userinfo_id, false);
if (!$new && empty($userFields[$virtuemart_userinfo_id])) {
$virtuemart_userinfo_id = $this->_model->getBTuserinfo_id();
vmdebug('$userFields by getBTuserinfo_id', $userFields);
}
$userFields = $userFields[$virtuemart_userinfo_id];
}
$this->virtuemart_userinfo_id = $virtuemart_userinfo_id;
$this->assignRef('userFields', $userFields);
if ($layoutName == 'edit') {
if ($this->_model->getId() == 0 && $this->_cuid == 0) {
$button_lbl = tsmText::_('COM_VIRTUEMART_REGISTER');
} else {
$button_lbl = tsmText::_('COM_VIRTUEMART_SAVE');
}
$this->assignRef('button_lbl', $button_lbl);
$this->lUser();
$this->shopper($userFields);
$this->payment();
$this->lOrderlist();
$this->lVendor();
}
$stTask = 'addST';
if ($task == 'editaddresscart') {
$stTask = 'editaddresscart';
}
$this->_lists['shipTo'] = ShopFunctionsF::generateStAddressList($this, $this->_model, $stTask);
$this->assignRef('lists', $this->_lists);
$this->assignRef('editor', $editor);
if ($layoutName == 'mailregisteruser') {
$vendorModel = tmsModel::getModel('vendor');
// $vendorModel->setId($this->_userDetails->virtuemart_vendor_id);
$vendor = $vendorModel->getVendor();
$this->assignRef('vendor', $vendor);
}
if ($layoutName == 'editaddress') {
$layoutName = 'edit_address';
$this->setLayout($layoutName);
}
if (!$this->userDetails->JUser->get('id')) {
$corefield_title = tsmText::_('COM_VIRTUEMART_USER_CART_INFO_CREATE_ACCOUNT');
} else {
$corefield_title = tsmText::_('COM_VIRTUEMART_YOUR_ACCOUNT_DETAILS');
}
if ($this->cart->_fromCart or $this->cart->getInCheckOut()) {
$pathway->addItem(tsmText::_('COM_VIRTUEMART_CART_OVERVIEW'), JRoute::_('index.php?option=com_virtuemart&view=cart', FALSE));
} else {
//$pathway->addItem(vmText::_('COM_VIRTUEMART_YOUR_ACCOUNT_DETAILS'), JRoute::_('index.php?option=com_virtuemart&view=user&&layout=edit'));
}
$pathway_text = tsmText::_('COM_VIRTUEMART_YOUR_ACCOUNT_DETAILS');
if (!$this->userDetails->JUser->get('id')) {
if ($this->cart->_fromCart or $this->cart->getInCheckOut()) {
if ($this->address_type == 'BT') {
$vmfield_title = tsmText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL');
} else {
$vmfield_title = tsmText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL');
}
} else {
if ($this->address_type == 'BT') {
$vmfield_title = tsmText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL');
$title = tsmText::_('COM_VIRTUEMART_REGISTER');
} else {
$vmfield_title = tsmText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL');
}
}
} else {
if ($this->address_type == 'BT') {
$vmfield_title = tsmText::_('COM_VIRTUEMART_USER_FORM_BILLTO_LBL');
} else {
$vmfield_title = tsmText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL');
}
}
vmJsApi::vmValidator($this->userDetails->JUser->guest);
$this->add_product_link = "";
$this->manage_link = "";
if (ShopFunctionsF::isFEmanager()) {
$mlnk = JURI::root() . 'index.php?option=com_virtuemart&tmpl=component&manage=1';
$this->manage_link = $this->linkIcon($mlnk, 'JACTION_MANAGE', 'new', false, false, true, true);
}
if (ShopFunctionsF::isFEmanager('product.edit')) {
$aplnk = JURI::root() . 'index.php?option=com_virtuemart&tmpl=component&view=product&view=product&task=edit&virtuemart_product_id=0&manage=1';
$this->add_product_link = $this->linkIcon($aplnk, 'COM_VIRTUEMART_PRODUCT_ADD_PRODUCT', 'new', false, false, true, true);
}
$document = JFactory::getDocument();
$document->setTitle($pathway_text);
$pathway->additem($pathway_text);
$document->setMetaData('robots', 'NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET');
$this->assignRef('page_title', $pathway_text);
$this->assignRef('corefield_title', $corefield_title);
$this->assignRef('vmfield_title', $vmfield_title);
shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName);
parent::display($tpl);
}
示例5: display
//.........这里部分代码省略.........
$virtuemart_userinfo_id = $this->_model->getBTuserinfo_id();
// vmdebug('Try to get $virtuemart_userinfo_id by type BT', $virtuemart_userinfo_id);
}
$userFields = $userFields[$virtuemart_userinfo_id];
$task = 'editaddressST';
}
//print_r( $userFields);
$this->assignRef('userFields', $userFields);
if ($layoutName == 'edit') {
if ($this->_model->getId() == 0 && $this->_cuid == 0) {
$button_lbl = JText::_('COM_VIRTUEMART_REGISTER');
} else {
$button_lbl = JText::_('COM_VIRTUEMART_SAVE');
}
$this->assignRef('button_lbl', $button_lbl);
$this->lUser();
$this->shopper($userFields);
$this->payment();
$this->lOrderlist();
$this->lVendor();
}
$this->_lists['shipTo'] = ShopFunctions::generateStAddressList($this, $this->_model, $task);
if ($this->_openTab < 0) {
$_paneOffset = array();
} else {
if (__VM_USER_USE_SLIDERS) {
$_paneOffset = array('startOffset' => $this->_openTab, 'startTransition' => 1, 'allowAllClose' => true);
} else {
$_paneOffset = array('startOffset' => $this->_openTab);
}
}
// Implement the Joomla panels. If we need a ShipTo tab, make it the active one.
// In tmpl/edit.php, this is the 4th tab (0-based, so set to 3 above)
jimport('joomla.html.pane');
$pane = JPane::getInstance(__VM_USER_USE_SLIDERS ? 'Sliders' : 'Tabs', $_paneOffset);
$this->assignRef('lists', $this->_lists);
$this->assignRef('editor', $editor);
$this->assignRef('pane', $pane);
if ($layoutName == 'mailregisteruser') {
$vendorModel = VmModel::getModel('vendor');
// $vendorModel->setId($this->_userDetails->virtuemart_vendor_id);
$vendor = $vendorModel->getVendor();
$this->assignRef('vendor', $vendor);
}
if ($layoutName == 'editaddress') {
$layoutName = 'edit_address';
$this->setLayout($layoutName);
}
if (!$this->userDetails->JUser->get('id')) {
$corefield_title = JText::_('COM_VIRTUEMART_USER_CART_INFO_CREATE_ACCOUNT');
} else {
$corefield_title = JText::_('COM_VIRTUEMART_YOUR_ACCOUNT_DETAILS');
}
if (strpos($this->fTask, 'cart') || strpos($this->fTask, 'checkout')) {
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_OVERVIEW'), JRoute::_('index.php?option=com_virtuemart&view=cart', FALSE));
} else {
//$pathway->addItem(JText::_('COM_VIRTUEMART_YOUR_ACCOUNT_DETAILS'), JRoute::_('index.php?option=com_virtuemart&view=user&&layout=edit'));
}
$pathway_text = JText::_('COM_VIRTUEMART_YOUR_ACCOUNT_DETAILS');
if (!$this->userDetails->JUser->get('id')) {
if (strpos($this->fTask, 'cart') || strpos($this->fTask, 'checkout')) {
if ($address_type == 'BT') {
$vmfield_title = JText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL');
} else {
$vmfield_title = JText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL');
}
} else {
if ($address_type == 'BT') {
$vmfield_title = JText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL');
$title = JText::_('COM_VIRTUEMART_REGISTER');
} else {
$vmfield_title = JText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL');
}
}
} else {
if ($address_type == 'BT') {
$vmfield_title = JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_LBL');
} else {
$vmfield_title = JText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL');
}
}
$add_product_link = "";
if (!class_exists('Permissions')) {
require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'permissions.php';
}
if (!Permissions::getInstance()->isSuperVendor() or Vmconfig::get('multix', 'none') !== 'none') {
$add_product_link = JRoute::_('/index.php?option=com_virtuemart&tmpl=component&view=product&view=product&task=edit&virtuemart_product_id=0');
$add_product_link = $this->linkIcon($add_product_link, 'COM_VIRTUEMART_PRODUCT_ADD_PRODUCT', 'new', false, false, true, true);
}
$this->assignRef('add_product_link', $add_product_link);
$document = JFactory::getDocument();
$document->setTitle($pathway_text);
$pathway->additem($pathway_text);
$document->setMetaData('robots', 'NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET');
$this->assignRef('page_title', $pathway_text);
$this->assignRef('corefield_title', $corefield_title);
$this->assignRef('vmfield_title', $vmfield_title);
shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName);
parent::display($tpl);
}
示例6: display
//.........这里部分代码省略.........
$this->assignRef('allowReview', $allowReview);
$showReview = $ratingModel->showReview($product->virtuemart_product_id);
$this->assignRef('showReview', $showReview);
if ($showReview) {
$review = $ratingModel->getReviewByProduct($product->virtuemart_product_id);
$this->assignRef('review', $review);
$rating_reviews = $ratingModel->getReviews($product->virtuemart_product_id);
$this->assignRef('rating_reviews', $rating_reviews);
}
$showRating = $ratingModel->showRating($product->virtuemart_product_id);
$this->assignRef('showRating', $showRating);
if ($showRating) {
$vote = $ratingModel->getVoteByProduct($product->virtuemart_product_id);
$this->assignRef('vote', $vote);
$rating = $ratingModel->getRatingByProduct($product->virtuemart_product_id);
$this->assignRef('rating', $rating);
}
$allowRating = $ratingModel->allowRating($product->virtuemart_product_id);
$this->assignRef('allowRating', $allowRating);
// Check for editing access
// @todo build edit page
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
//if (Permissions::getInstance()->check("admin,storeadmin")) {
$perm = Permissions::getInstance();
$admin = $perm->check("admin");
if (!$admin) {
vmdebug('No admin');
}
$storeadmin = $perm->check("admin,storeadmin");
if (!$storeadmin) {
vmdebug('No $storeadmin');
}
$superVendor = $perm->isSuperVendor();
if (!$superVendor) {
vmdebug('No $superVendor');
}
if ($admin or $perm->isSuperVendor() == $product->virtuemart_vendor_id and $storeadmin) {
$edit_link = JURI::root() . 'index.php?option=com_virtuemart&tmpl=component&view=product&task=edit&virtuemart_product_id=' . $product->virtuemart_product_id;
$edit_link = $this->linkIcon($edit_link, 'COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT', 'edit', false, false);
} else {
$edit_link = "";
}
$this->assignRef('edit_link', $edit_link);
// todo: atm same form for "call for price" and "ask a question". Title of the form should be different
$askquestion_url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id . '&tmpl=component', FALSE);
$this->assignRef('askquestion_url', $askquestion_url);
// Load the user details
$user = JFactory::getUser();
$this->assignRef('user', $user);
// More reviews link
$uri = JURI::getInstance();
$uri->setVar('showall', 1);
$uristring = vmURI::getCleanUrl();
$this->assignRef('more_reviews', $uristring);
if ($product->metadesc) {
$document->setDescription($product->metadesc);
}
if ($product->metakey) {
$document->setMetaData('keywords', $product->metakey);
}
if ($product->metarobot) {
$document->setMetaData('robots', $product->metarobot);
}
if ($mainframe->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', $product->product_name);
//Maybe better product_name
}
if ($mainframe->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $product->metaauthor);
}
$showBasePrice = Permissions::getInstance()->check('admin');
//todo add config settings
$this->assignRef('showBasePrice', $showBasePrice);
$productDisplayShipments = array();
$productDisplayPayments = array();
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayShipment', array($product, &$productDisplayShipments));
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayPayment', array($product, &$productDisplayPayments));
$this->assignRef('productDisplayPayments', $productDisplayPayments);
$this->assignRef('productDisplayShipments', $productDisplayShipments);
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
shopFunctionsF::setVmTemplate($this, $category->category_template, $product->product_template, $category->category_product_layout, $product->layout);
shopFunctionsF::addProductToRecent($virtuemart_product_id);
$currency = CurrencyDisplay::getInstance();
$this->assignRef('currency', $currency);
if (JRequest::getCmd('layout', 'default') == 'notify') {
$this->setLayout('notify');
}
//Added by Seyi Awofadeju to catch notify layout
parent::display($tpl);
}
示例7: display
//.........这里部分代码省略.........
if ($format == 'raw') {
$cart->prepareCartViewData();
JRequest::setVar('layout', 'mini_cart');
$this->setLayout('mini_cart');
$this->prepareContinueLink();
}
/*
if($layoutName=='edit_coupon'){
$cart->prepareCartViewData();
$this->lSelectCoupon();
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_OVERVIEW'),JRoute::_('index.php?option=com_virtuemart&view=cart'));
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_SELECTCOUPON'));
$document->setTitle(JText::_('COM_VIRTUEMART_CART_SELECTCOUPON'));
} else */
if ($layoutName == 'select_shipment') {
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
$this->lSelectShipment();
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_OVERVIEW'), JRoute::_('index.php?option=com_virtuemart&view=cart'));
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_SELECTSHIPMENT'));
$document->setTitle(JText::_('COM_VIRTUEMART_CART_SELECTSHIPMENT'));
} else {
if ($layoutName == 'select_payment') {
/* Load the cart helper */
// $cartModel = VmModel::getModel('cart');
$this->lSelectPayment();
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_OVERVIEW'), JRoute::_('index.php?option=com_virtuemart&view=cart'));
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_SELECTPAYMENT'));
$document->setTitle(JText::_('COM_VIRTUEMART_CART_SELECTPAYMENT'));
} else {
if ($layoutName == 'order_done') {
$this->lOrderDone();
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_THANKYOU'));
$document->setTitle(JText::_('COM_VIRTUEMART_CART_THANKYOU'));
} else {
if ($layoutName == 'default') {
$cart->prepareCartViewData();
$cart->prepareAddressRadioSelection();
$this->prepareContinueLink();
$this->lSelectCoupon();
$currencyDisplay = CurrencyDisplay::getInstance($this->cart->pricesCurrency);
$this->assignRef('currencyDisplay', $currencyDisplay);
$totalInPaymentCurrency = $this->getTotalInPaymentCurrency();
$checkoutAdvertise = $this->getCheckoutAdvertise();
if ($cart && !VmConfig::get('use_as_catalog', 0)) {
$cart->checkout(false);
}
if ($cart->getDataValidated()) {
$pathway->addItem(JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$document->setTitle(JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$text = JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
$checkout_task = 'confirm';
} else {
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$document->setTitle(JText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$text = JText::_('COM_VIRTUEMART_CHECKOUT_TITLE');
$checkout_task = 'checkout';
}
$this->assignRef('checkout_task', $checkout_task);
$this->checkPaymentMethodsConfigured();
$this->checkShipmentMethodsConfigured();
if ($cart->virtuemart_shipmentmethod_id) {
$shippingText = JText::_('COM_VIRTUEMART_CART_CHANGE_SHIPPING');
} else {
$shippingText = JText::_('COM_VIRTUEMART_CART_EDIT_SHIPPING');
}
$this->assignRef('select_shipment_text', $shippingText);
if ($cart->virtuemart_paymentmethod_id) {
$paymentText = JText::_('COM_VIRTUEMART_CART_CHANGE_PAYMENT');
} else {
$paymentText = JText::_('COM_VIRTUEMART_CART_EDIT_PAYMENT');
}
$this->assignRef('select_payment_text', $paymentText);
if (!VmConfig::get('use_as_catalog')) {
$checkout_link_html = '<a class="vm-button-correct" href="javascript:document.checkoutForm.submit();" ><span>' . $text . '</span></a>';
} else {
$checkout_link_html = '';
}
$this->assignRef('checkout_link_html', $checkout_link_html);
}
}
}
}
//dump ($cart,'cart');
$useSSL = VmConfig::get('useSSL', 0);
$useXHTML = true;
$this->assignRef('useSSL', $useSSL);
$this->assignRef('useXHTML', $useXHTML);
$this->assignRef('totalInPaymentCurrency', $totalInPaymentCurrency);
$this->assignRef('checkoutAdvertise', $checkoutAdvertise);
// @max: quicknirty
$cart->setCartIntoSession();
shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName);
// vmdebug('my cart ',$cart);
parent::display($tpl);
}
示例8: display
//.........这里部分代码省略.........
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_SELECTPAYMENT'));
$document->setTitle(JText::_('COM_VIRTUEMART_CART_SELECTPAYMENT'));
} else {
if ($layoutName == 'order_done') {
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
$this->lOrderDone();
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_THANKYOU'));
$document->setTitle(JText::_('COM_VIRTUEMART_CART_THANKYOU'));
} else {
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
$cart->prepareCartViewData();
if (VmConfig::get('enable_content_plugin', 0)) {
shopFunctionsF::triggerContentPlugin($cart->vendor, 'vendor', 'vendor_terms_of_service');
}
$cart->prepareAddressRadioSelection();
$this->prepareContinueLink();
$this->lSelectCoupon();
$totalInPaymentCurrency = $this->getTotalInPaymentCurrency();
$checkoutAdvertise = $this->getCheckoutAdvertise();
if (!$cart->_inCheckOut and !VmConfig::get('use_as_catalog', 0)) {
$cart->checkout(false);
}
if ($cart->getDataValidated()) {
if ($this->cart->_inConfirm) {
$pathway->addItem(vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM_MNU'));
$document->setTitle(vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM_MNU'));
$text = vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM');
$this->checkout_task = 'cancel';
} else {
$pathway->addItem(vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$document->setTitle(vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$text = vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
$this->checkout_task = 'confirm';
}
} else {
$pathway->addItem(JText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$document->setTitle(JText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$text = JText::_('COM_VIRTUEMART_CHECKOUT_TITLE');
$this->checkout_task = 'checkout';
}
if (VmConfig::get('oncheckout_opc', 1)) {
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$this->lSelectShipment();
$this->lSelectPayment();
} else {
$this->checkPaymentMethodsConfigured();
$this->checkShipmentMethodsConfigured();
}
if ($cart->virtuemart_shipmentmethod_id) {
$shippingText = JText::_('COM_VIRTUEMART_CART_CHANGE_SHIPPING');
} else {
$shippingText = JText::_('COM_VIRTUEMART_CART_EDIT_SHIPPING');
}
$this->assignRef('select_shipment_text', $shippingText);
if ($cart->virtuemart_paymentmethod_id) {
$paymentText = JText::_('COM_VIRTUEMART_CART_CHANGE_PAYMENT');
} else {
$paymentText = JText::_('COM_VIRTUEMART_CART_EDIT_PAYMENT');
}
$this->assignRef('select_payment_text', $paymentText);
if (!VmConfig::get('use_as_catalog')) {
//$checkout_link_html = '<a name="'.$checkout_task.'" class="vm-button-correct" href="javascript:document.checkoutForm.submit();" ><span>' . $text . '</span></a>';
$checkout_link_html = '<br><button name="' . $this->checkout_task . '" id="checkoutFormSubmit" class="vm-button-correct" ><span>' . $text . '</span></button>';
} else {
$checkout_link_html = '';
}
$this->assignRef('checkout_link_html', $checkout_link_html);
$layoutName = $this->cart->layout;
//set order language
$lang = JFactory::getLanguage();
$order_language = $lang->getTag();
$this->assignRef('order_language', $order_language);
}
}
}
//dump ($cart,'cart');
$useSSL = VmConfig::get('useSSL', 0);
$useXHTML = false;
$this->assignRef('useSSL', $useSSL);
$this->assignRef('useXHTML', $useXHTML);
$this->assignRef('totalInPaymentCurrency', $totalInPaymentCurrency);
$this->assignRef('checkoutAdvertise', $checkoutAdvertise);
// @max: quicknirty
$cart->setCartIntoSession();
//$this->setLayout($this->cart->layout);
shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName);
//We never want that the cart is indexed
$document->setMetaData('robots', 'NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET');
if ($this->cart->_inConfirm) {
vmInfo('COM_VIRTUEMART_IN_CONFIRM');
}
if ($this->cart->layoutPath) {
$this->addTemplatePath($this->cart->layoutPath);
}
parent::display($tpl);
}
示例9: display
//.........这里部分代码省略.........
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
$showBasePrice = Permissions::getInstance()->check('admin');
//todo add config settings
$this->assignRef('showBasePrice', $showBasePrice);
}
//No redirect here, for category id = 0 means show ALL categories! note by Max Milbers
if (!empty($categoryId) and $categoryId !== -1 and (empty($category->slug) or !$category->published)) {
if (empty($category->slug)) {
vmInfo(JText::_('COM_VIRTUEMART_CAT_NOT_FOUND'));
} else {
if ($category->virtuemart_id !== 0 and !$category->published) {
vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL', $category->category_name, $categoryId);
}
}
//Fallback
$categoryLink = '';
if ($category->category_parent_id) {
$categoryLink = '&view=category&virtuemart_category_id=' . $category->category_parent_id;
} else {
$last_category_id = shopFunctionsF::getLastVisitedCategoryId();
if (!$last_category_id or $categoryId == $last_category_id) {
$last_category_id = JRequest::getInt('virtuemart_category_id', false);
}
if ($last_category_id and $categoryId != $last_category_id) {
$categoryLink = '&view=category&virtuemart_category_id=' . $last_category_id;
}
}
$app->redirect(JRoute::_('index.php?option=com_virtuemart' . $categoryLink . '&error=404', FALSE));
return;
}
shopFunctionsF::setLastVisitedCategoryId($categoryId);
shopFunctionsF::setLastVisitedManuId($virtuemart_manufacturer_id);
// Add the category name to the pathway
if ($category->parents) {
foreach ($category->parents as $c) {
$pathway->addItem(strip_tags($c->category_name), JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $c->virtuemart_category_id, FALSE));
}
}
$categoryModel->addImages($category, 1);
$cache = JFactory::getCache('com_virtuemart', 'callback');
$category->children = $cache->call(array('VirtueMartModelCategory', 'getChildCategoryList'), $vendorId, $categoryId, $categoryModel->getDefaultOrdering(), $categoryModel->_selectedOrderingDir);
$categoryModel->addImages($category->children, 1);
if (VmConfig::get('enable_content_plugin', 0)) {
shopFunctionsF::triggerContentPlugin($category, 'category', 'category_description');
}
if ($category->metadesc) {
$document->setDescription($category->metadesc);
}
if ($category->metakey) {
$document->setMetaData('keywords', $category->metakey);
}
if ($category->metarobot) {
$document->setMetaData('robots', $category->metarobot);
}
if ($app->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $category->metaauthor);
}
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
shopFunctionsF::setVmTemplate($this, $category->category_template, 0, $category->category_layout);
} else {
//Backward compatibility
if (!isset($category)) {
$category = new stdClass();
$category->category_name = '';
$category->category_description = '';
$category->haschildren = false;
}
}
$this->assignRef('category', $category);
// Set the titles
if (!empty($category->customtitle)) {
$title = strip_tags($category->customtitle);
} elseif (!empty($category->category_name)) {
$title = strip_tags($category->category_name);
} else {
$title = $this->setTitleByJMenu($app);
}
if (JRequest::getInt('error')) {
$title .= ' ' . JText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND');
}
if (!empty($keyword)) {
$title .= ' (' . $keyword . ')';
}
if ($virtuemart_manufacturer_id and !empty($products[0])) {
$title .= ' ' . $products[0]->mf_name;
}
$document->setTitle($title);
// Override Category name when viewing manufacturers products !IMPORTANT AFTER page title.
if (JRequest::getInt('virtuemart_manufacturer_id') and !empty($products[0]) and isset($category->category_name)) {
$category->category_name = $products[0]->mf_name;
}
if ($app->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', $title);
}
parent::display($tpl);
}
示例10: display
public function display($tpl = null)
{
$document = JFactory::getDocument();
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
/* Set the helper path */
$this->addHelperPath(JPATH_VM_ADMINISTRATOR . DS . 'helpers');
//Load helpers
$this->loadHelper('image');
$vendorId = JRequest::getInt('vendorid', 1);
$vendorModel = VmModel::getModel('vendor');
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
//$this->assignRef('vendor',$vendor);
$categoryModel = VmModel::getModel('category');
$categoryId = JRequest::getInt('virtuemart_category_id', 0);
$this->assignRef('categoryModel', $categoryModel);
// $categoryId = 0; //The idea is that you can choose a parent catgory, this value should come from the joomla view parameter stuff
$category = $categoryModel->getCategory($categoryId);
//if($category->children) $categoryModel->addImages($category->children);
$cache = JFactory::getCache('com_virtuemart', 'callback');
$category->children = $cache->call(array('VirtueMartModelCategory', 'getChildCategoryList'), $vendorId, $categoryId);
//$category->children = $categoryModel->getChildCategoryList($vendorId, $categoryId);
$categoryModel->addImages($category->children, 1);
//Add the category name to the pathway
// $pathway->addItem(strip_tags($category->category_name)); //Todo what should be shown up?
// Add the category name to the pathway
if ($category->parents) {
foreach ($category->parents as $c) {
$pathway->addItem(strip_tags($c->category_name), JRoute::_('index.php?option=com_virtuemart&view=categories&virtuemart_category_id=' . $c->virtuemart_category_id));
}
} else {
if (!empty($category->category_name)) {
$pathway->addItem(strip_tags($category->category_name, JRoute::_('index.php?option=com_virtuemart&view=categories&virtuemart_category_id=' . $category->virtuemart_category_id)));
} else {
$pathway->addItem(strip_tags(JText::_('COM_VIRTUEMART_CATEGORY_TOP_LEVEL'), JRoute::_('index.php?option=com_virtuemart&view=categories&virtuemart_category_id=' . $category->virtuemart_category_id)));
}
}
$this->assignRef('category', $category);
/* Set the titles */
if ($category->category_name) {
$document->setTitle($category->category_name);
} else {
$menus =& JSite::getMenu();
$menu = $menus->getActive();
if (!empty($menu)) {
if (!class_exists('JParameter')) {
require JPATH_VM_LIBRARIES . DS . 'joomla' . DS . 'html' . DS . 'parameter.php';
}
$menu_params = new JParameter($menu->params);
}
if (empty($menu) || !$menu_params->get('page_title')) {
$document->setTitle($vendor->vendor_store_name);
$category->category_name = $vendor->vendor_store_name;
} else {
$category->category_name = $menu_params->get('page_title');
}
}
//Todo think about which metatags should be shown in the categories view
if ($category->metadesc) {
$document->setDescription($category->metadesc);
} else {
$document->setDescription($category->category_description);
}
if ($category->metakey) {
$document->setMetaData('keywords', $category->metakey);
}
if ($category->metarobot) {
$document->setMetaData('robots', $category->metarobot);
}
//if ($mainframe->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', strip_tags($category->category_name));
//Maybe better category_name
//}
if ($mainframe->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $category->metaauthor);
}
if ($category->customtitle) {
$title = strip_tags($category->customtitle);
} else {
$title = strip_tags($category->category_name);
}
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
shopFunctionsF::setVmTemplate($this, $category->category_template, 0, $category->category_layout);
parent::display($tpl);
}
示例11: display
//.........这里部分代码省略.........
$category = $category_model->getCategory($product->virtuemart_category_id);
$category_model->addImages($category, 1);
$this->assignRef('category', $category);
//Seems we dont need this anylonger, destroyed the breadcrumb
if ($category->parents) {
foreach ($category->parents as $c) {
if (is_object($c) and isset($c->category_name)) {
$pathway->addItem(strip_tags($c->category_name), JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $c->virtuemart_category_id, FALSE));
$catTitle[] = $c->category_name;
} else {
vmdebug('Error, parent category has no name, breadcrumb maybe broken, category', $c);
}
}
}
$vendorId = JRequest::getInt('virtuemart_vendor_id', null);
$category->children = $category_model->getChildCategoryList($vendorId, $product->virtuemart_category_id);
$category_model->addImages($category->children, 1);
}
if (!empty($tpl)) {
$format = $tpl;
} else {
$format = JRequest::getWord('format', 'html');
}
if ($format == 'html') {
// Set Canonic link
$document->addHeadLink($product->canonical, 'canonical', 'rel', '');
}
$uri = JURI::getInstance();
//$pathway->addItem(JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), $uri->toString(array('path', 'query', 'fragment')));
$pathway->addItem(strip_tags($product->product_name));
// Set the titles
// $document->setTitle should be after the additem pathway
if ($product->customtitle) {
$document->setTitle(strip_tags($product->customtitle));
} else {
$document->setTitle(($catTitle ? implode(" / ", $catTitle) . ' / ' : '') . $product->product_name);
}
$ratingModel = VmModel::getModel('ratings');
$this->allowReview = $ratingModel->allowReview($product->virtuemart_product_id);
$this->showReview = $ratingModel->showReview($product->virtuemart_product_id);
if ($this->showReview) {
$this->review = $ratingModel->getReviewByProduct($product->virtuemart_product_id);
$this->rating_reviews = $ratingModel->getReviews($product->virtuemart_product_id);
}
$this->showRating = $ratingModel->showRating($product->virtuemart_product_id);
if ($this->showRating) {
$this->vote = $ratingModel->getVoteByProduct($product->virtuemart_product_id);
$this->rating = $ratingModel->getRatingByProduct($product->virtuemart_product_id);
}
$this->allowRating = $ratingModel->allowRating($product->virtuemart_product_id);
// todo: atm same form for "call for price" and "ask a question". Title of the form should be different
$this->askquestion_url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id . '&tmpl=component', FALSE);
// Load the user details
$this->user = JFactory::getUser();
// More reviews link
$uri = JURI::getInstance();
$uri->setVar('showall', 1);
$uristring = $uri->toString();
$this->more_reviews = $uristring;
if ($product->metadesc) {
$document->setDescription($product->metadesc);
}
if ($product->metakey) {
$document->setMetaData('keywords', $product->metakey);
}
if ($product->metarobot) {
$document->setMetaData('robots', $product->metarobot);
}
if ($app->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', $product->product_name);
//Maybe better product_name
}
if ($app->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $product->metaauthor);
}
$this->showBasePrice = Permissions::getInstance()->check('admin');
//todo add config settings
$productDisplayShipments = array();
$productDisplayPayments = array();
JLoader::register('vmPSPlugin', JPATH_VM_PLUGINS . 'vmpsplugin.php');
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayShipment', array($product, &$productDisplayShipments));
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayPayment', array($product, &$productDisplayPayments));
$this->productDisplayPayments = $productDisplayPayments;
$this->productDisplayShipments = $productDisplayShipments;
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
$this->product = $product;
shopFunctionsF::setVmTemplate($this, $category->category_template, $product->product_template, $category->category_product_layout, $product->layout);
shopFunctionsF::addProductToRecent($virtuemart_product_id);
$this->currency = CurrencyDisplay::getInstance();
if (JRequest::getCmd('layout', 'default') == 'notify') {
$this->setLayout('notify');
}
//Added by Seyi Awofadeju to catch notify layout
parent::display($tpl);
}
示例12: display
//.........这里部分代码省略.........
$showReview = $ratingModel->showReview($product->virtuemart_product_id);
$this->assignRef('showReview', $showReview);
if ($showReview) {
$review = $ratingModel->getReviewByProduct($product->virtuemart_product_id);
$this->assignRef('review', $review);
$rating_reviews = $ratingModel->getReviews($product->virtuemart_product_id);
$this->assignRef('rating_reviews', $rating_reviews);
}
$showRating = $ratingModel->showRating($product->virtuemart_product_id);
$this->assignRef('showRating', $showRating);
if ($showRating) {
$vote = $ratingModel->getVoteByProduct($product->virtuemart_product_id);
$this->assignRef('vote', $vote);
$rating = $ratingModel->getRatingByProduct($product->virtuemart_product_id);
$this->assignRef('rating', $rating);
}
$allowRating = $ratingModel->allowRating($product->virtuemart_product_id);
$this->assignRef('allowRating', $allowRating);
// Check for editing access
// @todo build edit page
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
//if (Permissions::getInstance()->check("admin,storeadmin")) {
$perm = Permissions::getInstance();
$admin = $perm->check("admin");
if (!$admin) {
vmdebug('No admin');
}
$storeadmin = $perm->check("admin,storeadmin");
if (!$storeadmin) {
vmdebug('No $storeadmin');
}
$superVendor = $perm->isSuperVendor();
if (!$superVendor) {
vmdebug('No $superVendor');
}
if ($admin or $perm->isSuperVendor() == $product->virtuemart_vendor_id and $storeadmin) {
$edit_link = JURI::root() . 'index.php?option=com_virtuemart&tmpl=component&view=product&task=edit&virtuemart_product_id=' . $product->virtuemart_product_id;
$edit_link = $this->linkIcon($edit_link, 'COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT', 'edit', false, false);
} else {
$edit_link = "";
}
$this->assignRef('edit_link', $edit_link);
// todo: atm same form for "call for price" and "ask a question". Title of the form should be different
$askquestion_url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id . '&tmpl=component');
$this->assignRef('askquestion_url', $askquestion_url);
// Load the user details
$user = JFactory::getUser();
$this->assignRef('user', $user);
// More reviews link
$uri = JURI::getInstance();
$uri->setVar('showall', 1);
$uristring = $uri->toString();
$this->assignRef('more_reviews', $uristring);
if ($product->metarobot) {
$document->setMetaData('robots', $product->metarobot);
}
if ($mainframe->getCfg('MetaTitle') == '1') {
// $document->setMetaData('title', $product->product_name); //Maybe better product_name
$document->setMetaData('title', $product->customtitle);
//Utilizzato il titolo custom compilato in automatico durante l'import
}
if ($mainframe->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $product->metaauthor);
}
if ($product->metadesc) {
$document->setDescription($product->metadesc);
}
if ($product->metakey) {
$document->setMetaData('keywords', $product->metakey);
}
$showBasePrice = Permissions::getInstance()->check('admin');
//todo add config settings
$this->assignRef('showBasePrice', $showBasePrice);
$productDisplayShipments = array();
$productDisplayPayments = array();
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayShipment', array($product, &$productDisplayShipments));
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayPayment', array($product, &$productDisplayPayments));
$this->assignRef('productDisplayPayments', $productDisplayPayments);
$this->assignRef('productDisplayShipments', $productDisplayShipments);
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
shopFunctionsF::setVmTemplate($this, $category->category_template, $product->product_template, $category->category_layout, $product->layout);
shopFunctionsF::addProductToRecent($virtuemart_product_id);
$currency = CurrencyDisplay::getInstance();
$this->assignRef('currency', $currency);
if (JRequest::getCmd('layout', 'default') == 'notify') {
$this->setLayout('notify');
}
//Added by Seyi Awofadeju to catch notify layout
parent::display($tpl);
}
示例13: display
//.........这里部分代码省略.........
}
shopFunctionsF::setLastVisitedCategoryId($this->categoryId);
shopFunctionsF::setLastVisitedManuId($virtuemart_manufacturer_id);
// Add the category name to the pathway
if ($category->parents) {
foreach ($category->parents as $c) {
$pathway->addItem(strip_tags(vmText::_($c->category_name)), JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $c->virtuemart_category_id, FALSE));
}
}
$catImgAmount = VmConfig::get('catimg_browse', 1);
$categoryModel->addImages($category, $catImgAmount);
if (!isset($menu->query['showcategory'])) {
$menu->query['showcategory'] = 1;
}
$this->showcategory = vRequest::getInt('showcategory', $menu->query['showcategory']);
//$this->showcategory = vRequest::getInt('showcategory',true);
if ($this->showcategory) {
//if($category->category_layout == 'categories' or ($this->categoryId >0 and $virtuemart_manufacturer_id <1)){
$category->children = $categoryModel->getChildCategoryList($vendorId, $this->categoryId, $categoryModel->getDefaultOrdering(), $categoryModel->_selectedOrderingDir);
$categoryModel->addImages($category->children, $catImgAmount);
} else {
$category->children = false;
}
if (VmConfig::get('enable_content_plugin', 0)) {
shopFunctionsF::triggerContentPlugin($category, 'category', 'category_description');
}
$metadesc = '';
$metakey = '';
$metarobot = '';
if (isset($menu->params)) {
$metadesc = $menu->params->get('menu-meta_description');
$metakey = $menu->params->get('menu-meta_keywords');
$metarobot = $menu->params->get('robots');
}
if ($category->metadesc) {
$metadesc = $category->metadesc;
}
if ($category->metakey) {
$metakey = $category->metakey;
}
if ($category->metarobot) {
$metarobot = $category->metarobot;
}
$document->setDescription($metadesc);
$document->setMetaData('keywords', $metakey);
$document->setMetaData('robots', $metarobot);
if ($app->getCfg('MetaAuthor') == '1' and !empty($category->metaauthor)) {
$document->setMetaData('author', $category->metaauthor);
}
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
if (!empty($menu->query['categorylayout'])) {
//if(!empty($menu->query['categorylayout']) and $menu->query['virtuemart_category_id']==$this->categoryId){
$category->category_layout = $menu->query['categorylayout'];
}
$productsLayout = VmConfig::get('productsublayout', 'products');
if (empty($productsLayout)) {
$productsLayout = 'products';
}
$this->productsLayout = empty($menu->query['productsublayout']) ? $productsLayout : $menu->query['productsublayout'];
shopFunctionsF::setVmTemplate($this, $category->category_template, 0, $category->category_layout);
} else {
//Backward compatibility
if (!isset($category)) {
$category = new stdClass();
$category->category_name = '';
$category->category_description = '';
$category->haschildren = false;
}
}
$this->assignRef('category', $category);
// Set the titles
if (!empty($category->customtitle)) {
$title = strip_tags($category->customtitle);
} elseif (!empty($category->category_name)) {
$title = strip_tags($category->category_name);
} else {
$title = $this->setTitleByJMenu($app);
}
$title = vmText::_($title);
if (vRequest::getInt('error')) {
$title .= ' ' . vmText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND');
}
if (!empty($keyword)) {
$title .= ' (' . strip_tags(htmlspecialchars_decode($keyword)) . ')';
}
if ($virtuemart_manufacturer_id > 0 and !empty($this->products[0])) {
$title .= ' ' . $this->products[0]->mf_name;
}
$document->setTitle($title);
// Override Category name when viewing manufacturers products !IMPORTANT AFTER page title.
if ($virtuemart_manufacturer_id > 0 and !empty($this->products[0]) and isset($category->category_name)) {
$category->category_name = $this->products[0]->mf_name;
}
if ($app->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', $title);
}
parent::display($tpl);
}
示例14: display
//.........这里部分代码省略.........
$parent = $product_model->getProduct($product->product_parent_id);
$document->addHeadLink($parent->canonical, 'canonical', 'rel', '');
} else {
$document->addHeadLink($product->canonical, 'canonical', 'rel', '');
}
} else {
if ($format == 'pdf') {
defined('K_PATH_IMAGES') or define('K_PATH_IMAGES', VMPATH_ROOT);
}
}
// Set the titles
// $document->setTitle should be after the additem pathway
if ($product->customtitle) {
$document->setTitle(strip_tags(html_entity_decode($product->customtitle, ENT_QUOTES)));
} else {
$document->setTitle(strip_tags(html_entity_decode(($category->category_name ? vmText::_($category->category_name) . ' : ' : '') . $product->product_name, ENT_QUOTES)));
}
$this->allowReview = $ratingModel->allowReview($product->virtuemart_product_id);
$this->showReview = $ratingModel->showReview($product->virtuemart_product_id);
$this->rating_reviews = '';
if ($this->showReview) {
$this->review = $ratingModel->getReviewByProduct($product->virtuemart_product_id);
$this->rating_reviews = $ratingModel->getReviews($product->virtuemart_product_id);
}
if ($this->showRating) {
$this->vote = $ratingModel->getVoteByProduct($product->virtuemart_product_id);
}
$this->allowRating = $ratingModel->allowRating($product->virtuemart_product_id);
$superVendor = vmAccess::isSuperVendor();
if ($superVendor == 1 or $superVendor == $product->virtuemart_vendor_id or $superVendor) {
$edit_link = JURI::root() . 'index.php?option=com_virtuemart&tmpl=component&manage=1&view=product&task=edit&virtuemart_product_id=' . $product->virtuemart_product_id;
$this->edit_link = $this->linkIcon($edit_link, 'COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT', 'edit', false, false);
} else {
$this->edit_link = "";
}
// Load the user details
$this->user = JFactory::getUser();
// More reviews link
$uri = JURI::getInstance();
$uri->setVar('showall', 1);
$uristring = vmURI::getCleanUrl();
$this->assignRef('more_reviews', $uristring);
if ($product->metadesc) {
$document->setDescription(strip_tags(html_entity_decode($product->metadesc, ENT_QUOTES)));
} else {
$document->setDescription(strip_tags(html_entity_decode($product->product_name, ENT_QUOTES)) . " " . $category->category_name . " " . strip_tags(html_entity_decode($product->product_s_desc, ENT_QUOTES)));
}
if ($product->metakey) {
$document->setMetaData('keywords', $product->metakey);
}
if ($product->metarobot) {
$document->setMetaData('robots', $product->metarobot);
}
if ($app->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', $product->product_name);
//Maybe better product_name
}
if ($app->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $product->metaauthor);
}
$user = JFactory::getUser();
$showBasePrice = (vmAccess::manager() or vmAccess::isSuperVendor());
$this->assignRef('showBasePrice', $showBasePrice);
$productDisplayShipments = array();
$productDisplayPayments = array();
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayShipment', array($product, &$productDisplayShipments));
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayPayment', array($product, &$productDisplayPayments));
$this->assignRef('productDisplayPayments', $productDisplayPayments);
$this->assignRef('productDisplayShipments', $productDisplayShipments);
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
shopFunctionsF::setVmTemplate($this, $category->category_template, $product->product_template, $category->category_product_layout, $product->layout);
shopFunctionsF::addProductToRecent($virtuemart_product_id);
$currency = CurrencyDisplay::getInstance();
$this->assignRef('currency', $currency);
if (vRequest::getCmd('layout', 'default') == 'notify') {
$this->setLayout('notify');
}
//Added by Seyi Awofadeju to catch notify layout
VmConfig::loadJLang('com_virtuemart');
vmJsApi::chosenDropDowns();
//This must be loaded after the customfields are rendered (they may need to overwrite the handlers)
if (VmConfig::get('jdynupdate', TRUE) or $app->isAdmin()) {
vmJsApi::jDynUpdate();
}
if ($show_prices == '1') {
if (!class_exists('calculationHelper')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'calculationh.php';
}
vmJsApi::jPrice();
}
parent::display($tpl);
}
示例15: display
//.........这里部分代码省略.........
VmConfig::loadJLang('com_virtuemart_shoppers', true);
$this->renderCompleteAddressList();
if (!class_exists('VirtueMartModelUserfields')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'userfields.php';
}
$userFieldsModel = VmModel::getModel('userfields');
$userFieldsCart = $userFieldsModel->getUserFields('cart', array('captcha' => true, 'delimiters' => true), array('delimiter_userinfo', 'user_is_vendor', 'username', 'password', 'password2', 'agreed', 'address_type'));
$this->userFieldsCart = $userFieldsModel->getUserFieldsFilled($userFieldsCart, $this->cart->cartfields);
if (!class_exists('CurrencyDisplay')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php';
}
$currencyDisplay = CurrencyDisplay::getInstance($this->cart->pricesCurrency);
$this->assignRef('currencyDisplay', $currencyDisplay);
$customfieldsModel = VmModel::getModel('Customfields');
$this->assignRef('customfieldsModel', $customfieldsModel);
$this->lSelectCoupon();
$totalInPaymentCurrency = $this->getTotalInPaymentCurrency();
$checkoutAdvertise = $this->getCheckoutAdvertise();
if ($this->cart->getDataValidated()) {
if ($this->cart->_inConfirm) {
$pathway->addItem(vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM_MNU'));
$document->setTitle(vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM_MNU'));
$text = vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM');
$this->checkout_task = 'cancel';
} else {
$pathway->addItem(vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$document->setTitle(vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$text = vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
$this->checkout_task = 'confirm';
}
} else {
$pathway->addItem(vmText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$document->setTitle(vmText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$text = vmText::_('COM_VIRTUEMART_CHECKOUT_TITLE');
$this->checkout_task = 'checkout';
}
$this->checkout_link_html = '<button type="submit" id="checkoutFormSubmit" name="' . $this->checkout_task . '" value="1" class="vm-button-correct" ><span>' . $text . '</span> </button>';
if (VmConfig::get('oncheckout_opc', 1)) {
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$this->lSelectShipment();
$this->lSelectPayment();
} else {
$this->checkPaymentMethodsConfigured();
$this->checkShipmentMethodsConfigured();
}
if ($this->cart->virtuemart_shipmentmethod_id) {
$shippingText = vmText::_('COM_VIRTUEMART_CART_CHANGE_SHIPPING');
} else {
$shippingText = vmText::_('COM_VIRTUEMART_CART_EDIT_SHIPPING');
}
$this->assignRef('select_shipment_text', $shippingText);
if ($this->cart->virtuemart_paymentmethod_id) {
$paymentText = vmText::_('COM_VIRTUEMART_CART_CHANGE_PAYMENT');
} else {
$paymentText = vmText::_('COM_VIRTUEMART_CART_EDIT_PAYMENT');
}
$this->assignRef('select_payment_text', $paymentText);
$this->cart->prepareAddressFieldsInCart();
$layoutName = $this->cart->layout;
//set order language
$lang = JFactory::getLanguage();
$order_language = $lang->getTag();
$this->assignRef('order_language', $order_language);
}
}
}
$this->useSSL = VmConfig::get('useSSL', 0);
$this->useXHTML = false;
$this->assignRef('totalInPaymentCurrency', $totalInPaymentCurrency);
$this->assignRef('checkoutAdvertise', $checkoutAdvertise);
shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName);
//We never want that the cart is indexed
$document->setMetaData('robots', 'NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET');
if ($this->cart->_inConfirm) {
vmInfo('COM_VIRTUEMART_IN_CONFIRM');
}
if ($this->cart->layoutPath) {
$this->addTemplatePath($this->cart->layoutPath);
}
$current = JFactory::getUser();
$this->allowChangeShopper = false;
if (VmConfig::get('oncheckout_change_shopper')) {
if ($current->authorise('core.admin', 'com_virtuemart') or $current->authorise('vm.user', 'com_virtuemart')) {
$this->allowChangeShopper = true;
} else {
$adminID = JFactory::getSession()->get('vmAdminID', false);
if ($adminID) {
$adminIdUser = JFactory::getUser($adminID);
if ($adminIdUser->authorise('core.admin', 'com_virtuemart') or $adminIdUser->authorise('vm.user', 'com_virtuemart')) {
$this->allowChangeShopper = true;
}
}
}
}
parent::display($tpl);
}