当前位置: 首页>>代码示例>>PHP>>正文


PHP ShopFunctions::getValidProductFilterArray方法代码示例

本文整理汇总了PHP中ShopFunctions::getValidProductFilterArray方法的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctions::getValidProductFilterArray方法的具体用法?PHP ShopFunctions::getValidProductFilterArray怎么用?PHP ShopFunctions::getValidProductFilterArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ShopFunctions的用法示例。


在下文中一共展示了ShopFunctions::getValidProductFilterArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * constructs a VmModel
  * setMainTable defines the maintable of the model
  *
  * @author Max Milbers
  */
 function __construct()
 {
     parent::__construct('virtuemart_product_id');
     $this->setMainTable('products');
     $this->starttime = microtime(TRUE);
     $this->maxScriptTime = VmConfig::getExecutionTime() * 0.95 - 1;
     $this->memory_limit = VmConfig::getMemoryLimit() - 4;
     // 	$this->addvalidOrderingFieldName(array('m.mf_name','pp.product_price'));
     $app = JFactory::getApplication();
     if ($app->isSite()) {
         $this->_validOrderingFieldName = array();
         $browseOrderByFields = VmConfig::get('browse_orderby_fields', array('product_sku', 'category_name', 'mf_name', 'product_name'));
     } else {
         if (!class_exists('shopFunctions')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php';
         }
         $browseOrderByFields = ShopFunctions::getValidProductFilterArray();
         $this->addvalidOrderingFieldName(array('product_price', 'product_sales'));
         //$this->addvalidOrderingFieldName (array('product_price'));
         // 	vmdebug('$browseOrderByFields',$browseOrderByFields);
     }
     $this->addvalidOrderingFieldName((array) $browseOrderByFields);
     $this->removevalidOrderingFieldName('virtuemart_product_id');
     //$this->removevalidOrderingFieldName ('product_sales');
     //unset($this->_validOrderingFieldName[0]);//virtuemart_product_id
     array_unshift($this->_validOrderingFieldName, 'p.virtuemart_product_id');
     $this->_selectedOrdering = VmConfig::get('browse_orderby_field', '`p`.virtuemart_product_id');
     $this->setToggleName('product_special');
     $this->initialiseRequests();
     //This is just done now for the moment for developing, the idea is of course todo this only when needed.
     $this->updateRequests();
 }
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:38,代码来源:product.php

示例2: __construct

 /**
  * constructs a VmModel
  * setMainTable defines the maintable of the model
  *
  * @author Max Milbers
  */
 function __construct()
 {
     parent::__construct('virtuemart_product_id');
     $this->setMainTable('products');
     $this->starttime = microtime(TRUE);
     $this->maxScriptTime = ini_get('max_execution_time') * 0.95 - 1;
     // 	$this->addvalidOrderingFieldName(array('m.mf_name','pp.product_price'));
     $view = JRequest::getVar('view');
     $isSite = JFactory::getApplication()->isSite() && $view !== 'product' && $view !== 'inventory';
     if ($isSite) {
         $browseOrderByFields = VmConfig::get('browse_orderby_fields', array('product_sku', 'category_name', 'mf_name', 'product_name'));
     } else {
         JLoader::register('shopFunctions', JPATH_VM_ADMINISTRATOR . 'helpers/shopfunctions.php');
         $browseOrderByFields = ShopFunctions::getValidProductFilterArray();
         $this->addvalidOrderingFieldName(array('product_price', 'p.`product_sales`'));
         //$this->addvalidOrderingFieldName (array('product_price'));
         // 	vmdebug('$browseOrderByFields',$browseOrderByFields);
     }
     $this->addvalidOrderingFieldName((array) $browseOrderByFields);
     $this->removevalidOrderingFieldName('virtuemart_product_id');
     $this->removevalidOrderingFieldName('product_sales');
     //unset($this->_validOrderingFieldName[0]);//virtuemart_product_id
     array_unshift($this->_validOrderingFieldName, 'p.virtuemart_product_id');
     $this->_selectedOrdering = VmConfig::get('browse_orderby_field', '`p`.virtuemart_product_id');
     $this->setToggleName('product_special');
     $this->initialiseRequests();
     //This is just done now for the moment for developing, the idea is of course todo this only when needed.
     $this->updateRequests();
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:35,代码来源:product.php

示例3: getProductFilterFields

 /**
  * Retrieve a list of preselected and existing search or order By Fields
  * $type = 'browse_search_fields' or 'browse_orderby_fields'
  * @author Kohl Patrick
  * @return array of order list
  */
 function getProductFilterFields($type)
 {
     $searchChecked = VmConfig::get($type);
     if (!is_array($searchChecked)) {
         $searchChecked = (array) $searchChecked;
     }
     $searchFieldsArray = ShopFunctions::getValidProductFilterArray();
     // 		if ($type !== 'browse_orderby_fields' ) array_shift($searchFieldsArray);
     $searchFields = new stdClass();
     $searchFields->checkbox = '<div class="threecols"><ul>';
     foreach ($searchFieldsArray as $key => $field) {
         if (in_array($field, $searchChecked)) {
             $checked = 'checked="checked"';
         } else {
             $checked = '';
         }
         $fieldWithoutPrefix = $field;
         $dotps = strrpos($fieldWithoutPrefix, '.');
         if ($dotps !== false) {
             $prefix = substr($field, 0, $dotps + 1);
             $fieldWithoutPrefix = substr($field, $dotps + 1);
         }
         $text = JText::_('COM_VIRTUEMART_' . strtoupper($fieldWithoutPrefix));
         if ($type == 'browse_orderby_fields') {
             $searchFields->select[] = JHTML::_('select.option', $field, $text);
         }
         $searchFields->checkbox .= '<li><input type="checkbox" id="' . $type . $fieldWithoutPrefix . $key . '" name="' . $type . '[]" value="' . $field . '" ' . $checked . ' /><label for="' . $type . $fieldWithoutPrefix . $key . '">' . $text . '</label></li>';
     }
     $searchFields->checkbox .= '</ul></div>';
     return $searchFields;
 }
开发者ID:rubengarcia0510,项目名称:tienda,代码行数:37,代码来源:config.php

示例4: getProductFilterFields

 /**
  * Retrieve a list of preselected and existing search or order By Fields
  * $type = 'browse_search_fields' or 'browse_orderby_fields'
  * @author Kohl Patrick
  * @return array of order list
  */
 function getProductFilterFields($type)
 {
     $searchChecked = VmConfig::get($type);
     if (!is_array($searchChecked)) {
         $searchChecked = (array) $searchChecked;
     }
     if ($type != 'browse_cat_orderby_field') {
         $searchFieldsArray = ShopFunctions::getValidProductFilterArray();
         if ($type == 'browse_search_fields') {
             if ($key = array_search('pc.ordering', $searchFieldsArray)) {
                 unset($searchFieldsArray[$key]);
             }
         } else {
             if ($type == 'browse_orderby_fields') {
                 array_unshift($searchFieldsArray, 'pc.ordering,product_name');
             }
         }
     } else {
         $searchFieldsArray = array('category_name', 'category_description', 'cx.ordering', 'c.published');
     }
     $searchFields = new stdClass();
     $searchFields->checkbox = '<div class="threecols"><ul>';
     foreach ($searchFieldsArray as $key => $field) {
         if (in_array($field, $searchChecked)) {
             $checked = 'checked="checked"';
         } else {
             $checked = '';
         }
         $fieldWithoutPrefix = $field;
         $dotps = strrpos($fieldWithoutPrefix, '.');
         if ($dotps !== false) {
             $prefix = substr($field, 0, $dotps + 1);
             $fieldWithoutPrefix = substr($field, $dotps + 1);
         }
         $text = vmText::_('COM_VIRTUEMART_' . strtoupper(str_replace(array(',', ' '), array('_', ''), $fieldWithoutPrefix)));
         if ($type == 'browse_orderby_fields' or $type == 'browse_cat_orderby_field') {
             $searchFields->select[] = JHtml::_('select.option', $field, $text);
         }
         $searchFields->checkbox .= '<li><input type="checkbox" id="' . $type . $fieldWithoutPrefix . $key . '" name="' . $type . '[]" value="' . $field . '" ' . $checked . ' /><label for="' . $type . $fieldWithoutPrefix . $key . '">' . $text . '</label></li>';
     }
     $searchFields->checkbox .= '</ul></div>';
     return $searchFields;
 }
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:49,代码来源:config.php


注:本文中的ShopFunctions::getValidProductFilterArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。