Есть фильтр (расширенный поиск) вот так вот он выглядит
и вот его код
<?php if (is_array($characteristic_displayfields) && count($characteristic_displayfields)){?>
<br/>
<div class="filter_characteristic">
<?php foreach($characteristic_displayfields as $ch_id){?>
<div class="characteristic_name"><?php print $characteristic_fields[$ch_id]->name;?></div>
<input type="hidden" name="extra_fields[<?php print $ch_id?>][]" value="0" />
<?php if (is_array($characteristic_fieldvalues[$ch_id])){?>
<?php foreach($characteristic_fieldvalues[$ch_id] as $val_id=>$val_name){?>
<input type="checkbox" name="extra_fields[<?php print $ch_id?>][]" value="<?php print $val_id;?>" <?php if (is_array($extra_fields_active[$ch_id]) && in_array($val_id, $extra_fields_active[$ch_id])) print "checked";?> onclick="document.jshop_filters.submit();" /> <?php print $val_name;?><br/>
<?php }?>
<?php }?>
<br/>
<?php }?>
</div>
<?php } ?>
Меня интересует строка отвечающая за характеристику (Материал, Бренд, Размеры ™) вот она:
<?php foreach($characteristic_displayfields as $ch_id){?>
<div class="characteristic_name"><?php print $characteristic_fields[$ch_id]->name;?></div>
И тут вопрос: как сделать слово исключение? Как убрать повторяющийся ->name;?> (допустим чтоб не показывалось имя "Размеры ™")
Спустя 23 минуты, 50 секунд (5.08.2012 - 10:48) RCuPeR написал(а):
Перед
напиши
И покажи, что вернет.
<?php foreach($characteristic_displayfields as $ch_id){?>
напиши
<?php print_r($characteristic_displayfields); ?>
И покажи, что вернет.
Спустя 2 минуты, 55 секунд (5.08.2012 - 10:51) RCuPeR написал(а):
Т.е, тебе нужно убрать плашку "Размеры ™", а дочерние ему чекбоксы оставить ?
Спустя 2 минуты, 56 секунд (5.08.2012 - 10:53) leopold написал(а):
да
Спустя 1 минута, 45 секунд (5.08.2012 - 10:55) RCuPeR написал(а):
Делай то, что описал выше.
А вообще, лучше найти место где создается массив $characteristic_displayfields.
А вообще, лучше найти место где создается массив $characteristic_displayfields.
Спустя 2 минуты, 5 секунд (5.08.2012 - 10:57) leopold написал(а):
Вот что вернул - Array ( [0] => 3 [1] => 8 [2] => 277 [3] => 278 [4] => 279 )
Спустя 1 минута, 48 секунд (5.08.2012 - 10:59) Leopold написал(а):
А вот файл где все создается
<?php
/**
* @version 3.3.0 02.01.2012
* @author MAXXmarketing GmbH
* @package Jshopping
* @copyright Copyright © 2010 webdesigner-profi.de. All rights reserved.
* @license GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
error_reporting(E_ALL & ~E_NOTICE);
if (!file_exists(JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS.'jshopping.php')){
JError::raiseError(500,"Please install component \"joomshopping\"");
}
$display_fileters = 0;
if (JRequest::getVar("controller")=="category" && JRequest::getInt("category_id")) $display_fileters = 1;
if (JRequest::getVar("controller")=="manufacturer" && JRequest::getInt("manufacturer_id")) $display_fileters = 1;
if (!$display_fileters) return "";
require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."factory.php");
require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."functions.php");
JSFactory::loadCssFiles();
JSFactory::loadLanguageFile();
$jshopConfig = &JSFactory::getConfig();
$mainframe = &JFactory::getApplication();
$show_manufacturers = $params->get('show_manufacturers');
$show_categorys = $params->get('show_categorys');
$show_prices = $params->get('show_prices');
$show_characteristics = $params->get('show_characteristics');
$category_id = JRequest::getInt('category_id');
$manufacturer_id = JRequest::getInt('manufacturer_id');
$contextfilter = "";
if (JRequest::getVar("controller")=="category"){
$contextfilter = "jshoping.list.front.product.cat.".$category_id;
}
if (JRequest::getVar("controller")=="manufacturer"){
$contextfilter = "jshoping.list.front.product.manf.".$manufacturer_id;
}
if ($category_id && $show_manufacturers){
$category = &JTable::getInstance('category', 'jshop');
$category->load($category_id);
$manufacturers = $mainframe->getUserStateFromRequest( $contextfilter.'manufacturers', 'manufacturers', array());
$manufacturers = filterAllowValue($manufacturers, "int+");
$filter_manufactures = $category->getManufacturers();
}
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+");
}
require(JModuleHelper::getLayoutPath('mod_jshopping_filters'));
?>
Спустя 3 минуты, 58 секунд (5.08.2012 - 11:03) Leopold написал(а):
извините ошибся.... вот этот файл:
<?php
/**
* @version 2.7.0 12.01.2011
* @author MAXXmarketing GmbH
* @package Jshopping
* @copyright Copyright © 2010 webdesigner-profi.de. All rights reserved.
* @license GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
error_reporting(E_ALL & ~E_NOTICE);
if (!file_exists(JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS.'jshopping.php')){
JError::raiseError(500,"Please install component \"joomshopping\"");
}
$display_fileters = 0;
if (JRequest::getVar("controller")=="category" && JRequest::getInt("category_id")) $display_fileters = 1;
if (JRequest::getVar("controller")=="manufacturer" && JRequest::getInt("manufacturer_id")) $display_fileters = 1;
if (!$display_fileters) return "";
require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."factory.php");
require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."functions.php");
JSFactory::loadCssFiles();
JSFactory::loadLanguageFile();
$jshopConfig = &JSFactory::getConfig();
$mainframe = &JFactory::getApplication();
$show_manufacturers = $params->get('show_manufacturers');
$show_categorys = $params->get('show_categorys');
$show_prices = $params->get('show_prices');
$show_characteristics = $params->get('show_characteristics');
$context = "jshoping.list.front.product";
$category_id = JRequest::getInt('category_id');
if ($category_id && $show_manufacturers){
$category = &JTable::getInstance('category', 'jshop');
$category->load($category_id);
$manufacturers = $mainframe->getUserStateFromRequest( $context.'manufacturers_'.$category_id, 'manufacturers', array());
$manufacturers = filterAllowValue($manufacturers, "int+");
$filter_manufactures = $category->getManufacturers();
}
$manufacturer_id = JRequest::getInt('manufacturer_id');
if ($manufacturer_id && $show_categorys){
$manufacturer = &JTable::getInstance('manufacturer', 'jshop');
$manufacturer->load($manufacturer_id);
$categorys = $mainframe->getUserStateFromRequest( $context.'categorys_'.$manufacturer_id, 'categorys', array());
$categorys = filterAllowValue($categorys, "int+");
$filter_categorys = $manufacturer->getCategorys();
}
if ($show_prices){
$price_from = $mainframe->getUserStateFromRequest( $context.'price_from_'.$category_id, 'price_from');
$price_from = saveAsPrice($price_from);
$price_to = $mainframe->getUserStateFromRequest( $context.'price_to_'.$category_id, 'price_to');
$price_to = saveAsPrice($price_to);
}
if ($show_characteristics && $jshopConfig->admin_show_product_extra_field){
$characteristic_fields = &JSFactory::getAllProductExtraField();
$characteristic_fieldvalues = &JSFactory::getAllProductExtraFieldValueDetail();
$characteristic_displayfields = &JSFactory::getDisplayFilterExtraFieldForCategory($category_id);
if ($category_id){
$context_ef = $context.'extra_fields_'.$category_id;
}else{
$context_ef = $context.'extra_fields_mf'.$manufacturer_id;
}
$extra_fields_active = $mainframe->getUserStateFromRequest( $context_ef, 'extra_fields', array());
$extra_fields_active = filterAllowValue($extra_fields_active, "array_int_k_v+");
}
require(JModuleHelper::getLayoutPath('mod_jshopping_filters'));
?>
Спустя 34 секунды (5.08.2012 - 11:04) RCuPeR написал(а):
Перед
Сделай
Если я все верно понял, у тебя там должен получится огромный объект.
<div class="characteristic_name"><?php print $characteristic_fields[$ch_id]->name;?></div>
Сделай
<?php print_r($characteristic_fields); ?>
Если я все верно понял, у тебя там должен получится огромный объект.
Спустя 3 минуты, 20 секунд (5.08.2012 - 11:07) Leopold написал(а):
Неошибаешся
Array ( [3] => stdClass Object ( [id] => 3 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 ) [ordering] => 1 [group] => 0 [groupname] => ) [8] => stdClass Object ( [id] => 8 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 [1] => 54 ) [ordering] => 2 [group] => 0 [groupname] => ) [280] => stdClass Object ( [id] => 280 [name] => Тип ткани ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 53 [1] => 56 [2] => 57 ) [ordering] => 3 [group] => 0 [groupname] => ) [281] => stdClass Object ( [id] => 281 [name] => Бренд ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 53 [1] => 59 ) [ordering] => 4 [group] => 0 [groupname] => ) [12] => stdClass Object ( [id] => 12 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 54 ) [ordering] => 5 [group] => 0 [groupname] => ) [13] => stdClass Object ( [id] => 13 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 6 [group] => 0 [groupname] => ) [15] => stdClass Object ( [id] => 15 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 56 [1] => 57 [2] => 58 ) [ordering] => 7 [group] => 0 [groupname] => ) [16] => stdClass Object ( [id] => 16 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 58 ) [ordering] => 8 [group] => 0 [groupname] => ) [282] => stdClass Object ( [id] => 282 [name] => Размеры нав [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 58 ) [ordering] => 9 [group] => 0 [groupname] => ) [283] => stdClass Object ( [id] => 283 [name] => Размеры нав [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 58 ) [ordering] => 10 [group] => 0 [groupname] => ) [284] => stdClass Object ( [id] => 284 [name] => Размеры нав [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 58 ) [ordering] => 11 [group] => 0 [groupname] => ) [18] => stdClass Object ( [id] => 18 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 12 [group] => 0 [groupname] => ) [21] => stdClass Object ( [id] => 21 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 46 ) [ordering] => 13 [group] => 0 [groupname] => ) [285] => stdClass Object ( [id] => 285 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 14 [group] => 0 [groupname] => ) [286] => stdClass Object ( [id] => 286 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 15 [group] => 0 [groupname] => ) [287] => stdClass Object ( [id] => 287 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 16 [group] => 0 [groupname] => ) [288] => stdClass Object ( [id] => 288 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 17 [group] => 0 [groupname] => ) [289] => stdClass Object ( [id] => 289 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 18 [group] => 0 [groupname] => ) [290] => stdClass Object ( [id] => 290 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 19 [group] => 0 [groupname] => ) [291] => stdClass Object ( [id] => 291 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 20 [group] => 0 [groupname] => ) [292] => stdClass Object ( [id] => 292 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 21 [group] => 0 [groupname] => ) [293] => stdClass Object ( [id] => 293 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 22 [group] => 0 [groupname] => ) [294] => stdClass Object ( [id] => 294 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 23 [group] => 0 [groupname] => ) [295] => stdClass Object ( [id] => 295 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 24 [group] => 0 [groupname] => ) [296] => stdClass Object ( [id] => 296 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 25 [group] => 0 [groupname] => ) [297] => stdClass Object ( [id] => 297 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 26 [group] => 0 [groupname] => ) [298] => stdClass Object ( [id] => 298 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 27 [group] => 0 [groupname] => ) [23] => stdClass Object ( [id] => 23 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 60 ) [ordering] => 28 [group] => 0 [groupname] => ) [24] => stdClass Object ( [id] => 24 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 59 ) [ordering] => 29 [group] => 0 [groupname] => ) [20] => stdClass Object ( [id] => 20 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 [1] => 46 [2] => 60 ) [ordering] => 30 [group] => 0 [groupname] => ) [25] => stdClass Object ( [id] => 25 [name] => Наполнитель [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 31 [group] => 0 [groupname] => ) [26] => stdClass Object ( [id] => 26 [name] => Размеры [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 32 [group] => 0 [groupname] => ) [27] => stdClass Object ( [id] => 27 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 33 [group] => 0 [groupname] => ) [28] => stdClass Object ( [id] => 28 [name] => Как любите спать? [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 34 [group] => 0 [groupname] => ) [29] => stdClass Object ( [id] => 29 [name] => Наполнитель [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 35 [group] => 0 [groupname] => ) [32] => stdClass Object ( [id] => 32 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 36 [group] => 0 [groupname] => ) [33] => stdClass Object ( [id] => 33 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 37 [group] => 0 [groupname] => ) [35] => stdClass Object ( [id] => 35 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 38 [group] => 0 [groupname] => ) [37] => stdClass Object ( [id] => 37 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 39 [group] => 0 [groupname] => ) [257] => stdClass Object ( [id] => 257 [name] => Размер [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 65 ) [ordering] => 40 [group] => 0 [groupname] => ) [258] => stdClass Object ( [id] => 258 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 65 [1] => 68 [2] => 69 ) [ordering] => 41 [group] => 0 [groupname] => ) [259] => stdClass Object ( [id] => 259 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 65 ) [ordering] => 42 [group] => 0 [groupname] => ) [261] => stdClass Object ( [id] => 261 [name] => Наполнитель [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 69 ) [ordering] => 43 [group] => 0 [groupname] => ) [263] => stdClass Object ( [id] => 263 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 69 ) [ordering] => 44 [group] => 0 [groupname] => ) [264] => stdClass Object ( [id] => 264 [name] => Тип [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 54 ) [ordering] => 45 [group] => 0 [groupname] => ) [265] => stdClass Object ( [id] => 265 [name] => Размер наволочек [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 54 ) [ordering] => 46 [group] => 0 [groupname] => ) [266] => stdClass Object ( [id] => 266 [name] => Размер [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 68 ) [ordering] => 47 [group] => 0 [groupname] => ) [267] => stdClass Object ( [id] => 267 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 68 ) [ordering] => 48 [group] => 0 [groupname] => ) [273] => stdClass Object ( [id] => 273 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 49 [group] => 0 [groupname] => ) [274] => stdClass Object ( [id] => 274 [name] => Кол-во салфеток [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 50 [group] => 0 [groupname] => ) [276] => stdClass Object ( [id] => 276 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 77 ) [ordering] => 51 [group] => 0 [groupname] => ) [277] => stdClass Object ( [id] => 277 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 [1] => 53 [2] => 54 [3] => 56 [4] => 57 ) [ordering] => 52 [group] => 0 [groupname] => ) [278] => stdClass Object ( [id] => 278 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 [1] => 53 [2] => 54 [3] => 56 [4] => 57 ) [ordering] => 53 [group] => 0 [groupname] => ) [279] => stdClass Object ( [id] => 279 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 ) [ordering] => 54 [group] => 0 [groupname] => ) [299] => stdClass Object ( [id] => 299 [name] => Размеры о ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 55 [group] => 0 [groupname] => ) [300] => stdClass Object ( [id] => 300 [name] => Размеры о ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 56 [group] => 0 [groupname] => ) [301] => stdClass Object ( [id] => 301 [name] => Размеры о ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 57 [group] => 0 [groupname] => ) [302] => stdClass Object ( [id] => 302 [name] => Размеры о ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 58 [group] => 0 [groupname] => ) [303] => stdClass Object ( [id] => 303 [name] => Цвет ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 ) [ordering] => 59 [group] => 0 [groupname] => ) [304] => stdClass Object ( [id] => 304 [name] => Цвет ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 ) [ordering] => 60 [group] => 0 [groupname] => ) [305] => stdClass Object ( [id] => 305 [name] => Цвет ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 ) [ordering] => 61 [group] => 0 [groupname] => ) [307] => stdClass Object ( [id] => 307 [name] => Размеры плед ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 62 [group] => 0 [groupname] => ) [308] => stdClass Object ( [id] => 308 [name] => Размеры плед ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 63 [group] => 0 [groupname] => ) [309] => stdClass Object ( [id] => 309 [name] => Размеры плед ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 64 [group] => 0 [groupname] => ) [310] => stdClass Object ( [id] => 310 [name] => Размеры плед ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 65 [group] => 0 [groupname] => ) [14] => stdClass Object ( [id] => 14 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 66 [group] => 0 [groupname] => ) [311] => stdClass Object ( [id] => 311 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 67 [group] => 0 [groupname] => ) [312] => stdClass Object ( [id] => 312 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 68 [group] => 0 [groupname] => ) [313] => stdClass Object ( [id] => 313 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 69 [group] => 0 [groupname] => ) [314] => stdClass Object ( [id] => 314 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 70 [group] => 0 [groupname] => ) [315] => stdClass Object ( [id] => 315 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 71 [group] => 0 [groupname] => ) [316] => stdClass Object ( [id] => 316 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 72 [group] => 0 [groupname] => ) [317] => stdClass Object ( [id] => 317 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 73 [group] => 0 [groupname] => ) [318] => stdClass Object ( [id] => 318 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 74 [group] => 0 [groupname] => ) [319] => stdClass Object ( [id] => 319 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 75 [group] => 0 [groupname] => ) [322] => stdClass Object ( [id] => 322 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 76 [group] => 0 [groupname] => ) [320] => stdClass Object ( [id] => 320 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 77 [group] => 0 [groupname] => ) [321] => stdClass Object ( [id] => 321 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 78 [group] => 0 [groupname] => ) [268] => stdClass Object ( [id] => 268 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 [1] => 67 ) [ordering] => 79 [group] => 0 [groupname] => ) [275] => stdClass Object ( [id] => 275 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 80 [group] => 0 [groupname] => ) )
Спустя 21 секунда (5.08.2012 - 11:07) Leopold написал(а):
Array ( [3] => stdClass Object ( [id] => 3 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 ) [ordering] => 1 [group] => 0 [groupname] => ) [8] => stdClass Object ( [id] => 8 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 [1] => 54 ) [ordering] => 2 [group] => 0 [groupname] => ) [280] => stdClass Object ( [id] => 280 [name] => Тип ткани ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 53 [1] => 56 [2] => 57 ) [ordering] => 3 [group] => 0 [groupname] => ) [281] => stdClass Object ( [id] => 281 [name] => Бренд ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 53 [1] => 59 ) [ordering] => 4 [group] => 0 [groupname] => ) [12] => stdClass Object ( [id] => 12 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 54 ) [ordering] => 5 [group] => 0 [groupname] => ) [13] => stdClass Object ( [id] => 13 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 6 [group] => 0 [groupname] => ) [15] => stdClass Object ( [id] => 15 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 56 [1] => 57 [2] => 58 ) [ordering] => 7 [group] => 0 [groupname] => ) [16] => stdClass Object ( [id] => 16 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 58 ) [ordering] => 8 [group] => 0 [groupname] => ) [282] => stdClass Object ( [id] => 282 [name] => Размеры нав [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 58 ) [ordering] => 9 [group] => 0 [groupname] => ) [283] => stdClass Object ( [id] => 283 [name] => Размеры нав [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 58 ) [ordering] => 10 [group] => 0 [groupname] => ) [284] => stdClass Object ( [id] => 284 [name] => Размеры нав [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 58 ) [ordering] => 11 [group] => 0 [groupname] => ) [18] => stdClass Object ( [id] => 18 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 12 [group] => 0 [groupname] => ) [21] => stdClass Object ( [id] => 21 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 46 ) [ordering] => 13 [group] => 0 [groupname] => ) [285] => stdClass Object ( [id] => 285 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 14 [group] => 0 [groupname] => ) [286] => stdClass Object ( [id] => 286 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 15 [group] => 0 [groupname] => ) [287] => stdClass Object ( [id] => 287 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 16 [group] => 0 [groupname] => ) [288] => stdClass Object ( [id] => 288 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 17 [group] => 0 [groupname] => ) [289] => stdClass Object ( [id] => 289 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 18 [group] => 0 [groupname] => ) [290] => stdClass Object ( [id] => 290 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 19 [group] => 0 [groupname] => ) [291] => stdClass Object ( [id] => 291 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 20 [group] => 0 [groupname] => ) [292] => stdClass Object ( [id] => 292 [name] => Тип ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 ) [ordering] => 21 [group] => 0 [groupname] => ) [293] => stdClass Object ( [id] => 293 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 22 [group] => 0 [groupname] => ) [294] => stdClass Object ( [id] => 294 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 23 [group] => 0 [groupname] => ) [295] => stdClass Object ( [id] => 295 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 24 [group] => 0 [groupname] => ) [296] => stdClass Object ( [id] => 296 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 25 [group] => 0 [groupname] => ) [297] => stdClass Object ( [id] => 297 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 26 [group] => 0 [groupname] => ) [298] => stdClass Object ( [id] => 298 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 [1] => 46 ) [ordering] => 27 [group] => 0 [groupname] => ) [23] => stdClass Object ( [id] => 23 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 60 ) [ordering] => 28 [group] => 0 [groupname] => ) [24] => stdClass Object ( [id] => 24 [name] => Тип ткани [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 59 ) [ordering] => 29 [group] => 0 [groupname] => ) [20] => stdClass Object ( [id] => 20 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 44 [1] => 46 [2] => 60 ) [ordering] => 30 [group] => 0 [groupname] => ) [25] => stdClass Object ( [id] => 25 [name] => Наполнитель [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 31 [group] => 0 [groupname] => ) [26] => stdClass Object ( [id] => 26 [name] => Размеры [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 32 [group] => 0 [groupname] => ) [27] => stdClass Object ( [id] => 27 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 33 [group] => 0 [groupname] => ) [28] => stdClass Object ( [id] => 28 [name] => Как любите спать? [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 34 [group] => 0 [groupname] => ) [29] => stdClass Object ( [id] => 29 [name] => Наполнитель [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 35 [group] => 0 [groupname] => ) [32] => stdClass Object ( [id] => 32 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 48 ) [ordering] => 36 [group] => 0 [groupname] => ) [33] => stdClass Object ( [id] => 33 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 37 [group] => 0 [groupname] => ) [35] => stdClass Object ( [id] => 35 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 38 [group] => 0 [groupname] => ) [37] => stdClass Object ( [id] => 37 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 39 [group] => 0 [groupname] => ) [257] => stdClass Object ( [id] => 257 [name] => Размер [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 65 ) [ordering] => 40 [group] => 0 [groupname] => ) [258] => stdClass Object ( [id] => 258 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 65 [1] => 68 [2] => 69 ) [ordering] => 41 [group] => 0 [groupname] => ) [259] => stdClass Object ( [id] => 259 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 65 ) [ordering] => 42 [group] => 0 [groupname] => ) [261] => stdClass Object ( [id] => 261 [name] => Наполнитель [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 69 ) [ordering] => 43 [group] => 0 [groupname] => ) [263] => stdClass Object ( [id] => 263 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 69 ) [ordering] => 44 [group] => 0 [groupname] => ) [264] => stdClass Object ( [id] => 264 [name] => Тип [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 54 ) [ordering] => 45 [group] => 0 [groupname] => ) [265] => stdClass Object ( [id] => 265 [name] => Размер наволочек [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 54 ) [ordering] => 46 [group] => 0 [groupname] => ) [266] => stdClass Object ( [id] => 266 [name] => Размер [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 68 ) [ordering] => 47 [group] => 0 [groupname] => ) [267] => stdClass Object ( [id] => 267 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 68 ) [ordering] => 48 [group] => 0 [groupname] => ) [273] => stdClass Object ( [id] => 273 [name] => Материал [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 49 [group] => 0 [groupname] => ) [274] => stdClass Object ( [id] => 274 [name] => Кол-во салфеток [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 50 [group] => 0 [groupname] => ) [276] => stdClass Object ( [id] => 276 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 77 ) [ordering] => 51 [group] => 0 [groupname] => ) [277] => stdClass Object ( [id] => 277 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 [1] => 53 [2] => 54 [3] => 56 [4] => 57 ) [ordering] => 52 [group] => 0 [groupname] => ) [278] => stdClass Object ( [id] => 278 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 [1] => 53 [2] => 54 [3] => 56 [4] => 57 ) [ordering] => 53 [group] => 0 [groupname] => ) [279] => stdClass Object ( [id] => 279 [name] => Размеры ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 40 ) [ordering] => 54 [group] => 0 [groupname] => ) [299] => stdClass Object ( [id] => 299 [name] => Размеры о ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 55 [group] => 0 [groupname] => ) [300] => stdClass Object ( [id] => 300 [name] => Размеры о ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 56 [group] => 0 [groupname] => ) [301] => stdClass Object ( [id] => 301 [name] => Размеры о ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 57 [group] => 0 [groupname] => ) [302] => stdClass Object ( [id] => 302 [name] => Размеры о ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 58 [group] => 0 [groupname] => ) [303] => stdClass Object ( [id] => 303 [name] => Цвет ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 ) [ordering] => 59 [group] => 0 [groupname] => ) [304] => stdClass Object ( [id] => 304 [name] => Цвет ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 ) [ordering] => 60 [group] => 0 [groupname] => ) [305] => stdClass Object ( [id] => 305 [name] => Цвет ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 136 ) [ordering] => 61 [group] => 0 [groupname] => ) [307] => stdClass Object ( [id] => 307 [name] => Размеры плед ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 62 [group] => 0 [groupname] => ) [308] => stdClass Object ( [id] => 308 [name] => Размеры плед ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 63 [group] => 0 [groupname] => ) [309] => stdClass Object ( [id] => 309 [name] => Размеры плед ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 64 [group] => 0 [groupname] => ) [310] => stdClass Object ( [id] => 310 [name] => Размеры плед ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 65 [group] => 0 [groupname] => ) [14] => stdClass Object ( [id] => 14 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 55 ) [ordering] => 66 [group] => 0 [groupname] => ) [311] => stdClass Object ( [id] => 311 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 67 [group] => 0 [groupname] => ) [312] => stdClass Object ( [id] => 312 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 68 [group] => 0 [groupname] => ) [313] => stdClass Object ( [id] => 313 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 69 [group] => 0 [groupname] => ) [314] => stdClass Object ( [id] => 314 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 70 [group] => 0 [groupname] => ) [315] => stdClass Object ( [id] => 315 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 71 [group] => 0 [groupname] => ) [316] => stdClass Object ( [id] => 316 [name] => Размеры нама ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 63 ) [ordering] => 72 [group] => 0 [groupname] => ) [317] => stdClass Object ( [id] => 317 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 73 [group] => 0 [groupname] => ) [318] => stdClass Object ( [id] => 318 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 74 [group] => 0 [groupname] => ) [319] => stdClass Object ( [id] => 319 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 75 [group] => 0 [groupname] => ) [322] => stdClass Object ( [id] => 322 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 76 [group] => 0 [groupname] => ) [320] => stdClass Object ( [id] => 320 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 77 [group] => 0 [groupname] => ) [321] => stdClass Object ( [id] => 321 [name] => Размеры скаат ™ [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 ) [ordering] => 78 [group] => 0 [groupname] => ) [268] => stdClass Object ( [id] => 268 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 64 [1] => 67 ) [ordering] => 79 [group] => 0 [groupname] => ) [275] => stdClass Object ( [id] => 275 [name] => Бренд [allcats] => 0 [type] => 0 [cats] => Array ( [0] => 62 ) [ordering] => 80 [group] => 0 [groupname] => ) )
Спустя 7 минут, 29 секунд (5.08.2012 - 11:15) RCuPeR написал(а):
Мамадарагая %)
Вместо
Сделай
Вместо
<div class="characteristic_name"><?php print $characteristic_fields[$ch_id]->name;?></div>
Сделай
if($characteristic_fields[$ch_id]->name != 'Размеры ™')
{
<div class="characteristic_name"><?php print $characteristic_fields[$ch_id]->name;?></div>
}
Спустя 1 минута, 44 секунды (5.08.2012 - 11:17) RCuPeR написал(а):
Ой ! У тебя же там немного иначе.
Вот так нужно:
Вот так нужно:
<?php if($characteristic_fields[$ch_id]->name != 'Размеры ™'): ?>
<div class="characteristic_name"><?php print $characteristic_fields[$ch_id]->name;?></div>
<?php endif; ?>
Спустя 9 минут, 40 секунд (5.08.2012 - 11:26) Leopold написал(а):
Первый вариант никак. увидел второй, уже пробую
...
...
Спустя 5 минут, 40 секунд (5.08.2012 - 11:32) Leopold написал(а):
Второй вариант работает.... А как быть если я хочу еще "Бренд" , допустим, убрать. Через запятую ( != 'Размеры ™','Бренд'): ?> ) не получается?
Спустя 5 минут, 35 секунд (5.08.2012 - 11:37) pak написал(а):
как так думаю)
<?php
$arr = array('Бренд', '....');
?>
<?php if(!in_array($characteristic_fields[$ch_id]->name, $arr)): ?>
<div class="characteristic_name"><?php print $characteristic_fields[$ch_id]->name;?></div>
<?php endif;
Спустя 16 минут, 38 секунд (5.08.2012 - 11:54) RCuPeR написал(а):
Да, как pak показал.
Но, а вообще, это лучше делать на уровне модели, а не во вьюшке.
Но, а вообще, это лучше делать на уровне модели, а не во вьюшке.