本文整理汇总了PHP中JSFactory::getAllProductExtraField方法的典型用法代码示例。如果您正苦于以下问题:PHP JSFactory::getAllProductExtraField方法的具体用法?PHP JSFactory::getAllProductExtraField怎么用?PHP JSFactory::getAllProductExtraField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSFactory
的用法示例。
在下文中一共展示了JSFactory::getAllProductExtraField方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getQueryListProductsExtraFields
/**
* spec function additional query for product list
*/
function getQueryListProductsExtraFields()
{
$query = "";
$list = JSFactory::getAllProductExtraField();
$jshopConfig = JSFactory::getConfig();
$config_list = $jshopConfig->getProductListDisplayExtraFields();
foreach ($list as $v) {
if (in_array($v->id, $config_list)) {
$query .= ", prod.`extra_field_" . $v->id . "` ";
}
}
return $query;
}
示例2: array
}
if ($manufacturer_id && $show_categorys) {
$manufacturer = JTable::getInstance('manufacturer', 'jshop');
$manufacturer->load($manufacturer_id);
$categorys = $mainframe->getUserStateFromRequest($contextfilter . 'categorys', 'categorys', array());
$categorys = filterAllowValue($categorys, "int+");
$filter_categorys = $manufacturer->getCategorys();
}
if ($show_prices) {
$fprice_from = $mainframe->getUserStateFromRequest($contextfilter . 'fprice_from', 'fprice_from');
$fprice_from = saveAsPrice($fprice_from);
$fprice_to = $mainframe->getUserStateFromRequest($contextfilter . 'fprice_to', 'fprice_to');
$fprice_to = saveAsPrice($fprice_to);
}
if ($show_characteristics && $jshopConfig->admin_show_product_extra_field) {
$characteristic_fields = JSFactory::getAllProductExtraField();
$characteristic_fieldvalues = JSFactory::getAllProductExtraFieldValueDetail();
$characteristic_displayfields = JSFactory::getDisplayFilterExtraFieldForCategory($category_id);
$extra_fields_active = $mainframe->getUserStateFromRequest($contextfilter . 'extra_fields', 'extra_fields', array());
$extra_fields_active = filterAllowValue($extra_fields_active, "array_int_k_v+");
}
$date_from = $mainframe->getUserStateFromRequest($contextfilter . 'dfrom', 'dfrom', date('d/m/Y'));
$date_to = $mainframe->getUserStateFromRequest($contextfilter . 'dto', 'dto', date('d/m/Y', time() + 60 * 60 * 24));
if ($date_from == '') {
$date_from = date('d/m/Y');
}
if ($date_to == '') {
$date_to = date('d/m/Y', time() + 60 * 60 * 24);
}
$Item_id = $params->get('item_id', '');
if ($Item_id == '') {
示例3: get_html_characteristics
function get_html_characteristics()
{
$jshopConfig = JSFactory::getConfig();
$category_id = JRequest::getInt("category_id");
if ($jshopConfig->admin_show_product_extra_field) {
$dispatcher = JDispatcher::getInstance();
$characteristic_fields = JSFactory::getAllProductExtraField();
$characteristic_fieldvalues = JSFactory::getAllProductExtraFieldValueDetail();
$characteristic_displayfields = JSFactory::getDisplayFilterExtraFieldForCategory($category_id);
$view_name = "search";
$view_config = array("template_path" => $jshopConfig->template_path . $jshopConfig->template . "/" . $view_name);
$view = $this->getView($view_name, getDocumentType(), '', $view_config);
$view->setLayout("characteristics");
$view->assign('characteristic_fields', $characteristic_fields);
$view->assign('characteristic_fieldvalues', $characteristic_fieldvalues);
$view->assign('characteristic_displayfields', $characteristic_displayfields);
$dispatcher->trigger('onBeforeDisplaySearchHtmlCharacteristics', array(&$view));
$view->display();
}
die;
}
示例4: getDisplayFilterExtraFieldForCategory
public static function getDisplayFilterExtraFieldForCategory($cat_id)
{
static $listforcat;
if (!isset($listforcat[$cat_id])) {
$fields = array();
$list = JSFactory::getAllProductExtraField();
foreach ($list as $val) {
if ($val->allcats) {
$fields[] = $val->id;
} else {
if (in_array($cat_id, $val->cats)) {
$fields[] = $val->id;
}
}
}
$jshopConfig = JSFactory::getConfig();
$config_list = $jshopConfig->getFilterDisplayExtraFields();
foreach ($fields as $k => $val) {
if (!in_array($val, $config_list)) {
unset($fields[$k]);
}
}
$listforcat[$cat_id] = $fields;
}
return $listforcat[$cat_id];
}
示例5: getExtraFields
function getExtraFields($type = 1)
{
$_cats = $this->getCategories();
$cats = array();
foreach ($_cats as $v) {
$cats[] = $v->category_id;
}
$fields = array();
$jshopConfig = JSFactory::getConfig();
$hide_fields = $jshopConfig->getProductHideExtraFields();
$cart_fields = $jshopConfig->getCartDisplayExtraFields();
$fieldvalues = JSFactory::getAllProductExtraFieldValue();
$listfield = JSFactory::getAllProductExtraField();
foreach ($listfield as $val) {
if ($type == 1 && in_array($val->id, $hide_fields)) {
continue;
}
if ($type == 2 && !in_array($val->id, $cart_fields)) {
continue;
}
if ($val->allcats) {
$fields[] = $val;
} else {
$insert = 0;
foreach ($cats as $cat_id) {
if (in_array($cat_id, $val->cats)) {
$insert = 1;
}
}
if ($insert) {
$fields[] = $val;
}
}
}
$rows = array();
foreach ($fields as $field) {
$field_id = $field->id;
$field_name = "extra_field_" . $field_id;
if ($field->type == 0) {
if ($this->{$field_name} != 0) {
$listid = explode(',', $this->{$field_name});
$tmp = array();
foreach ($listid as $extrafiledvalueid) {
$tmp[] = $fieldvalues[$extrafiledvalueid];
}
$extra_field_value = implode($jshopConfig->multi_charactiristic_separator, $tmp);
$rows[] = array("id" => $field_id, "name" => $listfield[$field_id]->name, "description" => $listfield[$field_id]->description, "value" => $extra_field_value, "groupname" => $listfield[$field_id]->groupname, 'field_value_ids' => $listid);
}
} else {
if ($this->{$field_name} != "") {
$rows[] = array("id" => $field_id, "name" => $listfield[$field_id]->name, "description" => $listfield[$field_id]->description, "value" => $this->{$field_name}, "groupname" => $listfield[$field_id]->groupname);
}
}
}
$rowsblock = array();
foreach ($rows as $k => $v) {
if ($v['groupname'] == '') {
$grname = 'defaultgroup';
} else {
$grname = $v['groupname'];
}
$rowsblock[$grname][] = $v;
}
$rows = array();
foreach ($rowsblock as $bl => $val) {
foreach ($val as $k => $v) {
if ($k == 0) {
$v['grshow'] = 1;
} else {
$v['grshow'] = 0;
}
if ($k == count($val) - 1) {
$v['grshowclose'] = 1;
} else {
$v['grshowclose'] = 0;
}
$rows[$v['id']] = $v;
}
}
return $rows;
}
示例6: load_tmpl_characteristics
private function load_tmpl_characteristics($category_id)
{
$jshopConfig = JSFactory::getConfig();
if ($jshopConfig->admin_show_product_extra_field) {
$dispatcher = JDispatcher::getInstance();
$characteristic_fields = JSFactory::getAllProductExtraField();
$characteristic_fieldvalues = JSFactory::getAllProductExtraFieldValueDetail();
$characteristic_displayfields = JSFactory::getDisplayFilterExtraFieldForCategory($category_id);
$view = $this->getView("search");
$view->setLayout("characteristics");
$view->assign('characteristic_fields', $characteristic_fields);
$view->assign('characteristic_fieldvalues', $characteristic_fieldvalues);
$view->assign('characteristic_displayfields', $characteristic_displayfields);
$dispatcher->trigger('onBeforeDisplaySearchHtmlCharacteristics', array(&$view));
$html = $view->loadTemplate();
} else {
$html = '';
}
return $html;
}
示例7: getExtraFields
function getExtraFields($type = 1)
{
$_cats = $this->getCategories();
$cats = array();
foreach ($_cats as $v) {
$cats[] = $v->category_id;
}
$fields = array();
$jshopConfig = JSFactory::getConfig();
$hide_fields = $jshopConfig->getProductHideExtraFields();
$cart_fields = $jshopConfig->getCartDisplayExtraFields();
$fieldvalues = JSFactory::getAllProductExtraFieldValue();
$listfield = JSFactory::getAllProductExtraField();
foreach ($listfield as $val) {
if ($type == 1 && in_array($val->id, $hide_fields)) {
continue;
}
if ($type == 2 && !in_array($val->id, $cart_fields)) {
continue;
}
if ($val->allcats) {
$fields[] = $val;
} else {
$insert = 0;
foreach ($cats as $cat_id) {
if (in_array($cat_id, $val->cats)) {
$insert = 1;
}
}
if ($insert) {
$fields[] = $val;
}
}
}
$rows = array();
foreach ($fields as $field) {
$field_id = $field->id;
$field_name = "extra_field_" . $field_id;
if ($field->type == 0) {
if ($this->{$field_name} != 0) {
$listid = explode(',', $this->{$field_name});
$tmp = array();
foreach ($listid as $extrafiledvalueid) {
$tmp[] = $fieldvalues[$extrafiledvalueid];
}
$extra_field_value = implode(", ", $tmp);
$rows[] = array("id" => $field_id, "name" => $listfield[$field_id]->name, "description" => $listfield[$field_id]->description, "value" => $extra_field_value, "groupname" => $listfield[$field_id]->groupname);
}
} else {
if ($this->{$field_name} != "") {
$rows[] = array("id" => $field_id, "name" => $listfield[$field_id]->name, "description" => $listfield[$field_id]->description, "value" => $this->{$field_name}, "groupname" => $listfield[$field_id]->groupname);
}
}
}
return $rows;
}