本文整理汇总了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;
}
示例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;
}
示例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;
}