g

Product Attachments

Product Attachments allow you to upload files that are linked to a specific product.

Creating Attachments

In order to create a new attachment for a product, log in to DXP and navigate to Transactions → Catalogues → Products → (Edit Product) → Attachments:

Retrieving Attachments

You can retrieve attachments for a product by using objects of the Product class, as demonstrated bellow. The retrieved attachments will be sorted in the custom order specified in DXP.

Get all attachments for a product
// Gets all attachments for a product
$attachments $product->getAllAttachments();
// Gets all attachments for a product that belong to the specified category (case-insensitive):
$attachments $product->getAttachmentsByCategory('manual');

And the following example demonstrates displaying info about the retrieved attachments:

Get Attachment attributes
<{foreach $attachments as $attachment}>
 <{$attachment->getDescription()}><br>
 <strong>File:</strong> <a href="<{$attachment->getUrl()}>" class="<{$attachment->getIcon()}>"><{$attachment->getName()}></a>
<{/foreach}>