Hi all,
I want to have the attribute filter capability above the category tree on the left hand side.
To achive this I commented out the attribute filtering on list.tpl and copied the respective code in a new tpl filterbox.tpl
I include the filterbox.tpl in category_tree.tpl
…
[{assign var=“oContentCat” value=$oView->getContentCategory() }]
[{* =======================Show Filter for categories on the left hand side ============== }]
[{include file=“inc/filterbox.tpl”}]
[{ ===================End Show Filter for categories on the left hand side ============== *}]
…
it works fine but when I select a product in category view to see more details I get
Fatal error: Call to undefined method stdClass::getTitle() in C:\xampp\htdocs\shop mp\45268ba29d67e13d3dfd7c5bcc8527c5^%%18^18C^18CB9DBE%%filterbox.tpl.php on line 44
The respective line is
"><?php echo $this->_tpl_vars[‘oFilterAttr’]->getTitle(); ?>
which doesn’t mean anythign to me.
I guess _tpl_vars[‘oFilterAttr’] is either null or not defined but how to check this or even better where to set it
Any suggestion is highly welcome
btw. I am new to oxid.
Thanks for help
P.S.
filterblock.tpl
[{* =======================Show Filter for categories on the left hand side ============== *}]
[{if $actCategory->oxcategories__oxthumb->value }]
[{assign var=“thumbUrl” value=$actCategory->getThumbUrl()}]
[{if $thumbUrl }]
<img src="[{ $thumbUrl }]" alt="[{ $actCategory->oxcategories__oxtitle->value }]"><br>
[{/if}]
[{/if}]
[{assign var=“oCategoryAttributes” value=$oView->getAttributes()}]
[{if $oCategoryAttributes }]
<strong class=“h2 search”>Filter</strong>
<form method="post" action="[{ $oViewConf->getSelfActionLink() }]" name="_filterlist" id="filterList">
<div class="catfilter">
[{ $oViewConf->getHiddenSid() }]
[{ $oViewConf->getNavFormParams() }]
<input type="hidden" name="cl" value="[{ $oViewConf->getActiveClassName() }]">
<input type="hidden" name="tpl" value="[{$oViewConf->getActTplName()}]">
<input type="hidden" name="fnc" value="executefilter">
<table cellpadding="3" cellspacing="0">
[{foreach from=$oCategoryAttributes item=oFilterAttr key=sAttrID name=testAttr}]
<tr>
<td style="padding-left:10px">
<b>
<label id="test_attrfilterTitle_[{$sAttrID}]_[{$smarty.foreach.testAttr.iteration}]">[{ $oFilterAttr->getTitle() }]:</label>
</b>
<br>
<select name="attrfilter[[{ $sAttrID }]]" width="160" STYLE="width: 160px" size="0" onchange="oxid.form.send('filterList');">
<option value="" selected>[{ oxmultilang ident="LIST_PLEASECHOOSE" }]</option>
[{foreach from=$oFilterAttr->getValues() item=sValue}]
<option value="[{ $sValue }]" [{ if $oFilterAttr->getActiveValue() == $sValue }]selected[{/if}]>[{ $sValue }]</option>
[{/foreach}]
</select>
</td>
</tr>
[{/foreach}]
</table>
<noscript>
<input type="submit" value="[{ oxmultilang ident="LIST_APPLYFILTER" }]">
</noscript>
</div>
</form>
[{/if}]
[{* ===================End Show Filter for categories on the left hand side ============== *}]