JavaScript Expressions in ISML

To simplify coding, we recommend that you use B2C Commerce JavaScript expressions within ISML templates.


This example prints the product display name from the Pipeline Dictionary:

<isprint value="${pdict.Product.displayName}"/>

The product SKU is:


This example checks if there are any items or gift certificates in the cart (as entered by the customer):

<isif condition="${empty(pdict.CurrentForms.cart.items) && empty(pdict.CurrentForms.cart.giftcerts)}">
<!--- empty basket --->
<div id="infoBox">Your shopping cart is empty.</div>	

The Empty Operator

Empty has a particular significance when accessing an object, as follows:

Operator Purpose

Returns true if the object is empty. Empty is defined as:

  • null
  • undefined
  • a string with zero length
  • an array with no elements
  • a collection with no elements
Note: If the object is never declared, the JavaScript throws a ReferenceError so Empty(object) isn't true.
isEmpty() Returns true if the collection is empty.

If the object is empty, propagates an assertion using the specified message.


  • arg - the object to check.
  • msg - the assertion message.
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.