Template Error: Product tag not allowed

Questions and answers about ShopSite Custom Templates

Template Error: Product tag not allowed

Postby kranthika » Mon Jun 11, 2012 3:22 am

Hi,

I have added a extra field to a product.

Trying to display the field value in a image.

[-- STORE.ProductField1 --] : [-- PRODUCT.Field1 --]

Store product filed name is displaying but unable to display product field name.
kranthika
 
Posts: 1
Joined: Mon Jun 11, 2012 3:17 am

Re: Template Error: Product tag not allowed

Postby Jim » Mon Jun 11, 2012 6:20 am

The STORE.xx tags are pulling information from file that contains the text that is configured on Preferences > Store text > ... screens. Since this text is stored in a text file (i.e a file with either a .dat or .aa extension in the stores data directory) and since the tag is named STORE. it can be used on any page in the store.

The PRODUCT.xx tags contain information about a specific product which is held in the product table in the database. These tags can only be used in a product type template. They can not be used directly on a page template, search template, gift cetificate template or anywhere else that is not defined in the product template. When they display on a store page it will always be in the context of some template coming from the product template it is assigned to or that is specified by the page template. This would be the product, moreinfo, subproduct, product cross sell, etc. The only exception is in the case of the shopping cart template which contains the Global Crosssell define and the SC_CART tag that dsiplays the product that are in the shopping cart.

So the only place the combined tags "[-- STORE.ProductField1 --] : [-- PRODUCT.Field1 --] " will work correctly is when it is within a section of the Product template or within the global cross-sell section of the shopping cart template. If you want that information displayed on a page template then you need to use the [-- Loop products --] [-- product --] [-- end_loop products --] to display the products on the page.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 107 guests