by Jim » Wed Jun 27, 2007 8:14 pm
The code looks basically correct. Although it probably would work I wouldn't use the PRODUCT.Field10 as the name of the VAR like [-- VAR.PRODUCT.Field10 "main" --] Since PRODUCT.Field10 is actually a field in the product database. It could be confusing for someone who is reading the template to understand what is going on. It might be less confusing to use something like [-- VAR.ProdType "main" --]
The way you have the code written all products would be dealt with in the same way in each loop subproduct section. Which may be what you want. However, what I was suggesting for the extra product fields is that you could use them to determine what to do with _each_ subproduct. You could set the extra product field 10 to be "main" on some products and "extra" on others. Then in your define subproducts section you would have a statement comparing product.field10 to the VAR that you set to determine where the products display.
[-- IF VAR.ProdType product.field10 --] So you are comparing the VAR to a field in the product record and not just to what you had previously set the VAR to be.