Developer forum

Forum » Rapido » Product Checkboxlist field returns empty loop

Product Checkboxlist field returns empty loop

Lara Arsénio
Reply

I created a product field named "Features" which is set as Checkboxlist, and it returns a empty loop, when declared alone.

Calling just the loop, count returns 0 

@GetLoop("Features.Options").Count


Calling the loop + the same field as string, count returns results and all the data-set 
@GetLoop("Features.Options").Count
@GetString("Ecom:Product:Field.Features")

https://www.screencast.com/t/RIRRP9Qf


Replies

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply

Hi Lara,

Hmm... you are right.

The ecom renderer tries to optimize process and it skips fields rendering if no one field property is used (it checks  that template contains "Ecom:Product:Field." string - so 'options' loop is not catched)

Best regards,
Vladimir 

 
Lara Arsénio
Reply

Hi Vladimir, thank you for confirming.

So I guess the best way to avoid an empty loop is to declare a var equal to some field property, to ensure the field loop is loaded.

 

 

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply
This post has been marked as an answer

Hi Lara,

Yes, I think it is the best workaround with this issue.

Best regards,
Vladimir 

 

Votes for this answer: 1

 

You must be logged in to post in the forum