Versions Compared

Key

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

...

Adds a preview image to the product.

Info
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
product.addPreviewImage(file) // adds an image at the end of the list of preview images
product.addPreviewImage(file, 0) // adds an image at the beginning of the list of preview images
...

...

Returns true or false, depending if the operation was successful.

Example

Info
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
product.addToPortal(1) // => true
...

...

Parameter name: (optional)

int product.

...

centPrice

Returns the product price in cents (integer)

Example

Code Block
languagejs
linenumberstrue
...
product.centPrice // => 1995
...

product.customPath

Returns the customPath field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.customPath // => '/a-custom-path/to-a-product'
...

...

Info
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)


Example

Code Block
languagejs
linenumberstrue
...
product.delete() // => true
...

...

Warning

This function is deprecated!

Example

Code Block
languagejs
linenumberstrue
...
product.deletePermanent()
...

...

Returns the deliveryInformation field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.deliveryInformation // => 'some delivery information'
...

...

Returns the rendered description field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.description // => 'some product description'
...

...

Returns the unprocessed content of the description field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.descriptionUnprocessed // => 'description with renderable content'
...

string product.

...

cacheKey

Returns an array of the flex attributes of the producta string that you can use in the fragment cache. This string will change whenever the product or one of its files is changed.

Example

Code Block
languagejs
linenumberstrue
... 
product.cacheKey # => "12589387317632578294"
...

product.flexAttributes()

Returns an array of the flex attributes of the product

Example

Code Block
languagejs
linenumberstrue
...
function getCategoryConfiguratorFilter(product, parameters)
{
  var result = {};
  
  var flexAttributes = product.flexAttributes;  
  
  for(var i=0;i<flexAttributes.length;i++)
  {
    var flexAttribute = flexAttributes[i];
    if (/^category\./.test(flexAttribute))
    {
      result[flexAttribute.substring(9)] = product.get(flexAttribute);
    }
  }
  
  return JSON.stringify(result);
}
...

...

Returns the format1 field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.format1 // => 'format1 content'
...

...

Returns the format2 field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.format2 // => 'format2 content'
...

...

Returns the value of key as string or null if no value is set under the key.

Example

Code Block
languagejs
linenumberstrue
...
product.get(key)
...

...

Returns a boolean value depending on whether key is present for a given product

Example

Code Block
languagejs
linenumberstrue
...
product.has(key)
...

...

Returns whether the product has a template associated

Example

Code Block
languagejs
linenumberstrue
...
product.hasTemplate // => true
...

...

Returns the id field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.id
...

...

Increments the vale of a given key by one.

Example

Code Block
languagejs
linenumberstrue
...
product.increment(key)
...

...

Returns whether product is marked as deleted.

Example

Code Block
languagejs
linenumberstrue
...
product.isDeleted // => false
...

...

Returns whether product is a direct delivery product.

Example

Code Block
languagejs
linenumberstrue
...
product.isDirectDelivery // => true
...

...

Returns whether the product is associated to the current portal.

Example

Code Block
languagejs
linenumberstrue
...
product.isInPortal // => true
...

...

Warning

This function is deprecated!

Example

Code Block
languagejs
linenumberstrue
...
product.isOfflineEditable // => false
...

...

Warning

This function is deprecated!

Example

Code Block
languagejs
linenumberstrue
...
product.isOnlineEditable // => true
...

...

Returns whether product is marked as shop delivery.

Example

Code Block
languagejs
linenumberstrue
...
product.isShopDelivery // => false
...

...

Returns the metaDescription field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.metaDescription // => 'some meta description'
...

...

Returns the metaKeywords field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.metaKeywords // => 'some keywords'
...

...

Returns the metaTitle field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.metaTitle
...

...

Returns the name field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.name // => 'the product name'
...

...

Returns the name1 field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.name1 // => 'name1 content'
...

...

Returns the name1 field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.name2 // => 'name2 content'
...

...

int product.

...

originalCentPrice

Returns the originalPrice field of the original product in cent. price in cents (integer)

Example

Code Block
languagejs
linenumberstrue
...
product.originalCentPrice // => 2495
...

float product.originalPrice

Returns the originalPrice field of the product. (Streichpreis)

Example

Code Block
languagejs
linenumberstrue
...
product.originalPrice // => 249524.95
...

int product.packageId

Returns the packageId field of a product

Example

Code Block
languagejs
linenumberstrue
...
product.packageId // => 1
...

...

Returns the merged custom URI for a product.

Example

Code Block
languagejs
linenumberstrue
...
product.path // => '/products/some-product'
...

...

Returns a list of portal ids.

Example

Code Block
languagejs
linenumberstrue
...
product.portalIds // => [1, 2]
...

...

Returns a list of JSMA portal to which the product is associated.

Example

Code Block
languagejs
linenumberstrue
...
product.portals // => [portal0, portal1]
...

...

Returns a list of JSMA file uuids.

Example

Code Block
languagejs
linenumberstrue
...
product.previewImageIds // => ['UUID_LIKE0', 'UUID_LIKE1']
...

...

Returns a list of the URIs to the associated previewImages. Optionally resized to a desired value.

Example

Code Block
languagejs
linenumberstrue
...
product.previewImagePaths(64, 64) // => ['/media/path0.jpg', '/media/path1.jpg']
...

...

Returns a list of JSMA file of the associated previewImages.

Example

Code Block
languagejs
linenumberstrue
...
product.previewImages // => [file0, file1]
...

...

float product.price

Returns the product price in cents.

Example

Code Block
languagejs
linenumberstrue
...
product.price // => 9959.95
...

string product.printApiId

Returns the printApiId field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.printApiId // => 'UUID_LIKE'
...

...

Returns the product image as a JSMA file, if available.

Example

Code Block
languagejs
linenumberstrue
...
product.productImage // => file
anotherProduct.productImage // => null
...

...

Returns the uuid of the product image.

Example

Code Block
languagejs
linenumberstrue
...
product.productImageId // => 'UUID_LIKE'
...

...

Returns a URI for the product image. Optionally the image may be resized by setting the arguments for max_width and max_height.

Example

Code Block
languagejs
linenumberstrue
...
product.productImagePath(64, 64) // => '/media/some-image-path.jpg'
...

...

Removes the key from the flexAttributes of the product

Example

Code Block
languagejs
linenumberstrue
...
product.remove(key)
...

...

Removes the product from the portal specified by id.

...

Infocode
title
languagejs
Slice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
product.removeFromPortal(1);
...

...

Removes a preview image by uuid

...

Info
Code Block
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
product.removePreviewImage('UUID_LIKE');
...

...

Warning

This function is deprecated! Use update-function instead!

Example

Code Block
languagejs
linenumberstrue
...
product.set(key, value, [options])
...

...

Warning

This function is deprecated! Use update-function instead!

Example


Info
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
product.setDescription('new description') // => true
...

Parameter value (required)

...

bool product.

...

setOriginalPrice(price)

Sets the product original price. Returns true or false depending on whether the operation was successful.

Example

Code Block
languagejs
linenumberstrue
...
product.setOriginalPrice(1995) // => Original price will be 24.95
...

Parameter int price (required)

The new original price in cents

bool product.setPrice(price)

Sets the product price. Returns true or false depending on whether the operation was successful.

Example

Code Block
languagejs
linenumberstrue
...
product.setPrice(1995) // => Price will be 19.95
...

Parameter int price (required)

The new price in cents

bool product.setProductImage(file)

Replaces or sets the product image. Returns true or false depending on whether the operation was successful.

Warning

This function is deprecated! Use update-function instead!instead!


Info
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
product.setProductImage(file) // => true
...

...

Warning

This function is deprecated! Use update-function instead!!


Info
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
product.setShortDescription('new short description') // => true
...

...

Warning

This function is deprecated! Use update-function instead!instead!


Info
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
product.setTags('some, tags'); // => true
...

...

Warning

This function is deprecated! Use update-function instead!


Info
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
product.setTemplateFile(file) // => true
...

...

Warning

This function is deprecated! Use update-function instead!

Example

Code Block
languagejs
linenumberstrue
...
product.shortDescription // => 'some short description'
...

...

Warning

This function is deprecated! Use update-function instead!

Example

Code Block
languagejs
linenumberstrue
...
product.shortDescriptionUnprocessed // => 'some unprocessed short description'
...

...

Returns the SKU field of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.sku // => 'the SKU'
...

...

Returns the list of tags of the product.

Example

Code Block
languagejs
linenumberstrue
...
product.tags // => ['some', 'tags']
...

...

Returns the parsed template representation.

Example

Code Block
languagejs
linenumberstrue
...
product.template // => { some: { object: {} } }
...

...

Returns the template as a JSMA file if available.

Example

Code Block
languagejs
linenumberstrue
...
product.templateFile // => file
anotherProduct.templateFile // => null
...

...

Returns the parsed template representation of an already customized version of the product specified by picedStore UUID.

Example

Code Block
languagejs
linenumberstrue
...
product.templateWithPiced('UUID_LIKE') // => { some: { object: {} } }
...

...

Returns the type field from the product.

Example

Code Block
languagejs
linenumberstrue
...
product.typ // => 'type content'
...

...

Warning

This function is deprecated!

Example

Code Block
languagejs
linenumberstrue
...
product.undelete() // => true
...

...

Updates the product with new attributes from the options object.

Example

Code Block
languagejs
linenumberstrue
...
product.update({ name: 'some other name' }) // => true
...

...

Returns the uuid of the product.

Example

Code Block
languagejs
linenumberstrue
...
var prodUuid = product.uuid;
...

product.vat

Returns the vat

Example

Code Block
languagejs
linenumberstrue
...
product.vat
...

...