object(Articles)#296 (21) { ["_oldTags":"Articles":private]=> string(16) "ksenmart, joomla" ["_linkStr"]=> string(47) "kak_vyvesti_svoistva_tovarnoi_gruppy_v_ksenmart" ["widget"]=> int(1) ["dir"]=> string(63) "upload/articles/kak_vyvesti_svoistva_tovarnoi_gruppy_v_ksenmart" ["_url":"Articles":private]=> NULL ["_categories":"Articles":private]=> NULL ["categoryId"]=> string(1) "7" ["layout1"]=> string(0) "" ["referer"]=> string(0) "" ["attributesArray"]=> array(0) { } ["_new":"CActiveRecord":private]=> bool(false) ["_attributes":"CActiveRecord":private]=> array(26) { ["id"]=> string(2) "43" ["category"]=> string(1) "7" ["categoryOn"]=> string(1) "1" ["level"]=> string(1) "0" ["name"]=> string(112) "Как вывести свойства товарной группы в каталоге товаров Ksenmart" ["nameOn"]=> string(1) "1" ["linkStr"]=> string(47) "kak_vyvesti_svoistva_tovarnoi_gruppy_v_ksenmart" ["text"]=> string(4673) "

При разработке интернет-магазина на Joomla с помощью компонента Ksenmart, иногда заказчики желают в каталоге товаров вывести все свойства товарной группы.

В самом каталоге выводится основной товар, и так как в товарной группе может быть несколько товаров, стандартный шаблон каталога Ksenmart не позволяет это сделать.

В этой заметке я расскажу как дополнить шаблон.

Сам шаблон вывода товаров находится в ваш_сайт\components\com_ksenmart\views\catalog\tmpl\default_item.php

В нашем случае нам нужно вывести свойства "подача, мощность и давление" у товарной группы насоса.

Код файла default_item.php будет иметь вид:

<?php
/**
* @copyright Copyright (C) 2013. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

$db = JFactory::getDbo();
$query = $db->getQuery(true);
/* найдем все продукты товарной группы */
$query->select('id')->from('#__ksenmart_products')->where('parent_id = ' . $this->product->id );
$db->setQuery($query);
$rows = $db->loadObjectList();

$pod=array(); $nap=array(); $mosh=array();

foreach($rows as $prop){
$id=KSMProducts::getProperties($prop->id);
foreach($id as $_id){
/* запишем все данные в массив */
if($_id->alias == "podacha") $pod[] = str_replace(" м3/ч","",$_id->text);
if($_id->alias == "moschnost") $mosh[] = str_replace(" кВт","",$_id->text);
if($_id->alias == "davlenie") $nap [] = str_replace(" м","",$_id->text);
}
}
/* удалим дубли и разделим точкой с запятой */
$pod = implode("; ",array_unique($pod));
$mosh = implode("; ",array_unique($mosh));
$nap = implode("; ",array_unique($nap));
?>
<tr class="pupmplistItem">
<td><?php if (!empty($this->product->product_code)): ?>
<?php echo $this->product->product_code; ?>
<?php endif; ?> </td>
<td><a href="<?php echo $this->product->link; ?>"><?php echo $this->product->title; ?></a></td>
<td><?php
if (!empty($this->product->manufacturer_title)){ ?>
<a href="http://<?php echo $_SERVER['HTTP_HOST'];?>/katalog/search/<?php echo $this->product->manufacturer_alias; ?>"><?php echo $this->product->manufacturer_title; ?></a>
<?php } ?></td>
<td class="txtCenter"><?php echo $pod; ?></td>
<td class="txtCenter"><?php echo $nap;
?></td>
<td>
<?php
foreach($this->product->properties as $a=>$prop){
/* вывод свойства товарной группы с типом список значений */
if($prop->property_id == 9){
$a=0;
foreach($prop->values as $val){
$a++;
echo ' <a href="http://'.$_SERVER['HTTP_HOST'].'/katalog/search/sreda='.$val->alias.'">'.$val->title.'</a>';
if($a<count($prop->values))echo ', ';
}
}
}
?>
</td>
<td class="txtCenter"><?php echo $mosh;
?></td>
<td>
<div class="grnButton">
<div class="left"></div>
<div class="right"></div>
<div class="content">
<a href="#">запросить стоимость</a>
</div>
</div>
</td>
</tr>


В итоге получится такая картина:


" ["layout"]=> string(11) "column2-8-4" ["avtor"]=> string(0) "" ["avtorOn"]=> string(1) "0" ["source"]=> string(0) "" ["sourceOn"]=> string(1) "0" ["status"]=> string(1) "1" ["image"]=> string(0) "" ["viewInRss"]=> string(1) "1" ["isHome"]=> string(1) "0" ["seoDescr"]=> string(112) "Как вывести свойства товарной группы в каталоге товаров Ksenmart" ["seoKey"]=> string(16) "ksenmart, joomla" ["tags"]=> string(16) "ksenmart, joomla" ["tagsOn"]=> string(1) "1" ["dataOn"]=> string(1) "0" ["numViews"]=> int(2339) ["numViewsOn"]=> string(1) "1" ["updated"]=> int(1664700846) ["created"]=> string(10) "1561323600" } ["_related":"CActiveRecord":private]=> array(1) { ["categories"]=> object(Category)#328 (18) { ["view1"]=> string(0) "" ["ierarh"]=> int(0) ["oldLinkStr"]=> string(0) "" ["categoryId"]=> NULL ["layout1"]=> string(0) "" ["referer"]=> string(0) "" ["attributesArray"]=> array(0) { } ["_new":"CActiveRecord":private]=> bool(false) ["_attributes":"CActiveRecord":private]=> array(15) { ["id"]=> string(1) "7" ["parentId"]=> string(1) "0" ["level"]=> string(1) "0" ["linkStr"]=> string(3) "web" ["name"]=> string(24) "Web-технологии" ["text"]=> string(122) "
Описываются примеры реализации технологий WEB
" ["layout"]=> string(11) "column2-8-4" ["view"]=> string(7) "default" ["viewArt"]=> string(1) "1" ["viewArtAll"]=> string(1) "0" ["viewParent"]=> string(1) "0" ["sortArt"]=> string(0) "" ["status"]=> string(1) "1" ["updated"]=> string(10) "1617707774" ["created"]=> string(10) "1398888000" } ["_related":"CActiveRecord":private]=> array(0) { } ["_c":"CActiveRecord":private]=> NULL ["_pk":"CActiveRecord":private]=> string(1) "7" ["_alias":"CActiveRecord":private]=> string(1) "t" ["_errors":"CModel":private]=> array(0) { } ["_validators":"CModel":private]=> NULL ["_scenario":"CModel":private]=> string(6) "update" ["_e":"CComponent":private]=> array(2) { ["onbeforesave"]=> object(CList)#331 (5) { ["_d":"CList":private]=> array(1) { [0]=> array(2) { [0]=> object(AutoTimestampBehavior)#329 (6) { ["created"]=> string(7) "created" ["modified"]=> string(7) "updated" ["_enabled":"CBehavior":private]=> bool(true) ["_owner":"CBehavior":private]=> *RECURSION* ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } [1]=> string(10) "beforeSave" } } ["_c":"CList":private]=> int(1) ["_r":"CList":private]=> bool(false) ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } ["onafterconstruct"]=> object(CList)#333 (5) { ["_d":"CList":private]=> array(1) { [0]=> array(2) { [0]=> object(AdminBehavior)#330 (8) { ["columns"]=> array(10) { ["id"]=> array(3) { ["name"]=> string(2) "id" ["header"]=> string(1) "#" ["filter"]=> string(0) "" } [0]=> array(8) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(4) "name" ["header"]=> string(16) "Название" ["type"]=> string(4) "link" ["model"]=> string(8) "Category" ["titles"]=> array(1) { [1]=> string(12) "$model->name" } ["linkUrl"]=> string(87) ""/admin/category/update/".$data->id.($data->parentId ? "?parentId=".$data->parentId:"")" ["htmlOptions"]=> array(1) { ["style"]=> string(11) "width:400px" } } [1]=> array(9) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(8) "parentId" ["header"]=> string(0) "" ["type"]=> string(7) "linkCat" ["model"]=> string(8) "Category" ["value"]=> string(67) ""Подкатегорий: ".count(Category::findChilds($data->id))" ["linkUrl"]=> string(38) ""/admin/category/?parentId=".$data->id" ["htmlOptions"]=> array(1) { ["style"]=> string(11) "width:200px" } ["filter"]=> bool(false) } ["linkStr"]=> array(8) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(7) "linkStr" ["header"]=> string(10) "Алиас" ["type"]=> string(4) "link" ["model"]=> string(8) "Category" ["titles"]=> string(43) "Открыть в новой вкладке" ["linkUrl"]=> string(18) ""/".$data->linkStr" ["htmlOptions"]=> array(1) { ["style"]=> string(48) "text-align:left;max-width:30px;overflow: hidden;" } } [2]=> array(5) { ["class"]=> string(34) "bootstrap.widgets.TbEditableColumn" ["name"]=> string(5) "level" ["editable"]=> array(3) { ["name"]=> string(5) "level" ["url"]=> string(26) "/admin/updateLevelCategory" ["placement"]=> string(3) "top" } ["filter"]=> bool(false) ["htmlOptions"]=> array(1) { ["style"]=> string(30) "width:50px;text-align: center;" } } [3]=> array(13) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(5) "level" ["upDown"]=> string(1) "0" ["header"]=> string(1) " " ["filter"]=> bool(false) ["countItems"]=> NULL ["type"]=> string(6) "upDown" ["model"]=> string(8) "Category" ["titles"]=> array(1) { [1]=> string(33) "переместить вверх" } ["onImageUrl"]=> string(20) "/images/orderMAX.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(74) ""/admin/orderMAX/".$this->model."-".$data->id."?parentId=".$data->parentId" ["htmlOptions"]=> array(1) { ["style"]=> string(28) "width:20px;text-align:center" } } [4]=> array(13) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(5) "level" ["upDown"]=> string(1) "1" ["header"]=> string(1) " " ["filter"]=> bool(false) ["type"]=> string(6) "upDown" ["model"]=> string(8) "Category" ["countItems"]=> NULL ["titles"]=> array(1) { [1]=> string(31) "переместить вниз" } ["onImageUrl"]=> string(20) "/images/orderMIN.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(74) ""/admin/orderMIN/".$this->model."-".$data->id."?parentId=".$data->parentId" ["htmlOptions"]=> array(1) { ["style"]=> string(29) "width:40px;padding-right:20px" } } [5]=> array(12) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(6) "status" ["header"]=> string(18) "Состояние" ["filter"]=> array(2) { [0]=> string(34) "снято с публикации" [1]=> string(24) "опубликовано" } ["type"]=> string(6) "status" ["model"]=> string(8) "Category" ["titles"]=> array(2) { [0]=> string(24) "опубликовать" [1]=> string(34) "снять с публикации" } ["onImageUrl"]=> string(15) "/images/yes.png" ["offImageUrl"]=> string(14) "/images/no.png" ["imageSize"]=> string(2) "15" ["linkUrl"]=> string(43) ""/admin/status/".$this->model."-".$data->id" ["htmlOptions"]=> array(1) { ["style"]=> string(26) "text-align:left;width:30px" } } ["created"]=> array(5) { ["name"]=> string(7) "created" ["header"]=> string(16) "Дата created" ["filter"]=> bool(false) ["value"]=> string(59) "date(Yii::app()->controller->dateFormatAdm, $data->created)" ["htmlOptions"]=> array(1) { ["style"]=> string(15) "text-align:left" } } ["updated"]=> array(5) { ["name"]=> string(7) "updated" ["header"]=> string(16) "Дата updated" ["filter"]=> bool(false) ["value"]=> string(59) "date(Yii::app()->controller->dateFormatAdm, $data->updated)" ["htmlOptions"]=> array(1) { ["style"]=> string(15) "text-align:left" } } } ["childs"]=> array(0) { } ["fields"]=> array(1) { [0]=> array(1) { ["tabbable"]=> array(2) { [0]=> array(9) { ["name0"]=> string(16) "Основные" [0]=> array(3) { ["name"]=> string(21) "ID категории" ["attribute"]=> string(2) "id" ["type"]=> string(4) "text" } [1]=> array(3) { ["name"]=> string(16) "Название" ["attribute"]=> string(4) "name" ["type"]=> string(12) "textFieldRow" } [2]=> array(3) { ["name"]=> string(25) "Алиас (ссылка)" ["attribute"]=> string(7) "linkStr" ["type"]=> string(12) "textFieldRow" } [3]=> array(4) { ["name"]=> string(0) "" ["attribute"]=> string(10) "oldLinkStr" ["type"]=> string(6) "hidden" ["doubleAtt"]=> string(7) "linkStr" } [4]=> array(4) { ["name"]=> string(35) "Корневая категория" ["attribute"]=> string(8) "parentId" ["type"]=> string(22) "dropDownIerarhCategory" ["data"]=> array(1) { ["updateAtt"]=> string(10) "categoryId" } } [5]=> array(4) { ["name"]=> string(21) "ID категории" ["attribute"]=> string(10) "categoryId" ["type"]=> string(12) "textFieldRow" ["doubleAtt"]=> string(8) "parentId" } [6]=> array(3) { ["name"]=> string(14) "Порядок" ["attribute"]=> string(5) "level" ["type"]=> string(12) "textFieldRow" } [7]=> array(3) { ["name"]=> string(16) "Описание" ["attribute"]=> string(4) "text" ["type"]=> string(7) "tinymce" } } [1]=> array(9) { ["name1"]=> string(26) "Дополнительно" [0]=> array(5) { ["name"]=> string(10) "Макет" ["attribute"]=> string(7) "layout1" ["type"]=> string(10) "dropDownCl" ["array"]=> array(5) { ["column1-12"]=> string(10) "column1-12" ["column2-4-8"]=> string(11) "column2-4-8" ["column2-6-6"]=> string(11) "column2-6-6" ["column2-8-4"]=> string(11) "column2-8-4" ["column2-3-9"]=> string(11) "column2-3-9" } ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(25) "Текущий макет" ["attribute"]=> string(6) "layout" ["type"]=> string(4) "text" } } } [1]=> array(5) { ["name"]=> string(25) "Вид категории" ["attribute"]=> string(5) "view1" ["type"]=> string(10) "dropDownCl" ["array"]=> array(3) { ["viewItems"]=> string(9) "viewItems" ["viewItems1"]=> string(10) "viewItems1" ["default"]=> string(7) "default" } ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(21) "Текущий вид" ["attribute"]=> string(4) "view" ["type"]=> string(4) "text" } } } [2]=> array(3) { ["name"]=> string(52) "Отображать статьи категории" ["attribute"]=> string(7) "viewArt" ["type"]=> string(15) "toggleButtonRow" } [3]=> array(3) { ["name"]=> string(45) "Отображать подкатегории" ["attribute"]=> string(10) "viewParent" ["type"]=> string(15) "toggleButtonRow" } [4]=> array(3) { ["name"]=> string(58) "Отображать статьи подкатегорий" ["attribute"]=> string(10) "viewArtAll" ["type"]=> string(15) "toggleButtonRow" } [5]=> array(3) { ["name"]=> string(18) "Состояние" ["attribute"]=> string(6) "status" ["type"]=> string(15) "toggleButtonRow" } [6]=> array(3) { ["name"]=> string(25) "Дата создания" ["attribute"]=> string(7) "created" ["type"]=> string(13) "datePickerRow" } [7]=> array(3) { ["name"]=> string(29) "Дата обновления" ["attribute"]=> string(7) "updated" ["type"]=> string(13) "datePickerRow" } } } } } ["ierarh"]=> bool(true) ["_enabled":"CBehavior":private]=> bool(true) ["_owner":"CBehavior":private]=> *RECURSION* ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } [1]=> string(14) "afterConstruct" } } ["_c":"CList":private]=> int(1) ["_r":"CList":private]=> bool(false) ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } } ["_m":"CComponent":private]=> array(2) { ["AutoTimestampBehavior"]=> object(AutoTimestampBehavior)#329 (6) { ["created"]=> string(7) "created" ["modified"]=> string(7) "updated" ["_enabled":"CBehavior":private]=> bool(true) ["_owner":"CBehavior":private]=> *RECURSION* ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } ["AdminBehavior"]=> object(AdminBehavior)#330 (8) { ["columns"]=> array(10) { ["id"]=> array(3) { ["name"]=> string(2) "id" ["header"]=> string(1) "#" ["filter"]=> string(0) "" } [0]=> array(8) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(4) "name" ["header"]=> string(16) "Название" ["type"]=> string(4) "link" ["model"]=> string(8) "Category" ["titles"]=> array(1) { [1]=> string(12) "$model->name" } ["linkUrl"]=> string(87) ""/admin/category/update/".$data->id.($data->parentId ? "?parentId=".$data->parentId:"")" ["htmlOptions"]=> array(1) { ["style"]=> string(11) "width:400px" } } [1]=> array(9) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(8) "parentId" ["header"]=> string(0) "" ["type"]=> string(7) "linkCat" ["model"]=> string(8) "Category" ["value"]=> string(67) ""Подкатегорий: ".count(Category::findChilds($data->id))" ["linkUrl"]=> string(38) ""/admin/category/?parentId=".$data->id" ["htmlOptions"]=> array(1) { ["style"]=> string(11) "width:200px" } ["filter"]=> bool(false) } ["linkStr"]=> array(8) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(7) "linkStr" ["header"]=> string(10) "Алиас" ["type"]=> string(4) "link" ["model"]=> string(8) "Category" ["titles"]=> string(43) "Открыть в новой вкладке" ["linkUrl"]=> string(18) ""/".$data->linkStr" ["htmlOptions"]=> array(1) { ["style"]=> string(48) "text-align:left;max-width:30px;overflow: hidden;" } } [2]=> array(5) { ["class"]=> string(34) "bootstrap.widgets.TbEditableColumn" ["name"]=> string(5) "level" ["editable"]=> array(3) { ["name"]=> string(5) "level" ["url"]=> string(26) "/admin/updateLevelCategory" ["placement"]=> string(3) "top" } ["filter"]=> bool(false) ["htmlOptions"]=> array(1) { ["style"]=> string(30) "width:50px;text-align: center;" } } [3]=> array(13) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(5) "level" ["upDown"]=> string(1) "0" ["header"]=> string(1) " " ["filter"]=> bool(false) ["countItems"]=> NULL ["type"]=> string(6) "upDown" ["model"]=> string(8) "Category" ["titles"]=> array(1) { [1]=> string(33) "переместить вверх" } ["onImageUrl"]=> string(20) "/images/orderMAX.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(74) ""/admin/orderMAX/".$this->model."-".$data->id."?parentId=".$data->parentId" ["htmlOptions"]=> array(1) { ["style"]=> string(28) "width:20px;text-align:center" } } [4]=> array(13) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(5) "level" ["upDown"]=> string(1) "1" ["header"]=> string(1) " " ["filter"]=> bool(false) ["type"]=> string(6) "upDown" ["model"]=> string(8) "Category" ["countItems"]=> NULL ["titles"]=> array(1) { [1]=> string(31) "переместить вниз" } ["onImageUrl"]=> string(20) "/images/orderMIN.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(74) ""/admin/orderMIN/".$this->model."-".$data->id."?parentId=".$data->parentId" ["htmlOptions"]=> array(1) { ["style"]=> string(29) "width:40px;padding-right:20px" } } [5]=> array(12) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(6) "status" ["header"]=> string(18) "Состояние" ["filter"]=> array(2) { [0]=> string(34) "снято с публикации" [1]=> string(24) "опубликовано" } ["type"]=> string(6) "status" ["model"]=> string(8) "Category" ["titles"]=> array(2) { [0]=> string(24) "опубликовать" [1]=> string(34) "снять с публикации" } ["onImageUrl"]=> string(15) "/images/yes.png" ["offImageUrl"]=> string(14) "/images/no.png" ["imageSize"]=> string(2) "15" ["linkUrl"]=> string(43) ""/admin/status/".$this->model."-".$data->id" ["htmlOptions"]=> array(1) { ["style"]=> string(26) "text-align:left;width:30px" } } ["created"]=> array(5) { ["name"]=> string(7) "created" ["header"]=> string(16) "Дата created" ["filter"]=> bool(false) ["value"]=> string(59) "date(Yii::app()->controller->dateFormatAdm, $data->created)" ["htmlOptions"]=> array(1) { ["style"]=> string(15) "text-align:left" } } ["updated"]=> array(5) { ["name"]=> string(7) "updated" ["header"]=> string(16) "Дата updated" ["filter"]=> bool(false) ["value"]=> string(59) "date(Yii::app()->controller->dateFormatAdm, $data->updated)" ["htmlOptions"]=> array(1) { ["style"]=> string(15) "text-align:left" } } } ["childs"]=> array(0) { } ["fields"]=> array(1) { [0]=> array(1) { ["tabbable"]=> array(2) { [0]=> array(9) { ["name0"]=> string(16) "Основные" [0]=> array(3) { ["name"]=> string(21) "ID категории" ["attribute"]=> string(2) "id" ["type"]=> string(4) "text" } [1]=> array(3) { ["name"]=> string(16) "Название" ["attribute"]=> string(4) "name" ["type"]=> string(12) "textFieldRow" } [2]=> array(3) { ["name"]=> string(25) "Алиас (ссылка)" ["attribute"]=> string(7) "linkStr" ["type"]=> string(12) "textFieldRow" } [3]=> array(4) { ["name"]=> string(0) "" ["attribute"]=> string(10) "oldLinkStr" ["type"]=> string(6) "hidden" ["doubleAtt"]=> string(7) "linkStr" } [4]=> array(4) { ["name"]=> string(35) "Корневая категория" ["attribute"]=> string(8) "parentId" ["type"]=> string(22) "dropDownIerarhCategory" ["data"]=> array(1) { ["updateAtt"]=> string(10) "categoryId" } } [5]=> array(4) { ["name"]=> string(21) "ID категории" ["attribute"]=> string(10) "categoryId" ["type"]=> string(12) "textFieldRow" ["doubleAtt"]=> string(8) "parentId" } [6]=> array(3) { ["name"]=> string(14) "Порядок" ["attribute"]=> string(5) "level" ["type"]=> string(12) "textFieldRow" } [7]=> array(3) { ["name"]=> string(16) "Описание" ["attribute"]=> string(4) "text" ["type"]=> string(7) "tinymce" } } [1]=> array(9) { ["name1"]=> string(26) "Дополнительно" [0]=> array(5) { ["name"]=> string(10) "Макет" ["attribute"]=> string(7) "layout1" ["type"]=> string(10) "dropDownCl" ["array"]=> array(5) { ["column1-12"]=> string(10) "column1-12" ["column2-4-8"]=> string(11) "column2-4-8" ["column2-6-6"]=> string(11) "column2-6-6" ["column2-8-4"]=> string(11) "column2-8-4" ["column2-3-9"]=> string(11) "column2-3-9" } ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(25) "Текущий макет" ["attribute"]=> string(6) "layout" ["type"]=> string(4) "text" } } } [1]=> array(5) { ["name"]=> string(25) "Вид категории" ["attribute"]=> string(5) "view1" ["type"]=> string(10) "dropDownCl" ["array"]=> array(3) { ["viewItems"]=> string(9) "viewItems" ["viewItems1"]=> string(10) "viewItems1" ["default"]=> string(7) "default" } ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(21) "Текущий вид" ["attribute"]=> string(4) "view" ["type"]=> string(4) "text" } } } [2]=> array(3) { ["name"]=> string(52) "Отображать статьи категории" ["attribute"]=> string(7) "viewArt" ["type"]=> string(15) "toggleButtonRow" } [3]=> array(3) { ["name"]=> string(45) "Отображать подкатегории" ["attribute"]=> string(10) "viewParent" ["type"]=> string(15) "toggleButtonRow" } [4]=> array(3) { ["name"]=> string(58) "Отображать статьи подкатегорий" ["attribute"]=> string(10) "viewArtAll" ["type"]=> string(15) "toggleButtonRow" } [5]=> array(3) { ["name"]=> string(18) "Состояние" ["attribute"]=> string(6) "status" ["type"]=> string(15) "toggleButtonRow" } [6]=> array(3) { ["name"]=> string(25) "Дата создания" ["attribute"]=> string(7) "created" ["type"]=> string(13) "datePickerRow" } [7]=> array(3) { ["name"]=> string(29) "Дата обновления" ["attribute"]=> string(7) "updated" ["type"]=> string(13) "datePickerRow" } } } } } ["ierarh"]=> bool(true) ["_enabled":"CBehavior":private]=> bool(true) ["_owner":"CBehavior":private]=> *RECURSION* ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } } } } ["_c":"CActiveRecord":private]=> NULL ["_pk":"CActiveRecord":private]=> string(2) "43" ["_alias":"CActiveRecord":private]=> string(1) "t" ["_errors":"CModel":private]=> array(0) { } ["_validators":"CModel":private]=> NULL ["_scenario":"CModel":private]=> string(6) "update" ["_e":"CComponent":private]=> array(2) { ["onbeforesave"]=> object(CList)#299 (5) { ["_d":"CList":private]=> array(1) { [0]=> array(2) { [0]=> object(AutoTimestampBehavior)#297 (6) { ["created"]=> string(7) "created" ["modified"]=> string(7) "updated" ["_enabled":"CBehavior":private]=> bool(true) ["_owner":"CBehavior":private]=> *RECURSION* ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } [1]=> string(10) "beforeSave" } } ["_c":"CList":private]=> int(1) ["_r":"CList":private]=> bool(false) ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } ["onafterconstruct"]=> object(CList)#301 (5) { ["_d":"CList":private]=> array(1) { [0]=> array(2) { [0]=> object(AdminBehavior)#298 (8) { ["columns"]=> array(11) { ["id"]=> array(4) { ["name"]=> string(2) "id" ["header"]=> string(2) "ID" ["filter"]=> string(0) "" ["htmlOptions"]=> array(1) { ["style"]=> string(14) "min-width:30px" } } [0]=> array(5) { ["class"]=> string(12) "EImageColumn" ["name"]=> string(5) "image" ["pathPrefix"]=> string(17) "/upload/articles/" ["htmlOptions"]=> array(1) { ["style"]=> string(12) "width: 50px;" } ["defaultImage"]=> string(32) "/themes/tester40/img/default.png" } [1]=> array(9) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(4) "name" ["header"]=> string(16) "Название" ["type"]=> string(4) "link" ["model"]=> string(8) "Articles" ["titles"]=> array(1) { [1]=> string(12) "$model->name" } ["dataToggle"]=> array(2) { ["title"]=> string(43) "Количество просмотров: " ["data"]=> string(8) "numViews" } ["linkUrl"]=> string(134) ""/admin/articles/update/" . $data->id . (isset($_GET["Articles"]["category"])?"?Articles[category]=".$_GET["Articles"]["category"]:"")" ["htmlOptions"]=> array(1) { ["style"]=> string(11) "width:500px" } } ["category"]=> array(6) { ["name"]=> string(8) "category" ["header"]=> string(18) "Категория" ["value"]=> string(23) "$data->artCatBehCache()" ["filter"]=> string(0) "" ["type"]=> string(3) "raw" ["htmlOptions"]=> array(1) { ["style"]=> string(15) "min-width:100px" } } [2]=> array(5) { ["class"]=> string(34) "bootstrap.widgets.TbEditableColumn" ["name"]=> string(5) "level" ["editable"]=> array(3) { ["name"]=> string(5) "level" ["url"]=> string(26) "/admin/updateLevelArticles" ["placement"]=> string(3) "top" } ["filter"]=> bool(false) ["htmlOptions"]=> array(1) { ["style"]=> string(30) "width:50px;text-align: center;" } } [3]=> array(13) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(5) "level" ["upDown"]=> string(1) "0" ["header"]=> string(1) " " ["filter"]=> bool(false) ["countItems"]=> int(0) ["type"]=> string(6) "upDown" ["model"]=> string(8) "Articles" ["titles"]=> array(1) { [1]=> string(33) "переместить вверх" } ["onImageUrl"]=> string(20) "/images/orderMAX.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(74) ""/admin/orderMAX/".$this->model."-".$data->id."?category=".$data->category" ["htmlOptions"]=> array(1) { ["style"]=> string(28) "width:20px;text-align:center" } } [4]=> array(13) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(5) "level" ["upDown"]=> string(1) "1" ["header"]=> string(1) " " ["filter"]=> bool(false) ["type"]=> string(6) "upDown" ["model"]=> string(8) "Articles" ["countItems"]=> int(0) ["titles"]=> array(1) { [1]=> string(31) "переместить вниз" } ["onImageUrl"]=> string(20) "/images/orderMIN.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(74) ""/admin/orderMIN/".$this->model."-".$data->id."?category=".$data->category" ["htmlOptions"]=> array(1) { ["style"]=> string(29) "width:40px;padding-right:20px" } } [5]=> array(12) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(6) "isHome" ["header"]=> string(1) " " ["filter"]=> bool(false) ["type"]=> string(6) "isHome" ["model"]=> string(8) "Articles" ["titles"]=> array(2) { [0]=> string(33) "сделать стартовой" [1]=> string(28) "снять с главной" } ["onImageUrl"]=> string(19) "/images/default.png" ["offImageUrl"]=> string(22) "/images/notdefault.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(41) ""/admin/home/".$this->model."-".$data->id" ["htmlOptions"]=> array(1) { ["style"]=> string(14) "min-width:30px" } } [6]=> array(12) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(6) "status" ["header"]=> string(1) " " ["filter"]=> array(2) { [0]=> string(34) "снято с публикации" [1]=> string(24) "опубликовано" } ["type"]=> string(6) "status" ["model"]=> string(8) "Articles" ["titles"]=> array(2) { [0]=> string(24) "опубликовать" [1]=> string(34) "снять с публикации" } ["onImageUrl"]=> string(15) "/images/yes.png" ["offImageUrl"]=> string(14) "/images/no.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(43) ""/admin/status/".$this->model."-".$data->id" ["htmlOptions"]=> array(1) { ["style"]=> string(10) "width:70px" } } ["created"]=> array(4) { ["name"]=> string(7) "created" ["header"]=> string(16) "Дата created" ["value"]=> string(59) "date(Yii::app()->controller->dateFormatAdm, $data->created)" ["htmlOptions"]=> array(1) { ["style"]=> string(15) "text-align:left" } } ["updated"]=> array(5) { ["name"]=> string(7) "updated" ["header"]=> string(16) "Дата updated" ["value"]=> string(59) "date(Yii::app()->controller->dateFormatAdm, $data->updated)" ["filter"]=> bool(false) ["htmlOptions"]=> array(1) { ["style"]=> string(16) "min-width:150px;" } } } ["childs"]=> array(0) { } ["fields"]=> array(2) { [0]=> array(1) { ["tabbable"]=> array(2) { [0]=> array(14) { ["name0"]=> string(16) "Основные" [0]=> array(3) { ["name"]=> string(19) "ID страницы" ["attribute"]=> string(2) "id" ["type"]=> string(4) "text" } [1]=> array(3) { ["name"]=> string(18) "Заголовок" ["attribute"]=> string(4) "name" ["type"]=> string(12) "textFieldRow" } [2]=> array(3) { ["name"]=> string(39) "Показывать заголовок" ["attribute"]=> string(6) "nameOn" ["type"]=> string(15) "toggleButtonRow" } [3]=> array(3) { ["name"]=> string(25) "Алиас (ссылка)" ["attribute"]=> string(7) "linkStr" ["type"]=> string(12) "textFieldRow" } [4]=> array(3) { ["name"]=> string(18) "Состояние" ["attribute"]=> string(6) "status" ["type"]=> string(15) "toggleButtonRow" } [5]=> array(4) { ["name"]=> string(18) "Категория" ["attribute"]=> string(8) "category" ["type"]=> string(22) "dropDownIerarhCategory" ["data"]=> array(1) { ["updateAtt"]=> string(10) "categoryId" } } [6]=> array(4) { ["name"]=> string(21) "ID категории" ["attribute"]=> string(10) "categoryId" ["type"]=> string(12) "textFieldRow" ["doubleAtt"]=> string(8) "category" } [7]=> array(3) { ["name"]=> string(14) "Порядок" ["attribute"]=> string(5) "level" ["type"]=> string(12) "textFieldRow" } [8]=> array(3) { ["name"]=> string(38) "Показывать в ленте RSS" ["attribute"]=> string(9) "viewInRss" ["type"]=> string(15) "toggleButtonRow" } [9]=> array(4) { ["name"]=> string(38) "Изображение к статье" ["attribute"]=> string(5) "image" ["type"]=> string(4) "file" ["htmlOptions"]=> array(3) { ["data-toggle"]=> string(7) "tooltip" ["data-placement"]=> string(5) "right" ["data-original-title"]=> string(25) "Выберите файл" } } [10]=> array(5) { ["name"]=> string(22) "Изображение" ["attribute"]=> string(5) "image" ["type"]=> string(5) "image" ["src"]=> string(35) "http://tester40.ru/upload/articles/" ["htmlOptions"]=> array(4) { ["style"]=> string(9) "width:30%" ["data-toggle"]=> string(7) "tooltip" ["data-placement"]=> string(5) "right" ["data-original-title"]=> string(71) "Нажмите, для просмотра полного размера" } } [11]=> array(4) { ["name"]=> string(42) "Путь к файлу на сервере" ["attribute"]=> string(5) "image" ["type"]=> string(4) "text" ["before"]=> string(17) "/upload/articles/" } [12]=> array(4) { ["name"]=> string(33) "Содержание статьи" ["attribute"]=> string(4) "text" ["type"]=> string(7) "tinymce" ["widgetInText"]=> int(1) } } [1]=> array(13) { ["name1"]=> string(18) "Параметры" [0]=> array(5) { ["name"]=> string(10) "Макет" ["attribute"]=> string(7) "layout1" ["type"]=> string(10) "dropDownCl" ["array"]=> array(5) { ["column1-12"]=> string(10) "column1-12" ["column2-4-8"]=> string(11) "column2-4-8" ["column2-6-6"]=> string(11) "column2-6-6" ["column2-8-4"]=> string(11) "column2-8-4" ["column2-3-9"]=> string(11) "column2-3-9" } ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(25) "Текущий макет" ["attribute"]=> string(6) "layout" ["type"]=> string(4) "text" } } } [1]=> array(3) { ["name"]=> string(39) "Отображать Категорию" ["attribute"]=> string(10) "categoryOn" ["type"]=> string(15) "toggleButtonRow" } [2]=> array(4) { ["name"]=> string(31) "Отображать метки" ["attribute"]=> string(6) "tagsOn" ["type"]=> string(15) "toggleButtonRow" ["addField"]=> array(1) { [0]=> array(4) { ["name"]=> string(10) "Метки" ["attribute"]=> string(4) "tags" ["type"]=> string(11) "textAreaRow" ["htmlOptions"]=> array(3) { ["data-toggle"]=> string(7) "tooltip" ["data-placement"]=> string(5) "right" ["data-original-title"]=> string(25) "через запятую" } } } } [3]=> array(4) { ["name"]=> string(33) "Отображать автора" ["attribute"]=> string(7) "avtorOn" ["type"]=> string(15) "toggleButtonRow" ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(10) "Автор" ["attribute"]=> string(5) "avtor" ["type"]=> string(12) "textFieldRow" } } } [4]=> array(4) { ["name"]=> string(37) "Отображать источник" ["attribute"]=> string(8) "sourceOn" ["type"]=> string(15) "toggleButtonRow" ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(16) "Источник" ["attribute"]=> string(6) "source" ["type"]=> string(12) "textFieldRow" } } } [5]=> array(3) { ["name"]=> string(29) "Отображать дату" ["attribute"]=> string(6) "dataOn" ["type"]=> string(15) "toggleButtonRow" } [6]=> array(3) { ["name"]=> string(25) "Дата создания" ["attribute"]=> string(7) "created" ["type"]=> string(13) "datePickerRow" } [7]=> array(3) { ["name"]=> string(27) "Meta описание (SEO)" ["attribute"]=> string(8) "seoDescr" ["type"]=> string(11) "textAreaRow" } [8]=> array(3) { ["name"]=> string(38) "Meta ключевые слова (SEO)" ["attribute"]=> string(6) "seoKey" ["type"]=> string(11) "textAreaRow" } [9]=> array(3) { ["name"]=> string(62) "Отображать количество просмотров" ["attribute"]=> string(10) "numViewsOn" ["type"]=> string(15) "toggleButtonRow" } [10]=> array(3) { ["name"]=> string(41) "Количество просмотров" ["attribute"]=> string(8) "numViews" ["type"]=> string(4) "text" } [11]=> array(3) { ["name"]=> string(29) "Дата обновления" ["attribute"]=> string(7) "updated" ["type"]=> string(13) "datePickerRow" } } } } [1]=> array(4) { ["name"]=> string(16) "Редирект" ["attribute"]=> string(7) "referer" ["type"]=> string(6) "hidden" ["noVisibleHR"]=> string(0) "" } } ["ierarh"]=> int(0) ["_enabled":"CBehavior":private]=> bool(true) ["_owner":"CBehavior":private]=> *RECURSION* ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } [1]=> string(14) "afterConstruct" } } ["_c":"CList":private]=> int(1) ["_r":"CList":private]=> bool(false) ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } } ["_m":"CComponent":private]=> array(2) { ["AutoTimestampBehavior"]=> object(AutoTimestampBehavior)#297 (6) { ["created"]=> string(7) "created" ["modified"]=> string(7) "updated" ["_enabled":"CBehavior":private]=> bool(true) ["_owner":"CBehavior":private]=> *RECURSION* ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } ["AdminBehavior"]=> object(AdminBehavior)#298 (8) { ["columns"]=> array(11) { ["id"]=> array(4) { ["name"]=> string(2) "id" ["header"]=> string(2) "ID" ["filter"]=> string(0) "" ["htmlOptions"]=> array(1) { ["style"]=> string(14) "min-width:30px" } } [0]=> array(5) { ["class"]=> string(12) "EImageColumn" ["name"]=> string(5) "image" ["pathPrefix"]=> string(17) "/upload/articles/" ["htmlOptions"]=> array(1) { ["style"]=> string(12) "width: 50px;" } ["defaultImage"]=> string(32) "/themes/tester40/img/default.png" } [1]=> array(9) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(4) "name" ["header"]=> string(16) "Название" ["type"]=> string(4) "link" ["model"]=> string(8) "Articles" ["titles"]=> array(1) { [1]=> string(12) "$model->name" } ["dataToggle"]=> array(2) { ["title"]=> string(43) "Количество просмотров: " ["data"]=> string(8) "numViews" } ["linkUrl"]=> string(134) ""/admin/articles/update/" . $data->id . (isset($_GET["Articles"]["category"])?"?Articles[category]=".$_GET["Articles"]["category"]:"")" ["htmlOptions"]=> array(1) { ["style"]=> string(11) "width:500px" } } ["category"]=> array(6) { ["name"]=> string(8) "category" ["header"]=> string(18) "Категория" ["value"]=> string(23) "$data->artCatBehCache()" ["filter"]=> string(0) "" ["type"]=> string(3) "raw" ["htmlOptions"]=> array(1) { ["style"]=> string(15) "min-width:100px" } } [2]=> array(5) { ["class"]=> string(34) "bootstrap.widgets.TbEditableColumn" ["name"]=> string(5) "level" ["editable"]=> array(3) { ["name"]=> string(5) "level" ["url"]=> string(26) "/admin/updateLevelArticles" ["placement"]=> string(3) "top" } ["filter"]=> bool(false) ["htmlOptions"]=> array(1) { ["style"]=> string(30) "width:50px;text-align: center;" } } [3]=> array(13) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(5) "level" ["upDown"]=> string(1) "0" ["header"]=> string(1) " " ["filter"]=> bool(false) ["countItems"]=> int(0) ["type"]=> string(6) "upDown" ["model"]=> string(8) "Articles" ["titles"]=> array(1) { [1]=> string(33) "переместить вверх" } ["onImageUrl"]=> string(20) "/images/orderMAX.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(74) ""/admin/orderMAX/".$this->model."-".$data->id."?category=".$data->category" ["htmlOptions"]=> array(1) { ["style"]=> string(28) "width:20px;text-align:center" } } [4]=> array(13) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(5) "level" ["upDown"]=> string(1) "1" ["header"]=> string(1) " " ["filter"]=> bool(false) ["type"]=> string(6) "upDown" ["model"]=> string(8) "Articles" ["countItems"]=> int(0) ["titles"]=> array(1) { [1]=> string(31) "переместить вниз" } ["onImageUrl"]=> string(20) "/images/orderMIN.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(74) ""/admin/orderMIN/".$this->model."-".$data->id."?category=".$data->category" ["htmlOptions"]=> array(1) { ["style"]=> string(29) "width:40px;padding-right:20px" } } [5]=> array(12) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(6) "isHome" ["header"]=> string(1) " " ["filter"]=> bool(false) ["type"]=> string(6) "isHome" ["model"]=> string(8) "Articles" ["titles"]=> array(2) { [0]=> string(33) "сделать стартовой" [1]=> string(28) "снять с главной" } ["onImageUrl"]=> string(19) "/images/default.png" ["offImageUrl"]=> string(22) "/images/notdefault.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(41) ""/admin/home/".$this->model."-".$data->id" ["htmlOptions"]=> array(1) { ["style"]=> string(14) "min-width:30px" } } [6]=> array(12) { ["class"]=> string(13) "DToggleColumn" ["name"]=> string(6) "status" ["header"]=> string(1) " " ["filter"]=> array(2) { [0]=> string(34) "снято с публикации" [1]=> string(24) "опубликовано" } ["type"]=> string(6) "status" ["model"]=> string(8) "Articles" ["titles"]=> array(2) { [0]=> string(24) "опубликовать" [1]=> string(34) "снять с публикации" } ["onImageUrl"]=> string(15) "/images/yes.png" ["offImageUrl"]=> string(14) "/images/no.png" ["imageSize"]=> string(4) "20px" ["linkUrl"]=> string(43) ""/admin/status/".$this->model."-".$data->id" ["htmlOptions"]=> array(1) { ["style"]=> string(10) "width:70px" } } ["created"]=> array(4) { ["name"]=> string(7) "created" ["header"]=> string(16) "Дата created" ["value"]=> string(59) "date(Yii::app()->controller->dateFormatAdm, $data->created)" ["htmlOptions"]=> array(1) { ["style"]=> string(15) "text-align:left" } } ["updated"]=> array(5) { ["name"]=> string(7) "updated" ["header"]=> string(16) "Дата updated" ["value"]=> string(59) "date(Yii::app()->controller->dateFormatAdm, $data->updated)" ["filter"]=> bool(false) ["htmlOptions"]=> array(1) { ["style"]=> string(16) "min-width:150px;" } } } ["childs"]=> array(0) { } ["fields"]=> array(2) { [0]=> array(1) { ["tabbable"]=> array(2) { [0]=> array(14) { ["name0"]=> string(16) "Основные" [0]=> array(3) { ["name"]=> string(19) "ID страницы" ["attribute"]=> string(2) "id" ["type"]=> string(4) "text" } [1]=> array(3) { ["name"]=> string(18) "Заголовок" ["attribute"]=> string(4) "name" ["type"]=> string(12) "textFieldRow" } [2]=> array(3) { ["name"]=> string(39) "Показывать заголовок" ["attribute"]=> string(6) "nameOn" ["type"]=> string(15) "toggleButtonRow" } [3]=> array(3) { ["name"]=> string(25) "Алиас (ссылка)" ["attribute"]=> string(7) "linkStr" ["type"]=> string(12) "textFieldRow" } [4]=> array(3) { ["name"]=> string(18) "Состояние" ["attribute"]=> string(6) "status" ["type"]=> string(15) "toggleButtonRow" } [5]=> array(4) { ["name"]=> string(18) "Категория" ["attribute"]=> string(8) "category" ["type"]=> string(22) "dropDownIerarhCategory" ["data"]=> array(1) { ["updateAtt"]=> string(10) "categoryId" } } [6]=> array(4) { ["name"]=> string(21) "ID категории" ["attribute"]=> string(10) "categoryId" ["type"]=> string(12) "textFieldRow" ["doubleAtt"]=> string(8) "category" } [7]=> array(3) { ["name"]=> string(14) "Порядок" ["attribute"]=> string(5) "level" ["type"]=> string(12) "textFieldRow" } [8]=> array(3) { ["name"]=> string(38) "Показывать в ленте RSS" ["attribute"]=> string(9) "viewInRss" ["type"]=> string(15) "toggleButtonRow" } [9]=> array(4) { ["name"]=> string(38) "Изображение к статье" ["attribute"]=> string(5) "image" ["type"]=> string(4) "file" ["htmlOptions"]=> array(3) { ["data-toggle"]=> string(7) "tooltip" ["data-placement"]=> string(5) "right" ["data-original-title"]=> string(25) "Выберите файл" } } [10]=> array(5) { ["name"]=> string(22) "Изображение" ["attribute"]=> string(5) "image" ["type"]=> string(5) "image" ["src"]=> string(35) "http://tester40.ru/upload/articles/" ["htmlOptions"]=> array(4) { ["style"]=> string(9) "width:30%" ["data-toggle"]=> string(7) "tooltip" ["data-placement"]=> string(5) "right" ["data-original-title"]=> string(71) "Нажмите, для просмотра полного размера" } } [11]=> array(4) { ["name"]=> string(42) "Путь к файлу на сервере" ["attribute"]=> string(5) "image" ["type"]=> string(4) "text" ["before"]=> string(17) "/upload/articles/" } [12]=> array(4) { ["name"]=> string(33) "Содержание статьи" ["attribute"]=> string(4) "text" ["type"]=> string(7) "tinymce" ["widgetInText"]=> int(1) } } [1]=> array(13) { ["name1"]=> string(18) "Параметры" [0]=> array(5) { ["name"]=> string(10) "Макет" ["attribute"]=> string(7) "layout1" ["type"]=> string(10) "dropDownCl" ["array"]=> array(5) { ["column1-12"]=> string(10) "column1-12" ["column2-4-8"]=> string(11) "column2-4-8" ["column2-6-6"]=> string(11) "column2-6-6" ["column2-8-4"]=> string(11) "column2-8-4" ["column2-3-9"]=> string(11) "column2-3-9" } ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(25) "Текущий макет" ["attribute"]=> string(6) "layout" ["type"]=> string(4) "text" } } } [1]=> array(3) { ["name"]=> string(39) "Отображать Категорию" ["attribute"]=> string(10) "categoryOn" ["type"]=> string(15) "toggleButtonRow" } [2]=> array(4) { ["name"]=> string(31) "Отображать метки" ["attribute"]=> string(6) "tagsOn" ["type"]=> string(15) "toggleButtonRow" ["addField"]=> array(1) { [0]=> array(4) { ["name"]=> string(10) "Метки" ["attribute"]=> string(4) "tags" ["type"]=> string(11) "textAreaRow" ["htmlOptions"]=> array(3) { ["data-toggle"]=> string(7) "tooltip" ["data-placement"]=> string(5) "right" ["data-original-title"]=> string(25) "через запятую" } } } } [3]=> array(4) { ["name"]=> string(33) "Отображать автора" ["attribute"]=> string(7) "avtorOn" ["type"]=> string(15) "toggleButtonRow" ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(10) "Автор" ["attribute"]=> string(5) "avtor" ["type"]=> string(12) "textFieldRow" } } } [4]=> array(4) { ["name"]=> string(37) "Отображать источник" ["attribute"]=> string(8) "sourceOn" ["type"]=> string(15) "toggleButtonRow" ["addField"]=> array(1) { [0]=> array(3) { ["name"]=> string(16) "Источник" ["attribute"]=> string(6) "source" ["type"]=> string(12) "textFieldRow" } } } [5]=> array(3) { ["name"]=> string(29) "Отображать дату" ["attribute"]=> string(6) "dataOn" ["type"]=> string(15) "toggleButtonRow" } [6]=> array(3) { ["name"]=> string(25) "Дата создания" ["attribute"]=> string(7) "created" ["type"]=> string(13) "datePickerRow" } [7]=> array(3) { ["name"]=> string(27) "Meta описание (SEO)" ["attribute"]=> string(8) "seoDescr" ["type"]=> string(11) "textAreaRow" } [8]=> array(3) { ["name"]=> string(38) "Meta ключевые слова (SEO)" ["attribute"]=> string(6) "seoKey" ["type"]=> string(11) "textAreaRow" } [9]=> array(3) { ["name"]=> string(62) "Отображать количество просмотров" ["attribute"]=> string(10) "numViewsOn" ["type"]=> string(15) "toggleButtonRow" } [10]=> array(3) { ["name"]=> string(41) "Количество просмотров" ["attribute"]=> string(8) "numViews" ["type"]=> string(4) "text" } [11]=> array(3) { ["name"]=> string(29) "Дата обновления" ["attribute"]=> string(7) "updated" ["type"]=> string(13) "datePickerRow" } } } } [1]=> array(4) { ["name"]=> string(16) "Редирект" ["attribute"]=> string(7) "referer" ["type"]=> string(6) "hidden" ["noVisibleHR"]=> string(0) "" } } ["ierarh"]=> int(0) ["_enabled":"CBehavior":private]=> bool(true) ["_owner":"CBehavior":private]=> *RECURSION* ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL } } }
Как вывести свойства товарной группы в каталоге товаров Ksenmart - #Web-шпаргалка

Как вывести свойства товарной группы в каталоге товаров Ksenmart

ksenmart joomla   2339  

При разработке интернет-магазина на Joomla с помощью компонента Ksenmart, иногда заказчики желают в каталоге товаров вывести все свойства товарной группы.

В самом каталоге выводится основной товар, и так как в товарной группе может быть несколько товаров, стандартный шаблон каталога Ksenmart не позволяет это сделать.

В этой заметке я расскажу как дополнить шаблон.

Сам шаблон вывода товаров находится в ваш_сайт\components\com_ksenmart\views\catalog\tmpl\default_item.php

В нашем случае нам нужно вывести свойства "подача, мощность и давление" у товарной группы насоса.

Код файла default_item.php будет иметь вид:

<?php
/**
* @copyright Copyright (C) 2013. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

$db = JFactory::getDbo();
$query = $db->getQuery(true);
/* найдем все продукты товарной группы */
$query->select('id')->from('#__ksenmart_products')->where('parent_id = ' . $this->product->id );
$db->setQuery($query);
$rows = $db->loadObjectList();

$pod=array(); $nap=array(); $mosh=array();

foreach($rows as $prop){
$id=KSMProducts::getProperties($prop->id);
foreach($id as $_id){
/* запишем все данные в массив */
if($_id->alias == "podacha") $pod[] = str_replace(" м3/ч","",$_id->text);
if($_id->alias == "moschnost") $mosh[] = str_replace(" кВт","",$_id->text);
if($_id->alias == "davlenie") $nap [] = str_replace(" м","",$_id->text);
}
}
/* удалим дубли и разделим точкой с запятой */
$pod = implode("; ",array_unique($pod));
$mosh = implode("; ",array_unique($mosh));
$nap = implode("; ",array_unique($nap));
?>
<tr class="pupmplistItem">
<td><?php if (!empty($this->product->product_code)): ?>
<?php echo $this->product->product_code; ?>
<?php endif; ?> </td>
<td><a href="<?php echo $this->product->link; ?>"><?php echo $this->product->title; ?></a></td>
<td><?php
if (!empty($this->product->manufacturer_title)){ ?>
<a href="http://<?php echo $_SERVER['HTTP_HOST'];?>/katalog/search/<?php echo $this->product->manufacturer_alias; ?>"><?php echo $this->product->manufacturer_title; ?></a>
<?php } ?></td>
<td class="txtCenter"><?php echo $pod; ?></td>
<td class="txtCenter"><?php echo $nap;
?></td>
<td>
<?php
foreach($this->product->properties as $a=>$prop){
/* вывод свойства товарной группы с типом список значений */
if($prop->property_id == 9){
$a=0;
foreach($prop->values as $val){
$a++;
echo ' <a href="http://'.$_SERVER['HTTP_HOST'].'/katalog/search/sreda='.$val->alias.'">'.$val->title.'</a>';
if($a<count($prop->values))echo ', ';
}
}
}
?>
</td>
<td class="txtCenter"><?php echo $mosh;
?></td>
<td>
<div class="grnButton">
<div class="left"></div>
<div class="right"></div>
<div class="content">
<a href="#">запросить стоимость</a>
</div>
</div>
</td>
</tr>


В итоге получится такая картина:




Поиск

Метки