The digital_assets component (Vvveb\Component\Digital_assets) lists downloadable digital assets (files attached to products/orders) and builds a secure download URL for each one. Caching is disabled ($cacheExpire = 0) because download links contain per-order keys.
Activate the component by adding:
data-v-component-digital_assets
Component Options
Add options as HTML attributes using the data-v-* syntax.
| Option | Attribute | Description | Default |
|---|---|---|---|
| start | data-v-start |
Starting offset for pagination | 0 |
| limit | data-v-limit |
Number of assets to display, overridable from URL | 4 |
| user_id | data-v-user_id |
Filter by customer (user) ID | null |
| product_id | data-v-product_id |
Filter by product ID | null |
| order_status_id | data-v-order_status_id |
Filter by order status ID | null |
| digital_asset | data-v-digital_asset |
Sorting rules, overridable from URL | price asc |
Component Properties
Each asset is wrapped in an element marked with data-v-digital_asset. Available fields include the asset record fields plus:
| Property | Attribute | Description |
|---|---|---|
| url | data-v-digital_asset-url |
Secure download URL (user/downloads/download with asset id, public key and order key) |
| digital_asset_id | data-v-digital_asset-digital_asset_id |
Asset ID |
| customer_order_id | data-v-digital_asset-customer_order_id |
Customer-facing order ID the asset belongs to |
HTML Example
<div data-v-component-digital_assets data-v-limit="10">
<div data-v-digital_asset>
<span data-v-digital_asset-name>File name</span>
<a href="#" data-v-digital_asset-url>Download</a>
</div>
</div>