by ShopSite Lauren » Mon Mar 07, 2011 3:00 pm
The only way I know how to do this is to loop the products on the page 3 times. This method isn't great for search engines (but it isn't horrible either) because it creates a lot of additional lines of code (mainly empty lines) and will take slightly longer to publish your website, however this method gets the job done. What you would do is loop the products in the template 3 times, each time calling a different product template.
[-- LOOP PRODUCTS --]
[-- PRODUCT Fiction --]
[-- END_LOOP PRODUCTS --]
[-- LOOP PRODUCTS --]
[-- PRODUCT Non-Fiction --]
[-- END_LOOP PRODUCTS --]
[-- LOOP PRODUCTS --]
[-- PRODUCT Self-Help --]
[-- END_LOOP PRODUCTS --]
Next, you would create three different product templates and name them exactly the same names as you have listed in the [-- PRODUCT --] tags (no spaces). So in my example above, the three product templates you would be creating would be named "Fiction" "Non-Fiction" and "Self-Help."
In all three templates you would setup your DEFINES for the DEFINE/END_DEFINE PRODUCT, DEFINE/END_DEFINE SUBPRODUCT, DEFINE/END_DEFINE CROSS_SELL_PRODUCT and DEFINE/END_DEFINE MORE_INFO_PAGE.
Last, within the DEFINE/END_DEFINE PRODUCT section, you would add an IF/END_IF statement around the whole thing. In the "Fiction" template, the IF/END_IF statement would look like this:
[-- IF PRODUCT.Field1 "Fiction" --]
here is the code for the product define
[-- END_IF --]
in the "Non-Fiction" template, the IF/END_IF statement around the contents of the product define would be:
[-- IF PRODUCT.Field1 "Non-Fiction" --]
here is the code for the product define
[-- END_IF --]
in the "Self-Help" template, the IF/END_IF statement around the contents of the product define would be:
[-- IF PRODUCT.Field1 "Self-Help" --]
here is the code for the product define
[-- END_IF --].
So an example of one of the product templates would be:
-------------------------------------------------------------------------------
[-- DEFINE SUBPRODUCT --]
code for the subproduct
[-- END_DEFINE SUBPRODUCT --]
[-- DEFINE PRODUCT --]
[-- IF PRODUCT.Field1 "Fiction" --]
code for the product
[-- END_IF --]
[-- END_DEFINE PRODUCT --]
[-- DEFINE MORE_INFO_PAGE --]
code for the more information page
[-- END_IF --]
- ShopSite Lauren
Contact me for help with any of your
custom ShopSite template questions.