...
Adds a preview image to the product.
Info |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.addToPortal(1) // => true
...
|
...
Parameter name: (optional)
int product.
...
centPrice
Returns the product price in cents (integer)
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.centPrice // => 1995
... |
product.customPath
Returns the customPath field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.customPath // => '/a-custom-path/to-a-product'
...
|
...
Info |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.delete() // => true
...
|
...
Warning |
---|
This function is deprecated! |
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.deletePermanent()
...
|
...
Returns the deliveryInformation field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.deliveryInformation // => 'some delivery information'
...
|
...
Returns the rendered description field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.description // => 'some product description'
...
|
...
Returns the unprocessed content of the description field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.cacheKey # => "12589387317632578294"
... |
product.flexAttributes()
Returns an array of the flex attributes of the product
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.format1 // => 'format1 content'
...
|
...
Returns the format2 field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.format2 // => 'format2 content'
...
|
...
Returns the value of key as string or null if no value is set under the key.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.get(key)
...
|
...
Returns a boolean value depending on whether key is present for a given product
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.has(key)
...
|
...
Returns whether the product has a template associated
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.hasTemplate // => true
...
|
...
Returns the id field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.id
...
|
...
Increments the vale of a given key by one.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.increment(key)
...
|
...
Returns whether product is marked as deleted.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.isDeleted // => false
...
|
...
Returns whether product is a direct delivery product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.isDirectDelivery // => true
...
|
...
Returns whether the product is associated to the current portal.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.isInPortal // => true
...
|
...
Warning |
---|
This function is deprecated! |
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.isOfflineEditable // => false
...
|
...
Warning |
---|
This function is deprecated! |
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.isOnlineEditable // => true
...
|
...
Returns whether product is marked as shop delivery.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.isShopDelivery // => false
...
|
...
Returns the metaDescription field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.metaDescription // => 'some meta description'
...
|
...
Returns the metaKeywords field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.metaKeywords // => 'some keywords'
...
|
...
Returns the metaTitle field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.metaTitle
...
|
...
Returns the name field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.name // => 'the product name'
...
|
...
Returns the name1 field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.name1 // => 'name1 content'
...
|
...
Returns the name1 field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.name2 // => 'name2 content'
...
|
...
int product.
...
originalCentPrice
Returns the originalPrice field of the original product in cent. price in cents (integer)
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.originalCentPrice // => 2495
... |
float product.originalPrice
Returns the originalPrice field of the product. (Streichpreis)
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.originalPrice // => 249524.95
...
|
int product.packageId
Returns the packageId field of a product
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.packageId // => 1
...
|
...
Returns the merged custom URI for a product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.path // => '/products/some-product'
...
|
...
Returns a list of portal ids.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.portalIds // => [1, 2]
...
|
...
Returns a list of JSMA portal to which the product is associated.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.portals // => [portal0, portal1]
...
|
...
Returns a list of JSMA file uuids.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.previewImagePaths(64, 64) // => ['/media/path0.jpg', '/media/path1.jpg']
...
|
...
Returns a list of JSMA file of the associated previewImages.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.previewImages // => [file0, file1]
...
|
...
float product.price
Returns the product price in cents.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.price // => 9959.95
...
|
string product.printApiId
Returns the printApiId field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.printApiId // => 'UUID_LIKE'
...
|
...
Returns the product image as a JSMA file, if available.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.productImage // => file
anotherProduct.productImage // => null
...
|
...
Returns the uuid of the product image.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.productImagePath(64, 64) // => '/media/some-image-path.jpg'
...
|
...
Removes the key from the flexAttributes of the product
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.remove(key)
...
|
...
Removes the product from the portal specified by id.
...
Infocode |
---|
title |
---|
language | js |
---|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.removeFromPortal(1);
...
|
...
Removes a preview image by uuid
...
Info |
---|
Code Block |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.removePreviewImage('UUID_LIKE');
...
|
...
Warning |
---|
This function is deprecated! Use update-function instead! |
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.set(key, value, [options])
...
|
...
Warning |
---|
This function is deprecated! Use update-function instead! |
Example
Info |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.setProductImage(file) // => true
...
|
...
Warning |
---|
This function is deprecated! Use update-function instead!! |
Info |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.setShortDescription('new short description') // => true
...
|
...
Warning |
---|
This function is deprecated! Use update-function instead!instead! |
Info |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.setTags('some, tags'); // => true
...
|
...
Warning |
---|
This function is deprecated! Use update-function instead! |
Info |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.setTemplateFile(file) // => true
...
|
...
Warning |
---|
This function is deprecated! Use update-function instead! |
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.shortDescription // => 'some short description'
...
|
...
Warning |
---|
This function is deprecated! Use update-function instead! |
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.shortDescriptionUnprocessed // => 'some unprocessed short description'
...
|
...
Returns the SKU field of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.sku // => 'the SKU'
...
|
...
Returns the list of tags of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.tags // => ['some', 'tags']
...
|
...
Returns the parsed template representation.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.template // => { some: { object: {} } }
...
|
...
Returns the template as a JSMA file if available.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.templateWithPiced('UUID_LIKE') // => { some: { object: {} } }
...
|
...
Returns the type field from the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.typ // => 'type content'
...
|
...
Warning |
---|
This function is deprecated! |
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.undelete() // => true
...
|
...
Updates the product with new attributes from the options object.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.update({ name: 'some other name' }) // => true
...
|
...
Returns the uuid of the product.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var prodUuid = product.uuid;
...
|
product.vat
Returns the vat
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
product.vat
...
|
...