Template Functions

You can add the following functions to your templates to enhance the data that is displayed from the database.

 

[formatcurrency cprice]

Show the price as currency

[formatnumber cprice]

Format it as a number with decimal points

[Dualprice cprice]

Display dual price for this price(no longer available in VPCART 8.00)

[formatcustomerprice cprice]

Display customer based price

[formatsaving cprice]

Displays savings between current price and retail price

[urlendcode cname]

When using names on hyperlinks, they need to be in a special format called URL encoded

[dualcustomerprice cprice]

Dual customer-based pricing(no longer available in VPCART 8.00)

[dualsaving cprice]

Displays saving using dual price(no longer available in VPCART 8.00)

[formatimage cimageurl]

If the field is not empty, it is formatted as an image

[formatdate cdate]

Formats the date in the default format specified in your configuration (xdateformat)

[formattime cdate]

Formats the date in the default Microsoft format.

[formatcurrencyconversion cprice]

If using currency switching, adding this tag to your cprice will convert the price to the currently selected conversion rate.

[translate cname]

Translates the field based on translations you have added in the administration (fields that can be translated are those that appear in the Add Translation form in the administration.)

[cleansehtml cname]

If you want to use product fields in the meta tags in the header, you can add this tag to remove any HTML you have added into the field before adding it to the page.

[getlang langcommonsearch]

If you want to add a term from the languages table to your template, you can use the getlang call to do so.

[formatcrosscheckbox catalogid]

If you want to add a checkbox to allow customers to purchase multiple products from one page in the cross selling / also bought feature.

[formattaxinclusive cprice]

Display the product price, which is inclusive of Tax Amount.

[formattaxexclusive cprice]

Display the product price, which is exclusive of Tax Amount.


The following functions add extra features to your templates. Some of these items can only be used in specific locations – most are for use on the Product Extended Description page.

 

[ADD_INVENTORYPRODUCTS]

Displays associated products

[ADD_RATINGSUMMARY]

Display star rating for products

[ADD_OITEMS]

For use in order email templates – this will add a list of items ordered

[ADD_RANDOMPRODUCTS]

This will display a selection of random products.

[ADD_PAGEHEADER]

Displays the shoppage_header.htm file

[ADD_PAGETRAILER]

Displays the shoppage_trailer.htm file

[SPECIAL_ORDERBUTTON]

Generates an order button, quantity and special features for a product.

[SPECIAL_CHECKBOX]

Generates a check box, quantity and special features for a product.

[ADD_PRODUCTFEATURES]

Adds a display of the features that can be selected for this product.

[ADD_QUANTITY]

Adds a quantity box so the user can choose how many of the items they wish to order.

[ADD_ORDERBUTTON]

Adds a button so the customer can order the product

[ADD_CHECKBOX]

Adds a checkbox so the user can select the product for purchase (if xproductselect is set to Yes – meaning the customer can select multiple items to add to the cart at once).

[ADD_CROSSSELLING]

Adds a list of items listed in the cross-selling field of the product field.

[ADD_REVIEWLINKS]

If you have Xallowratingproducts set to Yes, VPCART will display links to read and write reviews.

[ADD_COMPARELINKS]

If you have xcompareproducts set to Yes, this will generate a link to add the product to your comparison list.

[ADD_ALSOBOUGHT]

If you have xalsobought set to Yes, VPCART will display a list of products that customers have bought that also bought this product.

[FORMATBREADCRUMB]

Displays a breadcrumb trail of Home > Category Name > Product Name.

[DISPLAYNEWPRODUCTS]

This will display the new products that is added in period of days set in admin config.

[ADDNUMBERSUBCATS]

 

Show the number of sub-categories next to category listing

[ADD_SUBMITOTHERITEMSBUTTON]

Show quantity and order button on product page

[ADD_YOUTUBE]

Displays Youtube movie in a product.

[ADD_MOVIE]

 

Displays your own uploaded movie in a product.

[ADD_CATPRODUCTS]

Category display summary on product page - show products in same category.

[SHOWNEWSHEADLINES]

Displays news headlines.

[ADD_NEWSREVIEWLINKS]

Displays review links for news.

[SHOWBLOGSHEADLINES]

Displays blogs headlines.

[ADD_BLOGSREVIEWLINKS]

Displays review links for blogs.