FileAttachments (optional)

https://github.com/magesuite/file-attachments

 

The module was introduced in order to retrieve further information about the product, such as a user manual or photos. The additional files can be added to a product and are displayed on the PDP page, from where a user can download them.

 

Installation

This module is optional.

composer require "creativestyle/magesuite-file-attachments" ^1.0.0

Admin settings

Admin settings are located in Stores -> Configuration -> MageSuite -> File attachments

Settings:

Name

Value

Comment

Name

Value

Comment

Thumbnail Width

number, default: 110

 

File attachments can be added in Catalog -> File attachments

In the product edit form, in the File attachments tab, attachments can be added to products.

 

Backend

In progress

 

Frontend

If any attachment is added to a product attachments section is added to PDP page.

Attachments is a standard product details section that can be configured via XML:

<block name="product.info.attachments" as="attachments" template="MageSuite_FileAttachments::product/view/attachments.phtml" group="detailed_info"> <arguments> <argument name="title" translate="true" xsi:type="string">Attachments</argument> <argument name="sort_order" xsi:type="string">20</argument> <argument name="is_collapsible" xsi:type="boolean">true</argument> <argument name="collapsible_widget_options" xsi:type="array"> <item name="mediaQueryScope" xsi:type="string">(max-width: 767px)</item> </argument> <argument name="view_model" xsi:type="object">MageSuite\FileAttachments\ViewModel\Product\Attachment</argument> </arguments> </block>

The frontend component is called: cs-attachments. As the component is optional styles must be imported in pdp.ts entry:

import 'components/product-details/attachments';