當前位置: 首頁>>代碼示例>>PHP>>正文


PHP J2Store::article方法代碼示例

本文整理匯總了PHP中J2Store::article方法的典型用法代碼示例。如果您正苦於以下問題:PHP J2Store::article方法的具體用法?PHP J2Store::article怎麽用?PHP J2Store::article使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在J2Store的用法示例。


在下文中一共展示了J2Store::article方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

<input type="hidden" name="task"
	value="shipping_payment_method_validate" />
<input type="hidden" name="option" value="com_j2store" />
<input type="hidden" name="view" value="checkout" />
<div class="j2store-modal">
<div id="j2store-tos-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="j2store-tos-modal-label" aria-hidden="true" style="display:none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true">&times;</button>
	</div>
	<div class="modal-body">
		<?php 
if (is_numeric($tos)) {
    ?>
			<p><?php 
    echo J2Store::article()->display($tos);
    ?>
</p>
		<?php 
}
?>
	</div>
	<div class="modal-footer">
	<button type="button" class="btn btn-danger" data-dismiss="modal"
			aria-hidden="true"><?php 
echo JText::_('J2STORE_CLOSE');
?>
</button>

	</div>
</div>
開發者ID:davetheapple,項目名稱:oakencraft,代碼行數:31,代碼來源:default_shipping_payment.php

示例2: getArticleByAlias

 public static function getArticleByAlias($segment)
 {
     $article = J2Store::article()->getArticleByAlias($segment);
     if (isset($article->id)) {
         $product = F0FTable::getAnInstance('Product', 'J2StoreTable');
         $product->get_product_by_source('com_content', $article->id);
         return $product->j2store_product_id;
     } else {
         return false;
     }
 }
開發者ID:davetheapple,項目名稱:oakencraft,代碼行數:11,代碼來源:router.php

示例3: _displayArticle

 /**
  * This displays the content article
  * specified in the plugin's params
  *
  * @return unknown_type
  */
 function _displayArticle()
 {
     $html = '';
     $articleid = (int) $this->params->get('articleid');
     if ($articleid && is_numeric($articleid)) {
         $html = J2Store::article()->display($articleid);
     }
     return $html;
 }
開發者ID:davetheapple,項目名稱:oakencraft,代碼行數:15,代碼來源:_base.php

示例4: browse


//.........這裏部分代碼省略.........
     if (count($items)) {
         foreach ($items as &$item) {
             //run the content plugins
             $model->executePlugins($item, $params, 'com_content.category.productlist');
         }
         //process the raw items as products
         $this->processProducts($items);
         $pagination = $model->getSFPagination();
         $view->assign('pagination', $pagination);
     }
     $filters['pricefilters'] = $this->getPriceRanges($items);
     //set up document
     // Check for layout override only if this is not the active menu item
     // If it is the active menu item, then the view and category id will match
     $active = $app->getMenu()->getActive();
     $menus = $app->getMenu();
     $pathway = $app->getPathway();
     $document = JFactory::getDocument();
     // Because the application sets a default page title,
     // we need to get it from the menu item itself
     $menu = $menus->getActive();
     if ($menu) {
         $params->def('page_heading', $params->get('page_title', $menu->title));
     }
     $title = $params->get('page_title', '');
     // Check for empty title and add site name if param is set
     if (empty($title)) {
         $title = $app->get('sitename');
     } elseif ($app->get('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
     } elseif ($app->get('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
     }
     $document->setTitle($title);
     $meta_description = $params->get('menu-meta_description');
     $document->setDescription($meta_description);
     $keywords = $params->get('menu-meta_keywords');
     $document->setMetaData('keywords', $keywords);
     $robots = $params->get('robots');
     $document->setMetaData('robots', $robots);
     // Set Facebook meta data
     $uri = JURI::getInstance();
     $document->setMetaData('og:title', $document->getTitle());
     $document->setMetaData('og:site_name', $app->get('sitename'));
     $document->setMetaData('og:description', strip_tags($document->getDescription()));
     $document->setMetaData('og:url', $uri->toString());
     $document->setMetaData('og:type', 'product.group');
     $catids = $model->getState('catids', array());
     $category = false;
     if (is_array($catids)) {
         if (count($catids) == 1) {
             $category = $catids[0];
         }
     } elseif (is_numeric($catids)) {
         $category = $catids;
     }
     if ($category) {
         // we have a single category. So we can add a breadcrumb
         $category_data = J2Store::article()->getCategoryById($category);
         if (isset($category_data->title)) {
             $pathway = $app->getPathway();
             $path = array(array('title' => $category_data->title, 'link' => ''));
             $path = array_reverse($path);
             foreach ($path as $singlepath) {
                 $pathway->addItem($singlepath['title'], $singlepath['link']);
             }
         }
     }
     //add custom styles
     $custom_css = $params->get('custom_css', '');
     $document->addStyleDeclaration(strip_tags($custom_css));
     if (!defined('DS')) {
         define('DS', DIRECTORY_SEPARATOR);
     }
     // Look for template files in component folders
     $view->addTemplatePath(JPATH_COMPONENT . DS . 'templates');
     $view->addTemplatePath(JPATH_COMPONENT . DS . 'templates' . DS . 'default');
     // Look for overrides in template folder (J2 template structure)
     $view->addTemplatePath(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'html' . DS . 'com_j2store' . DS . 'templates');
     $view->addTemplatePath(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'html' . DS . 'com_j2store' . DS . 'templates' . DS . 'default');
     // Look for overrides in template folder (Joomla! template structure)
     $view->addTemplatePath(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'html' . DS . 'com_j2store' . DS . 'default');
     $view->addTemplatePath(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'html' . DS . 'com_j2store');
     // Look for specific J2 theme files
     if ($params->get('subtemplate')) {
         $view->addTemplatePath(JPATH_COMPONENT . DS . 'templates' . DS . $params->get('subtemplate'));
         $view->addTemplatePath(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'html' . DS . 'com_j2store' . DS . 'templates' . DS . $params->get('subtemplate'));
         $view->addTemplatePath(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'html' . DS . 'com_j2store' . DS . $params->get('subtemplate'));
     }
     //allow plugins to modify the data
     J2Store::plugin()->event('ViewProductList', array(&$items, &$view, $params, $model));
     $view->assign('products', $items);
     $view->assign('state', $model->getState());
     $view->assign('params', $params);
     $view->assign('filters', $filters);
     $view->assign('filter_catid', $filter_catid);
     $view->assign('currency', J2store::currency());
     $this->display(in_array('browse', $this->cacheableTasks));
     return true;
 }
開發者ID:davetheapple,項目名稱:oakencraft,代碼行數:101,代碼來源:products.php


注:本文中的J2Store::article方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。