本文整理汇总了PHP中comquick2cartHelper类的典型用法代码示例。如果您正苦于以下问题:PHP comquick2cartHelper类的具体用法?PHP comquick2cartHelper怎么用?PHP comquick2cartHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了comquick2cartHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: update_mod
/**
* Function used to update
*
* @param INT $called_frm //Mundhe complet this
*
* @return Array
*
* @since 1.0.0
*/
public function update_mod($called_frm = '0')
{
$lang = JFactory::getLanguage();
$lang->load('mod_quick2cart', JPATH_ROOT);
$comquick2cartHelper = new comquick2cartHelper();
jimport('joomla.application.module.helper');
if (JModuleHelper::getModule('mod_quick2cart')) {
$module = JModuleHelper::getModule('mod_quick2cart');
if (JVERSION < '1.6.0') {
$moduleParams = new JParameter($module->params);
$layout = $moduleParams->get('viewtype');
$ckout_text = $moduleParams->get('checkout_text');
} else {
$moduleParams = json_decode($module->params);
if (!empty($moduleParams)) {
$layout = $moduleParams->viewtype;
$ckout_text = $moduleParams->checkout_text;
}
}
}
if (isset($layout) && isset($ckout_text)) {
$data = $comquick2cartHelper->get_module($layout, $ckout_text);
} else {
$data = $comquick2cartHelper->get_module();
}
echo $data;
jexit();
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:37,代码来源:cart.php
示例2: display
/**
* Display the view
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
$zoneHelper = new zoneHelper();
// Check whether view is accessible to user
if (!$zoneHelper->isUserAccessible()) {
return;
}
$app = JFactory::getApplication();
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->params = $app->getParams('com_quick2cart');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors));
}
// Get user store list
$storeHelper = new storeHelper();
// Get all stores.
$user = JFactory::getUser();
$this->userStores = $storeHelper->getUserStore($user->id);
// Get toolbar path
$comquick2cartHelper = new comquick2cartHelper();
$this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar');
// Publish states
$this->publish_states = array('' => JText::_('JOPTION_SELECT_PUBLISHED'), '1' => JText::_('JPUBLISHED'), '0' => JText::_('JUNPUBLISHED'));
// Setup TJ toolbar
$this->addTJtoolbar();
$this->_prepareDocument();
parent::display($tpl);
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:38,代码来源:view.html.php
示例3: __construct
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JController
* @since 1.6
*/
public function __construct($config = array())
{
$comquick2cartHelper = new comquick2cartHelper();
$this->my_stores_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=stores&layout=my');
$this->create_store_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=createstore');
parent::__construct($config);
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:15,代码来源:vendor.php
示例4: getInput
function getInput()
{
$lang = JFactory::getLanguage();
$lang->load('com_quick2cart', JPATH_ADMINISTRATOR);
$fieldName = $this->fieldname;
JHtml::_('behavior.modal', 'a.modal');
$html = '';
$client = "com_content";
$jinput = JFactory::getApplication()->input;
// $pid=$jinput->get('id');
$isAdmin = JFactory::getApplication()->isAdmin();
if (!$isAdmin) {
$pid = $jinput->get('a_id');
} else {
$pid = $jinput->get('id');
}
// CHECK for view override
$comquick2cartHelper = new comquick2cartHelper();
$path = $comquick2cartHelper->getViewpath('attributes', '', "ADMIN", "SITE");
ob_start();
include $path;
$html = ob_get_contents();
ob_end_clean();
return $html;
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:25,代码来源:quick2cart.php
示例5: fetchElement
/**
* Fetch custom Element view.
*
* @param string $name Field Name.
* @param mixed $value Field value.
* @param mixed $node Field node.
* @param mixed $control_name Field control_name/Id.
*
* @since 2.2
* @return null
*/
public function fetchElement($name, $value, $node, $control_name)
{
$db = JFactory::getDBO();
$user = JFactory::getUser();
$comquick2cartHelper = new comquick2cartHelper();
// Getting user accessible store ids
$storeList = $comquick2cartHelper->getStoreIds();
$options = array();
$app = JFactory::getApplication();
$jinput = $app->input;
$zone_id = $jinput->get('id');
$defaultSstore_id = 0;
if ($zone_id) {
// Load Zone helper.
$path = JPATH_SITE . DS . "components" . DS . "com_quick2cart" . DS . 'helpers' . DS . "zoneHelper.php";
if (!class_exists('zoneHelper')) {
JLoader::register('zoneHelper', $path);
JLoader::load('zoneHelper');
}
$zoneHelper = new zoneHelper();
$defaultSstore_id = $zoneHelper->getZoneStoreId($zone_id);
}
foreach ($storeList as $store) {
$storename = ucfirst($store['title']);
$options[] = JHtml::_('select.option', $store['store_id'], $storename);
}
$fieldName = $name;
return JHtml::_('select.genericlist', $options, $fieldName, 'class="inputbox required" size="1" ', 'value', 'text', $defaultSstore_id, $control_name);
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:40,代码来源:zonestorelist.php
示例6: display
/**
* Display the view
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
//$this->state = $this->get('State');
$this->item = $this->get('Item');
//$this->form = $this->get('Form');
$comquick2cartHelper = new comquick2cartHelper();
$getPayoutFormData = $this->get('PayoutFormData');
$this->getPayoutFormData = $getPayoutFormData;
//print_r($this->getPayoutFormData);die;
$payee_options = array();
$payee_options[] = JHtml::_('select.option', '0', JText::_('COM_QUICK2CART_SELECT_PAYEE'));
if (!empty($getPayoutFormData)) {
foreach ($getPayoutFormData as $payout) {
$amt = round($payout->total_amount);
if ($amt > 0) {
$username = $comquick2cartHelper->getUserName($payout->user_id);
$payee_options[] = JHtml::_('select.option', $payout->user_id, $username);
}
}
}
$this->payee_options = $payee_options;
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors));
}
$this->addToolbar();
parent::display($tpl);
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:35,代码来源:view.html.php
示例7: __construct
/**
* Class constructor.
*
* @param array $config A named array of configuration variables.
*
* @since 1.6
*/
public function __construct($config = array())
{
$comquick2cartHelper = new comquick2cartHelper();
$this->my_coupons_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=coupons&layout=my');
$this->create_coupon_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=couponform');
parent::__construct($config);
$this->view_list = 'coupons';
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:15,代码来源:couponform.php
示例8: csvexport
/**
* Gives sales reports csv export.
*
* @since 2.2.2
* @return null.
*/
public function csvexport()
{
$model = $this->getModel("salesreport");
$CSVData = $model->getCsvexportData();
$filename = "SalesReport_" . date("Y-m-d");
$csvDataString = null;
$headColumn = array();
$headColumn[0] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_ITEMID');
$headColumn[1] = JText::_('COM_QUICK2CART_SALESREPORT_PROD_NAME');
$headColumn[2] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_NAME');
$headColumn[3] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_ID');
$headColumn[4] = JText::_('COM_QUICK2CART_SALESREPORT_SALES_COUNT');
$headColumn[5] = JText::_('COM_QUICK2CART_SALESREPORT_AMOUNT');
$headColumn[6] = JText::_('COM_QUICK2CART_SALESREPORT_CREATED_BY');
$csvDataString .= implode(";", $headColumn);
$csvDataString .= "\n";
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".csv");
header("Content-disposition: filename=" . $filename . ".csv");
// Getting all store list
$comquick2cartHelper = new comquick2cartHelper();
$store_details = $comquick2cartHelper->getAllStoreDetails();
$productHelper = new productHelper();
if (!empty($CSVData)) {
foreach ($CSVData as $data) {
$store_id = $data['store_id'];
$csvrow = array();
$csvrow[0] = '"' . $data['item_id'] . '"';
$csvrow[1] = '"' . $data['item_name'] . '"';
$csvrow[2] = '""';
if (!empty($store_details[$store_id])) {
$csvrow[2] = '"' . $store_details[$store_id]['title'] . '"';
}
$csvrow[3] = '"' . $data['store_id'] . '"';
$csvrow[4] = '"' . $data['saleqty'] . '"';
// GETTING PRODUCT PRICE
$prodAttDetails = $productHelper->getProdPriceWithDefltAttributePrice($data['item_id']);
// CONSIDERING FIELD DISCOUNT, NOT COUPON DISCOUNT
$discountPrice = $prodAttDetails['itemdetail']['discount_price'];
$prodBasePrice = !empty($discountPrice) ? $discountPrice : $prodAttDetails['itemdetail']['price'];
$prodPrice = $prodBasePrice + $prodAttDetails['attrDetail']['tot_att_price'];
$prodPrice = strip_tags($comquick2cartHelper->getFromattedPrice($prodPrice));
$csvrow[5] = '"' . $prodPrice . '"';
$csvrow[6] = '""';
if (!empty($store_details[$store_id])) {
$csvrow[6] = '"' . $store_details[$store_id]['firstname'] . '"';
}
$csvDataString .= implode(";", $csvrow);
$csvDataString .= "\n";
}
}
ob_clean();
echo $csvDataString . "\n";
jexit();
$link = 'index.php?option=com_quick2cart&view=salesreport';
$this->setRedirect($link);
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:63,代码来源:salesreport.php
示例9: getVersion
function getVersion()
{
if (!class_exists('comquick2cartHelper')) {
$path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php';
JLoader::register('comquick2cartHelper', $path);
JLoader::load('comquick2cartHelper');
}
$helperobj = new comquick2cartHelper();
echo $latestversion = $helperobj->getVersion();
jexit();
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:11,代码来源:dashboard.php
示例10: getOptions
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*
* @since 11.4
*/
protected function getOptions()
{
require_once JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php';
$comquick2cartHelper = new comquick2cartHelper();
// Get all stores.
$stores = $comquick2cartHelper->getAllStoreDetails();
$options = array();
//$options[] = JHtml::_('select.option', '', JText::_('QTC_SELET_STORE'));
foreach ($stores as $key => $value) {
$options[] = JHtml::_('select.option', $key, $value['title']);
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:22,代码来源:stores.php
示例11: 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
示例12: fetchElement
function fetchElement($name, $value, $node, $control_name)
{
$input = JFactory::getApplication()->input;
$option = $input->get('option', '');
if ($option != 'com_k2') {
return;
}
jimport('joomla.filesystem.file');
if (!JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) {
return true;
}
$lang = JFactory::getLanguage();
$lang->load('com_quick2cart', JPATH_ADMINISTRATOR);
JHtml::_('behavior.modal', 'a.modal');
$html = '';
$client = "com_k2";
$pid = JRequest::getInt('cid');
// if($pid) {
/* prefill k2 title */
$db = JFactory::getDBO();
$q = "SELECT `title` FROM `#__k2_items` WHERE `id` =" . (int) $pid;
$db->setQuery($q);
$k2item = $db->loadResult();
$jinput = JFactory::getApplication()->input;
$jinput->set('qtc_article_name', $k2item);
/* prefill k2 title */
if (!class_exists('comquick2cartHelper')) {
// Require_once $path;
$path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php';
JLoader::register('comquick2cartHelper', $path);
JLoader::load('comquick2cartHelper');
}
$comquick2cartHelper = new comquick2cartHelper();
$path = $comquick2cartHelper->getViewpath('attributes', '', "ADMIN", "SITE");
ob_start();
include $path;
$html = ob_get_contents();
ob_end_clean();
return $html;
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:40,代码来源:quick2cart.php
示例13: getShipView
function getShipView()
{
$app = JFactory::getApplication();
$qtcshiphelper = new qtcshiphelper();
$comquick2cartHelper = new comquick2cartHelper();
$plgActionRes = array();
$jinput = $app->input;
$extension_id = $jinput->get('extension_id');
$plugview = $jinput->get('plugview');
// Plugin view is not found in URL then check in post array.
if (empty($plugview)) {
$plugview = $jinput->post->get('plugview');
}
// If extension related view
if (!empty($extension_id)) {
$plugName = $qtcshiphelper->getPluginDetail($extension_id);
// Call specific plugin trigger
JPluginHelper::importPlugin('tjshipping', $plugName);
$dispatcher = JDispatcher::getInstance();
$plgRes = $dispatcher->trigger('TjShip_plugActionkHandler', array($jinput));
if (!empty($plgRes)) {
$plgActionRes = $plgRes[0];
}
}
// Enque msg
if (!empty($plgActionRes['statusMsg'])) {
$app->enqueueMessage($plgActionRes['statusMsg']);
}
// Extra plugin Url params.
if (!empty($plgActionRes['urlPramStr'])) {
$plgUrlParam = '&' . $plgActionRes['urlPramStr'];
} else {
$plgUrlParam = '&plugview=';
}
//print" kasdflkjsdk $plgUrlParam"; die;
$itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=cp');
$link = 'index.php?option=com_quick2cart&view=shipping&layout=list' . $plgUrlParam . '&extension_id=' . $extension_id . '&Itemid=' . $itemid;
$this->setRedirect(JRoute::_($link, false));
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:39,代码来源:shipping.php
示例14: onK2AfterDisplayContent
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
示例15: _getquick2cartstoreHTML
function _getquick2cartstoreHTML()
{
jimport('joomla.filesystem.file');
if (JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) {
$lang = JFactory::getLanguage();
$lang->load('com_quick2cart', JPATH_SITE);
$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');
}
// Load assets
comquick2cartHelper::loadQuicartAssetFiles();
$product_path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php';
if (!class_exists('productHelper')) {
//require_once $path;
JLoader::register('productHelper', $product_path);
JLoader::load('productHelper');
}
$params = $this->params;
$no_of_stores = $params->get('no_of_stores', '2');
//Get profile id
$user = CFactory::getRequestUser();
$model = new productHelper();
$target_data = $model->getUserStores($user->_userid, $no_of_stores);
if (!empty($target_data)) {
$html = "\n\t\t\t\t<div class='techjoomla-bootstrap' >\n\t\t\t\t\t<div class='row-fluid'>\n\t\t\t\t\t<ul class='thumbnails' >\n\t\t\t\t\t";
foreach ($target_data as $data) {
$path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'views' . DS . 'vendor' . DS . 'tmpl' . DS . 'thumbnail.php';
//@TODO condition vise mod o/p
ob_start();
include $path;
$html .= ob_get_contents();
ob_end_clean();
}
$html .= "\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
return $html;
}
}
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:41,代码来源:quick2cartstore.php
示例16: comquick2cartHelper
?>
<div class="controls">
<?php
echo $this->lists['published'];
?>
</div>
<?php
} else {
echo $this->lists['published'];
}
?>
</div>
<!-- SELECT STORE -->
<?php
//made by sanjivani
$comquick2cartHelper = new comquick2cartHelper();
$this->store_role_list = $store_role_list = $comquick2cartHelper->getAllStoreIds();
//JLoader::import('managecoupon', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models');
if ($this->coupons) {
$model = new quick2cartModelManagecoupon();
$this->coupons = $model->Editlist($this->coupons[0]->id);
}
$params = JComponentHelper::getParams('com_quick2cart');
$multivendor_enable = $params->get('multivendor');
//sanjivani end
// $options[] = JHtml::_('select.option', "", "Select Country");
if ($multivendor_enable == '1') {
?>
<div class="control-group">
<label for="qtc_store" class="control-label"><?php
echo JHtml::tooltip(JText::_('QTC_PROD_SELECT_STORE_DES'), JText::_('QTC_PROD_SELECT_STORE'), '', JText::_('QTC_PROD_SELECT_STORE'));
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:31,代码来源:form.php
示例17: csvexport
function csvexport()
{
$model = $this->getModel("vendor");
$CSVData = $model->getCsvexportData();
$filename = "SalesPerSellerReport_" . date("Y-m-d");
$csvData = null;
//$csvData.= "Item_id;Product Name;Store Name;Store Id;Sales Count;Amount;Created By;";
$headColumn = array();
$headColumn[0] = JText::_('COM_QUICK2CART_SALESPERSELLER_STORENAME');
$headColumn[1] = JText::_('COM_QUICK2CART_SALESPERSELLER_VENDORNAME');
// 'Product Name';
$headColumn[2] = JText::_('COM_QUICK2CART_SALESPERSELLER_STATUS');
$headColumn[3] = JText::_('COM_QUICK2CART_SALESPERSELLER_EMAIL');
$headColumn[4] = JText::_('COM_QUICK2CART_SALESPERSELLER_PHONE');
$headColumn[5] = JText::_('COM_QUICK2CART_SALESPERSELLER_SALE');
$csvData .= implode(";", $headColumn);
$csvData .= "\n";
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".csv");
header("Content-disposition: filename=" . $filename . ".csv");
if (!empty($CSVData)) {
$storeHelper = new storeHelper();
foreach ($CSVData as $data) {
$csvrow = array();
$csvrow[0] = '"' . $data['title'] . '"';
$csvrow[1] = '"' . $data['username'] . '"';
if ($data['published'] == 1) {
$status = JText::_('COM_QUICK2CART_PUBLISH');
} else {
$status = JText::_('COM_QUICK2CART_UNPUBLISH');
}
$csvrow[2] = '"' . $status . '"';
$csvrow[3] = '"' . $data['store_email'] . '"';
$csvrow[4] = '"' . $data['phone'] . '"';
$storeHelper = new storeHelper();
$comquick2cartHelper = new comquick2cartHelper();
$total_sale = $storeHelper->getTotalSalePerStore($data['id']);
if ($total_sale) {
$sale = $comquick2cartHelper->getFromattedPrice($total_sale);
}
$csvrow[5] = '"' . $sale . '"';
$csvData .= implode(";", $csvrow);
$csvData .= "\n";
}
}
ob_clean();
echo $csvData . "\n";
jexit();
$link = JUri::base() . substr(JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=salespervendor', false), strlen(JUri::base(true)) + 1);
$this->setRedirect($link);
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:51,代码来源:vendor.php
示例18: unpublish
/**
* This function unpublishes taxrate.
*
* @since 2.2
* @return null
*/
function unpublish()
{
$app = JFactory::getApplication();
$input = JFactory::getApplication()->input;
$cid = $input->get('cid', '', 'array');
JArrayHelper::toInteger($cid);
$model = $this->getModel('shipprofiles');
if ($model->setItemState($cid, 0)) {
$msg = JText::sprintf(JText::_('COM_QUICK2CART_S_SHIPPROFILE_UNPUBLISH_SUCCESSFULLY'), count($cid));
}
$comquick2cartHelper = new comquick2cartHelper();
$itemid = $comquick2cartHelper->getItemId('index.php?option=com_quick2cart&view=vendor&layout=cp');
$redirect = JRoute::_('index.php?option=com_quick2cart&view=shipprofiles&Itemid=' . $itemid, false);
$this->setMessage($msg);
$this->setRedirect($redirect);
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:22,代码来源:shipprofiles.php
示例19: onContentSearch
/**
* Search Quick2cart (Products).
* The SQL must return the following fields that are used in a common display
* routine: href, title, section, created, text, browsernav.
*
* @param string $text Target search string.
* @param string $phrase Matching option (possible values: exact|any|all). Default is "any".
* @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest".
* @param mixed $areas An array if the search it to be restricted to areas or null to search all areas.
*
* @return array Search results.
*
* @since 1.6
*/
public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
{
$db = JFactory::getDbo();
$app = JFactory::getApplication();
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$tag = JFactory::getLanguage()->getTag();
require_once JPATH_ADMINISTRATOR . '/components/com_search/helpers/search.php';
$searchText = $text;
if (is_array($areas)) {
if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) {
return array();
}
}
$sContent = $this->params->get('search_products', 1);
$limit = $this->params->def('search_limit', 50);
$nullDate = $db->getNullDate();
$date = JFactory::getDate();
$now = $date->toSql();
$text = trim($text);
if ($text == '') {
return array();
}
switch ($phrase) {
case 'exact':
$text = $db->quote('%' . $db->escape($text, true) . '%', false);
$wheres2 = array();
$wheres2[] = 'a.name LIKE ' . $text;
$wheres2[] = 'a.description LIKE ' . $text;
$wheres2[] = 'a.metakey LIKE ' . $text;
$wheres2[] = 'a.metadesc LIKE ' . $text;
$where = '(' . implode(') OR (', $wheres2) . ')';
break;
case 'all':
case 'any':
default:
$words = explode(' ', $text);
$wheres = array();
foreach ($words as $word) {
$word = $db->quote('%' . $db->escape($word, true) . '%', false);
$wheres2 = array();
$wheres2[] = 'a.name LIKE ' . $word;
$wheres2[] = 'a.description LIKE ' . $word;
$wheres2[] = 'a.metakey LIKE ' . $word;
$wheres2[] = 'a.metadesc LIKE ' . $word;
$wheres[] = implode(' OR ', $wheres2);
}
$where = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheres) . ')';
break;
}
switch ($ordering) {
case 'oldest':
$order = 'a.cdate ASC';
break;
/*case 'popular':
$order = 'a.hits DESC';
break;*/
/*case 'popular':
$order = 'a.hits DESC';
break;*/
case 'alpha':
$order = 'a.name ASC';
break;
case 'category':
$order = 'c.title ASC, a.title ASC';
break;
case 'newest':
default:
$order = 'a.cdate DESC';
break;
}
$rows = array();
$query = $db->getQuery(true);
// Search products.
if ($sContent && $limit > 0) {
$query->clear();
$query->select('a.item_id, a.name AS title, a.metadesc, a.metakey, a.cdate AS created')->select('a.description AS text')->select('c.title AS section')->from('#__kart_items AS a')->join('INNER', '#__categories AS c ON c.id=a.category')->where('(' . $where . ') AND a.state=1 AND c.published = 1')->group('a.item_id, a.name, a.metadesc, a.metakey, a.cdate, a.description, c.title, c.id')->order($order);
$db->setQuery($query, 0, $limit);
$list = $db->loadObjectList();
$limit -= count($list);
if (isset($list)) {
$comquick2cartHelper = new comquick2cartHelper();
$itemid = $comquick2cartHelper->getItemId('index.php?option=com_quick2cart&view=productpage&layout=default');
foreach ($list as $key => $item) {
$link = 'index.php?option=com_quick2cart&view=productpage&layout=default&item_id=' . $item->item_id . '&Itemid=' . $itemid;
$list[$key]->href = JRoute::_($link, false);
//.........这里部分代码省略.........
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:101,代码来源:quick2cart.php
示例20: SendMailToAdminApproval
function SendMailToAdminApproval($prod_values, $item_id, $newProduct = 1)
{
$loguser = JFactory::getUser();
$comquick2cartHelper = new comquick2cartHelper();
$app = JFactory::getApplication();
$mailfrom = $app->getCfg('mailfrom');
$fromname = $app->getCfg('fromname');
$sitename = $app->getCfg('sitename');
$params = JComponentHelper::getParams('com_quick2cart');
$sendto = $params->get('sale_mail');
$currency = $comquick2cartHelper->getCurrencySession();
//$params->get('addcurrency'); // @sheha : currency should take from session instead of param
//$sendto = $mailfrom;
$multiple_img = array();
$count = 0;
$prod_imgs = $prod_values->get('qtc_prodImg', array(), "ARRAY");
$quick2cartModelProduct = new quick2cartModelProduct();
$multiple_img = $quick2cartModelProduct->getProdutImages($item_id);
$body = '';
// Edit product
if ($newProduct == 0) {
$subject = JText::_('COM_Q2C_EDIT_PRODUCT_SUBJECT');
$subject = str_replace('{sellername}', $loguser->name, $subject);
$body = JText::_('COM_Q2C_EDIT_PRODUCT_BODY');
$body = str_replace('{productname}', $prod_values->get('item_name', '', 'RAW'), $body);
$pod_price = $prod_values->get('multi_cur', array(), "ARRAY");
$body = str_replace('{price}', $pod_price[$currency], $body);
$body = str_replace('{sellername}', $loguser->name, $body);
$body = str_replace('{sku}', $prod_values->get('sku', '', 'RAW'), $body);
//~ for($i=0; $i < count($multiple_img); $i++)
//~ {
//~ print"<pre>"; print_r($multiple_img); die("222882");
//~ $body .= '<br><img src="' . JUri::root() . 'images/quick2cart/' . $multiple_img[$i] . '" alt="No image" ><br>';
//~ }
if (!empty($multiple_img)) {
$multiple_img = (array) $multiple_img;
foreach ($multiple_img as $key => $img) {
$body .= '<br><img src="' . JUri::root() . 'images/quick2cart/' . $img[$key] . '" alt="No image" ><br>';
}
}
} else {
$subject = JText::_('COM_Q2C_PRODUCT_AAPROVAL_SUBJECT');
$body = JText::_('COM_Q2C_PRODUCT_AAPROVAL_BODY');
$body = str_replace('{title}', $prod_values->get('item_name', '', 'RAW'), $body);
$body = str_replace('{sellername}', $loguser->name, $body);
$desc = $prod_values->get('description', '', 'ARRAY');
$desc = strip_tags(trim($desc['data']));
$body = str_replace('{des}', $desc, $body);
$body = str_replace('{link}', JUri::base() . 'administrator/index.php?option=com_quick2cart&view=products&filter_published=0', $body);
for ($i = 0; $i < count($multiple_img); $i++) {
$body .= '<br><img src="' . JUri::ROOT() . 'images/quick2cart/' . $multiple_img[$i] . '" alt="No image" ><br>';
}
}
$res = $comquick2cartHelper->sendmail($mailfrom, $subject, $body, $sendto);
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:55,代码来源:product.php
注:本文中的comquick2cartHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论