...
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
//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 |
---|
language | js |
---|
linenumbers | true |
---|
|
//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 |
---|
language | js |
---|
linenumbers | true |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
cartItem.remove('ibe2.savedproject'); |
Parameter key:string (required)
The key to be removed from the flexAttributes of the cartItem.
void cartItem.setAmount([qty])
...