Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
linenumberstrue
//add cart item attributes
cartItem.flexAttributes.forEach ( function ( key ) {
  result.attributes[key] = cartItem.get(key);
});

string cartItem.get(key)

Returns the flex attributes associated with a JSMA cartItemvalue of key as string or null if no value is set under the key.

Example

Code Block
languagejs
linenumberstrue
//add cart item attributes
cartItem.flexAttributes.forEach ( function ( key ) {
  result.attributes[key] = cartItem.get(key);
});

Parameter key:string (required)

The key to be looked up in the flexAttributes of the cartItem.

boolean cartItem.has(key)

Checks whether a JSMA cartItem has a flex attribute for given parameter keyReturns a boolean value depending on whether key is present for a given cartItem

Example

Code Block
languagejs
linenumberstrue
if (cartItem.has('product.type')) {
  result.type = cartItem.get('product.type');
}

Parameter key:string (required)

The key to be checked in the flexAttributes of the cartItem.

file[] cartItem.previewImages

...

Code Block
languagejs
linenumberstrue
if (request.parameter('savedproject')) {
  cartItem.set('ibe2.savedproject', request.parameter('savedproject'));
}

Parameter key (required)

Parameter value (required)

cartItem.remove(key)

Removes a flex attribute for given parameter key associated with the current itemthe key from the flexAttributes of the cartItem

Example

Code Block
languagejs
linenumberstrue
cartItem.remove('ibe2.savedproject');

Parameter key:string (required)

The key to be removed from the flexAttributes of the cartItem.

void cartItem.setAmount([qty])

...