Developer forum

Forum » Templates » Related products listing problem

Related products listing problem

Dmitrij Jazel
Reply

Hi Guys,

I am trying to list related products of a product in Razor

1) Product catalog module is on the page

2) Product has related products "attached" to it.

3) If I am using original HTML template, related products are being listed as they should

so:

<!--@LoopStart(ProductRelatedGroups)-->
	<!--@LoopStart(RelatedProducts)-->
		<h3><!--@Ecom:Product.Name--></h3><br/>
	<!--@LoopEnd(RelatedProducts)-->
<!--@LoopEnd(ProductRelatedGroups)-->

this Works, but only if I am using HTML template!

Problem happens when I am trying to use Razor template

This is how I am trying to get it (inslide Product.CSHTML):

@{
        foreach (LoopItem i in GetLoop("ProductRelatedGroups")){	
	        foreach (LoopItem i2 in GetLoop("RelatedProducts")){
		        <text>@i2.GetValue("Ecom:Product.Name")</text>
	        }
        }
    }

 

Any suggestions? :(

 

//Dmitri

 


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

There is a problem with nested loops and Razor...

 

Fix is coming, but not until 8.3

Votes for this answer: 1
 
Dmitrij Jazel
Reply

Hej Nicolai,

Looking forward to it :-)

Is there a release date for 8.3? :-)

 

 
Nicolai Høeg Pedersen
Reply

Try clicking the navigation item in this page called "Releases". It might contain the date....

 
Dmitrij Jazel
Reply

I sure will :-)

Thanks again!

 

//Dmitrij

 
Dmitrij Jazel
Reply

Hej Nicolai, Since we are getting closer to 8.3 release, wanted to know if there is/will be a fix for nested loops in Razor in 8.3? :-)New features and improvements included in Dynamicweb 8.3

Does not mention anything about nested loops (not sure if it supposed to do it exactly there)

 

You must be logged in to post in the forum