Product Name, SKU, and Description
The product name, SKU, and description are all text fields that can contain both text and HTML tags. You can treat them all basically the same in your product template, and you only need to change the surrounding HTML and/or CSS tags.
- You can use the Remove_HTML parameter on any of these tags to strip any HTML tags out of the field.
- The [-- PRODUCT.DisplayName --] and [-- PRODUCT.DisplaySKU --] tags test whether the merchant wants those fields displayed. The product description is generally always displayed, but you can use an [-- IF PRODUCT.ProductDescription --] tag to see if the field has any content before displaying it.
- If you are using a CSS style sheet, you can use the [-- PRODUCT.NameStyle --] and [-- PRODUCT.NameSize --] tags to identify the font formatting selected by the merchant so your template can apply the correct style. Same for the SKU and Description fields.
- If you are using HTML font formatting instead of CSS, you can use the [-- PRODUCT.NameStyle Begin --] and [-- PRODUCT.NameStyle End --] tags to get the merchant-selected formatting into your template. Same for NameSize, and for the SKU and Description fields.
Product Name, SKU and Description Example Product Template
This examples uses HTML formatting for the name, SKU and description. This product template ignores all other product fields -- it is only meant as an example of those three fields. Not all of the sample products have information in all three fields. The product information is presented within a fairly simple page template.
Product Name
23496-ss
Here is my product description, details about my product.
[-- DEFINE PRODUCT --]
[-- IF PRODUCT.DisplayName --]
[-- PRODUCT.NameSize Begin --][-- PRODUCT.NameStyle Begin --]
[-- PRODUCT.Name --]
[-- PRODUCT.NameStyle End --][-- PRODUCT.NameSize End --]
[-- END_IF --]
[-- IF PRODUCT.DisplaySKU --]
<br>
[-- PRODUCT.SKUSize Begin --][-- PRODUCT.SKUStyle Begin --]
[-- PRODUCT.SKU --]
[-- PRODUCT.SKUStyle End --][-- PRODUCT.SKUSize End --]
[-- END_IF --]
[-- IF PRODUCT.ProductDescription --]
<br>
[-- PRODUCT.DescriptionSize Begin --][-- PRODUCT.DescriptionStyle Begin --]
[-- PRODUCT.ProductDescription --]
[-- PRODUCT.DescriptionStyle End --][-- PRODUCT.DescriptionSize End --]
[-- END_IF --]
[-- END_DEFINE PRODUCT --]
Product Name As A Link
If you want to make it so that the product name is a hyperlink to the product more information page if the product more information page is turned on. You can set up the product name section in your product template similar to the following.
[-- IF PRODUCT.DisplayName --]
[-- PRODUCT.NameSize Begin --][-- PRODUCT.NameStyle Begin --]
[-- IF PRODUCT.DisplayMoreInformationPage --]
<a href="[-- PRODUCT.MoreInfoURL --]">[-- PRODUCT.Name --]</a>
[-- ELSE --]
[-- PRODUCT.Name --]
[-- END_IF --]
[-- PRODUCT.NameStyle End --][-- PRODUCT.NameSize End --]
[-- END_IF --]
Include Files
Rather than create your own template code for these fields, you can use the same code that is used by the built-in ShopSite templates. The custom template code to display each of these fields is contained in separate "include" files, and you can use them by putting these lines in your template in the appropriate places:
[-- DEFINE PRODUCT --]
[-- INCLUDE Product-Name PROCESS --]
[-- INCLUDE Product-Sku PROCESS --]
[-- INCLUDE Product-Description PROCESS --]
[-- END_DEFINE PRODUCT --]
Return To: Product Template Home Page