本文整理汇总了PHP中shopFunctionsF::addProductToRecent方法的典型用法代码示例。如果您正苦于以下问题:PHP shopFunctionsF::addProductToRecent方法的具体用法?PHP shopFunctionsF::addProductToRecent怎么用?PHP shopFunctionsF::addProductToRecent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shopFunctionsF
的用法示例。
在下文中一共展示了shopFunctionsF::addProductToRecent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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);
}
示例4: 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);
}