[Skip to main content](#vessel-content)

#   Setting up a better looking filter module

##

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

13 years 7 months ago [\#97431](#97431) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  *[Setting up a better looking filter module](/forum/2-general-talk-about-hikashop/79949-setting-up-a-better-looking-filter-module#97431 "Having an horizontal &quot;Top content area&quot; 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 &quot;AlturaElevacion&quot;, what would be the code to get it inside a cell?")* was created by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")*

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?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5OTQ5LXNldHRpbmctdXAtYS1iZXR0ZXItbG9va2luZy1maWx0ZXItbW9kdWxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 7 months ago [\#97493](#97493) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Setting up a better looking filter module](/forum/2-general-talk-about-hikashop/79949-setting-up-a-better-looking-filter-module#97493 "Having an horizontal &quot;Top content area&quot; 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 &quot;AlturaElevacion&quot;, what would be the code to get it inside a cell?")*

Hi,

The view to edit is "product / filter" in Display &lt; Views. It will change too the filters displayed on top of a product listing.
It require PHP knowledges.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5OTQ5LXNldHRpbmctdXAtYS1iZXR0ZXItbG9va2luZy1maWx0ZXItbW9kdWxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

13 years 7 months ago [\#97505](#97505) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Setting up a better looking filter module](/forum/2-general-talk-about-hikashop/79949-setting-up-a-better-looking-filter-module#97505 "Having an horizontal &quot;Top content area&quot; 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 &quot;AlturaElevacion&quot;, what would be the code to get it inside a cell?")*

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"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5OTQ5LXNldHRpbmctdXAtYS1iZXR0ZXItbG9va2luZy1maWx0ZXItbW9kdWxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

13 years 7 months ago [\#97567](#97567) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Setting up a better looking filter module](/forum/2-general-talk-about-hikashop/79949-setting-up-a-better-looking-filter-module#97567 "Having an horizontal &quot;Top content area&quot; 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 &quot;AlturaElevacion&quot;, what would be the code to get it inside a cell?")*

Hi,

The filters are not displayed with a foreach on that view file.

They are displayed like that: Code:

while($count&lt;$this-&gt;maxFilter+1){ $height=''; if(!empty($filters[$count]-&gt;filter_height)){ $height='height:'.$filters[$count]-&gt;filter_height.'px;'; }else if(!empty($this-&gt;heightConfig)){ $height='height:'.$this-&gt;heightConfig.'px;'; } if(!empty($html[$count])){ ?&gt; &lt;div class="hikashop_filter_main hikashop_filter_main_&lt;?php echo $filters[$count]-&gt;filter_namekey; ?&gt;" style="&lt;?php echo $height; ?&gt; float:left; width:&lt;?php echo $widthPercent*$filters[$count]-&gt;filter_options['column_width']?&gt;%;" &gt; &lt;?php //echo $this-&gt;filterClass-&gt;displayFilter($this-&gt;filters[$count], $this-&gt;params-&gt;get('main_div_name'), $this); echo '&lt;div class="hikashop_filter_'.$filters[$count]-&gt;filter_namekey.'"&gt;'.$html[$count].'&lt;/div&gt;'; ?&gt; &lt;/div&gt; &lt;?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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5OTQ5LXNldHRpbmctdXAtYS1iZXR0ZXItbG9va2luZy1maWx0ZXItbW9kdWxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
