Developer forum

Forum » Ecommerce - Standard features » Problem with ProductCategoryFieldsFilter

Problem with ProductCategoryFieldsFilter

Aki Ruuskanen
Reply

I have a number of filters on my productlist page that works just fine. But when I put a ProductCategoryField-filter on the page then the page takes several minutes to render and the CPU hits the roof. Here is the code in the template for the filter. Any ideas?

Regards / Aki

 

 

 

    <div class="choice-block">

        <ul class="choice-list"> 

        <!--@LoopStart(Ecom:Filters.ProductFields.Rows)-->     

            <!--@If(Ecom:Filters.ProductFields.Row.TotalFormatted>0-->        

                <li>

                    <a href="#"><span><!--@Ecom:Filters.ProductFields.Row.Value-->   <input type="checkbox" id="Checkbox1" name="<!--@Filters:Current.TagName-->" value="<!--@Ecom:Filters.ProductFields.Row.Value-->" <!--@Ecom:Filters.ProductFields.Row.CheckedState--> /></span></a>

                </li>            

            <!--@EndIf-->

        <!--@LoopEnd(Ecom:Filters.ProductFields.Rows)-->

        </ul>

    </div>

 


Replies

 
Nicolai Høeg Pedersen
Reply

how many options are in this filter?

 

And is it still slow if you empty the template? (To see if it is the template or the code that is slow)

 

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Aki,

 

You may also want to take a look here: http://volpav.wordpress.com/2012/10/22/search-index-tips-use-total-and-totalformatted-tags-with-care/ Not sure if it applies to ProductFields as well, but it's worth a try.

 

Cheers.

 

Imar

 
Aki Ruuskanen
Reply

Yes, it was the TotlaFormatted tag that screwed things up. Instead I am now trying to check if there are data in the filter with the HasResults as mentions in the article. But it does not render anything. Example below:

 

 

<!--@If(Ecom:Search.Filter.Option.HasResults='true')-->
<div class="row">
<span class="name"><!--@Filters:Current.Name--></span>
<div class="choice-block">
<ul class="choice-list">
<!--@LoopStart(Ecom:Filters.ProductFields.Rows)-->

<li>
<a href="#"><span><!--@Ecom:Filters.ProductFields.Row.Value--> <input type="checkbox" id="Checkbox1" name="<!--@Filters:Current.TagName-->" value="<!--@Ecom:Filters.ProductFields.Row.Value-->" <!--@Ecom:Filters.ProductFields.Row.CheckedState--> /></span></a>
</li>

<!--@LoopEnd(Ecom:Filters.ProductFields.Rows)-->
</ul>
</div>
</div>
<!--@EndIf()-->

 

 
Nicolai Høeg Pedersen
Reply

What does the tag return if you add a dwtemplatetags tag?

 
Aki Ruuskanen
Reply

Following tags.

 

<!--@Ecom:Filters.ProductFields.FieldID-->
<!--@Ecom:Filters.ProductFields.FieldUniqueID-->
<!--@Ecom:Search.Page.ID-->
<!--@Ecom:Search.Paragraph.ID-->
<!--@Filters:Current.CssClass-->
<!--@Filters:Current.Name-->
<!--@Filters:Current.TagName-->
<!--@Filters:Current.Template-->
<!--@LoopStart(Ecom:Filters.ProductFields.Rows)--> <!--@LoopEnd(Ecom:Filters.ProductFields.Rows)-->

 

 
Aki Ruuskanen
Reply

I think I solved it with:

 

<!--@If LoopDefined(Ecom:Filters.ProductFields.Rows)-->

 

 

You must be logged in to post in the forum