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


PHP comquick2cartHelper::getBuynow方法代碼示例

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


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

示例1: onDisplayFieldValue

 function onDisplayFieldValue(&$field, $item, $values = null, $prop = 'display')
 {
     // execute the code only if the field type match the plugin type
     if ($field->field_type != 'quick2cart') {
         return;
     }
     jimport('joomla.filesystem.file');
     if (JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) {
         $mainframe = JFactory::getApplication();
         $lang = JFactory::getLanguage();
         $lang->load('com_quick2cart');
         $comquick2cartHelper = new comquick2cartHelper();
         $output = $comquick2cartHelper->getBuynow($item->id, "com_flexicontent");
     }
     $field->{$prop} = $output;
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:16,代碼來源:quick2cart.php

示例2: jimport

 function onK2AfterDisplayContent(&$item, &$params, $limitstart)
 {
     // Add Language file.
     $lang = JFactory::getLanguage();
     $lang->load('com_quick2cart', JPATH_SITE);
     jimport('joomla.filesystem.file');
     if (!JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) {
         return true;
     }
     $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php';
     if (!class_exists('comquick2cartHelper')) {
         // require_once $path;
         JLoader::register('comquick2cartHelper', $path);
         JLoader::load('comquick2cartHelper');
     }
     $mainframe = JFactory::getApplication();
     $lang = JFactory::getLanguage();
     $lang->load('com_quick2cart');
     $comquick2cartHelper = new comquick2cartHelper();
     $output = $comquick2cartHelper->getBuynow($item->id, 'com_k2');
     return $output;
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:22,代碼來源:qtc_k2.php

示例3: onContentPrepare

 /**
  * J1.7
  * Plugin that loads module positions within content
  *
  * @param
  *        	string	The context of the content being passed to the plugin.
  * @param
  *        	object	The article object. Note $article->text is also
  *        	available
  * @param
  *        	object	The article params
  * @param
  *        	int		The 'page' number
  */
 public function onContentPrepare($context, &$article, &$params, $page = 0)
 {
     $clientdetails = explode(".", $context);
     $client = $clientdetails[0];
     if ($client != "com_content") {
         return;
     }
     $mainframe = JFactory::getApplication();
     $lang = JFactory::getLanguage();
     $lang->load('com_quick2cart');
     $btn_pos_method = $this->params->get('btn_pos_method');
     if ($btn_pos_method == 'data_tag') {
         jimport('joomla.filesystem.file');
         if (!class_exists('JFolder')) {
             jimport('joomla.filesystem.folder');
         }
         if (JFolder::exists(JPATH_ROOT . '/components/com_quick2cart')) {
             // Don't run this plugin when the content is being indexed
             if ($context == 'com_finder.indexer') {
                 return true;
             }
             // simple performance check to determine whether bot should
             // process further
             if (strpos($article->text, 'loadquick2cart') === false) {
                 return true;
             }
             // expression to search for (datatag) eg. {loadquick2cart id=3}
             // $regex = '/{loadquick2cart/i';
             $regex = '/{loadquick2cart\\s+(.*?)}/i';
             // Find all instances of plugin and put in $matches for
             // loadposition
             // $matches[0] is full pattern match, $matches[1] is the
             // position
             preg_match_all($regex, $article->text, $matches, PREG_SET_ORDER);
             // No matches, skip this
             if ($matches) {
                 foreach ($matches as $match) {
                     $vars = new stdClass();
                     $pcs = explode('=', $match[1]);
                     $vars->product_id = $pcs[1];
                     $comquick2cartHelper = new comquick2cartHelper();
                     $output = $comquick2cartHelper->getBuynow($vars->product_id, "com_content");
                     // We should replace only first occurrence in order to
                     // allow positions with the same name to regenerate
                     // their content:
                     $article->text = preg_replace("{" . $match[0] . "}", addcslashes($output, '\\$'), $article->text, 1);
                 }
             }
         }
     }
     // End data_tag if
     return true;
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:67,代碼來源:content_quick2cart.php


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