当前位置: 首页>>代码示例>>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;未经允许,请勿转载。