- Posts: 640
- Thank you received: 16
Setting up a better looking filter module
- PeterChain
-
Topic Author
- Offline
Less
More
13 years 6 months ago #97431
by PeterChain
Setting up a better looking filter module was created by PeterChain
Having an horizontal "Top content area" filter modules with about 7-10 filters to put I want to get the aligned so to avoid chaotic looking.
How should I invoke trough PHP each filter to put them inside a table cell?
for example, I have a filter named "AlturaElevacion", what would be the code to get it inside a cell?
How should I invoke trough PHP each filter to put them inside a table cell?
for example, I have a filter named "AlturaElevacion", what would be the code to get it inside a cell?
Please Log in or Create an account to join the conversation.
13 years 5 months ago #97493
by Xavier
Replied by Xavier on topic Setting up a better looking filter module
Hi,
The view to edit is "product / filter" in Display < Views. It will change too the filters displayed on top of a product listing.
It require PHP knowledges.
The view to edit is "product / filter" in Display < Views. It will change too the filters displayed on top of a product listing.
It require PHP knowledges.
Please Log in or Create an account to join the conversation.
- PeterChain
-
Topic Author
- Offline
Less
More
- Posts: 640
- Thank you received: 16
13 years 5 months ago #97505
by PeterChain
Replied by PeterChain on topic Setting up a better looking filter module
Thanks.
I'm not an advanced PHP coder but I'm used at tweaking view files.
Now the filters get rendered through a foreach loop that picks them one by one. I simply would like to know how to replace this foreach system for a custom made one where I have to name each filter one by one. This way I can put them exactly where I want.
My question is:
How is written the basic piece of code in a view that would render a filter named "AltureElevacion"
I'm not an advanced PHP coder but I'm used at tweaking view files.
Now the filters get rendered through a foreach loop that picks them one by one. I simply would like to know how to replace this foreach system for a custom made one where I have to name each filter one by one. This way I can put them exactly where I want.
My question is:
How is written the basic piece of code in a view that would render a filter named "AltureElevacion"
Please Log in or Create an account to join the conversation.
13 years 5 months ago #97567
by nicolas
Replied by nicolas on topic Setting up a better looking filter module
Hi,
The filters are not displayed with a foreach on that view file.
They are displayed like that:
So all the filters are stored in the $html array.
If you want to display a specific filter only you can do like that:
The filters are not displayed with a foreach on that view file.
They are displayed like that:
Code:
while($count<$this->maxFilter+1){
$height='';
if(!empty($filters[$count]->filter_height)){
$height='height:'.$filters[$count]->filter_height.'px;';
}else if(!empty($this->heightConfig)){
$height='height:'.$this->heightConfig.'px;';
}
if(!empty($html[$count])){
?>
<div class="hikashop_filter_main hikashop_filter_main_<?php echo $filters[$count]->filter_namekey; ?>" style="<?php echo $height; ?> float:left; width:<?php echo $widthPercent*$filters[$count]->filter_options['column_width']?>%;" >
<?php //echo $this->filterClass->displayFilter($this->filters[$count], $this->params->get('main_div_name'), $this);
echo '<div class="hikashop_filter_'.$filters[$count]->filter_namekey.'">'.$html[$count].'</div>';
?>
</div>
<?php
}
$count++;
}
So all the filters are stored in the $html array.
If you want to display a specific filter only you can do like that:
Code:
foreach($html as $h){
if(strpos($h,'AltureElevacion')) echo $h;
}
Please Log in or Create an account to join the conversation.
Time to create page: 0.152 seconds