Magento 2 File Downloads and Product Attachments Manual

File Downloads and Product Attachments Cover

Introduction

File Downloads and Product Attachments allows you to attach downloadable files (price lists, user guides, warranty agreement, video tutorials, etc.).

You can share the attachments on Product Pages, in Static Blocks or literally on any CMS page. The extension provides the possibility to attach files in all popular file formats, such as: jpg, jpeg, gif, png, bmp, txt, csv, htm, html, xml, css, doc, docx, xls, rtf, ppt, pdf, swf, flv, avi, wmv, mov, wav, mp3, zip and many others.

The access to the files can be restricted for different customer groups. The access to the files can be restricted for different customer groups. By hiding attachments behind the You have to login or register to download this file message you can motivate customers to sign up/log in.

Requirements and Installation

File Downloads and Product Attachments extension supports both Community and Enterprise edition of Magento starting from version 2.1. The current version of Magento installed on your website can be found in the lower right corner of any backend page.

Magento 2 Version

File Downloads and Product Attachments has 2 separate ways of installation: via Composer or by copying the code.

Installation Via Composer

  1. Create a folder anywhere on your server (preferably not in the Magento installation directory). Put the zip archive into this folder.

  2. Use any SSH client to connect to your server. Navigate to the root Magento folder. Bear in mind that the user should write permissions to this folder and its subfolders.

  3. Add the folder with the extension's archive as a repository. For this, run the Composer command:

    composer config repositories.mageworx artifact {/ABSOLUTE/PATH/TO/FOLDER}
    

    like:

    composer config repositories.mageworx artifact /mageworx/extensions/zip
    

    This command will add these lines to your composer.json file:

    "mageworx": {
        "type": "artifact",
        "url": "/mageworx/extensions/zip"
    }
    
  4. Perform the command:

    composer require mageworx/module-downloads
    
  5. Clear the compiled code and the cache:

    php bin/magento setup:upgrade
    
  6. To update the extension via composer perform the command:

    composer update mageworx/module-downloads
    

Installation by copying the code

  1. Download the extension's package from your customer account, unzip it.

  2. Use any SSH client to connect to your server. Bear in mind that the user should write permissions to this folder and its subfolders.

  3. Upload all the files and folders from the extension's package to the root Magento folder.

  4. Via SSH, navigate to the root Magento folder and perform the command:

    php bin/magento module:enable MageWorx_Downloads
    
  5. Clear the compiled code and cache:

    php bin/magento setup:upgrade
    php bin/magento cache:flush
    php bin/magento setup:static-content:deploy
    

Extension Configuration

Backend Configuration

File Downloads Configuration

The main extension’s settings can be found under STORES ⟶ Configuration ⟶ MAGEWORX ⟶ File Downloads & Product Attachments

File Downloads Configuration

Display File Size shows/hides the file size that comes next to the downloadable file.

File Size Precision displays the file size in one of 3 values: Kilobytes, Megabytes or Auto. We generally recommend users to set it to Auto.

Group By Section groups files by sections and displays the section name on the front-end.

Sort Order arranges files in one of the following sequences: Alphabetical, Upload Date, Size, Number of Downloads.

Hide Files - if set to Yes, then the user won't see the attachments that are set up to be shown for some other customer group. if this setting is set to No, then customers will see the files as a plain text but won’t be able to download them unless they are able to change their customer group.

'How to download' message is a dependable option and is shown in case the Hide Files setting is set to No. This message provides some hints on how to change the customer group. The most obvious example is restricting the non-registered users from downloading the attachments. Therefore, this message can persuade the user to Log in or Register. The variables can be used here like %login% or %register%.

Display the # of Downloads shows visitors how many times the file was downloaded.

Here, the Display File Size is enabled, Hide Files is set to No and the second attacment is prohibited to download for the non-registered users. The 'How to download' message is shown for this attachment. The Display the # of Downloads is set to Yes



File Downloads Configuration

Product Downloads Tab Title provides the default tab title shown on the product page.

Product Downloads Block Title specifies the default tab title shown on the product page.

Here, the Product Downloads Tab Title is File Downloads Tab and the Product Downloads Block Title is File Downloads Block



Maximum Allowed File Size allows to limit the size of the uploaded files.

File Downloads Title is the default title that is shown on the CMS Pages if it is not specified as explained here.

Managing File Downloads Sections

To check or modify file downloads sections, go to STORES ⟶ MageWorx Downloads ⟶ Manage Section

File Downloads Sections

Please note that during the initial setup this grid will be empty.

Under these settings, the store owner can manage all the sections:

  • add new ones;

  • edit the existing sections;

  • bulk enable/disable them;

  • select and delete the ones that are not needed.

The columns can be sorted alphabetically by clicking the column title.

To create a new section, click the Add New Section button.

File Downloads Sections Configuration

Here you can specify a Section Name, Short Description (optional and not visible on the frontend) and its Status (enabled by default).

Managing File Downloads Attachments

To check or modify file downloads sections, go to STORES ⟶ MageWorx Downloads ⟶ Manage Attachments

File Downloads Sections Configuration

Please note that during the initial setup this grid will be empty.

Under these settings, you can add a new product attachment, edit the existing ones or delete the files you no longer need.

This grid supports Mass Edit. To manage the bulk configuration, the store owner should select the checkboxes of the products and click the Edit button in the Select Items dropdown.

File Downloads Sections Mass Edit

To add a new section, click the Add New Attachment button.

File Downloads New Attachments

First of all, the store owner should select the desired Section for the attachment, specify the Name and the Description (will be visible on the frontend).

The Mageworx License is the attachment's name and the Default Magento License (Description) is the description of this document.

Downloads Limit determines the max file size for the file downloads. If the limit is exceeded, customers won’t be able to download this file.

Assign By spesifies the way how to assign the products to this attachment. Depending on the selection, the second tab of the Attachment page will differ. Click it to configure the products.

File Downloads New Attachments

The Product Grid option is the default one. Here, one can see the default products grid with the possibility to use the standard Magento filters functionality to easily find the necessary products.

File Downloads New Attachments

You can also assign templates to products by entering their Product IDs or Product SKUs. Each individual ID/SKU should be comma-separated.

Note: no spaces allowed between multiple values.

File / URL Switcher provides the possibility either to upload the files/files to the server from the computer or from any location on the web via URL. If the File is selected, you can assign as many files as you wish at once. The maximum allowed size of one file is 10 Mb. If the URL is selected, then the file will be opened in a new browser tab.

Customers Groups allows choosing customer groups that can download files. Other customers won’t see the attachments.

Store View manages the store views where the attachments should be visible.

The Is Active setting provides the possibility to temporary hide this attachment.

Add File Downloads for the Specific Product

Go to PRODUCTS ⟶ Inventory ⟶ Catalog, click on the desired product and select the Attachments tab.

File Downloads Product Attachments

Here, the store owner can add or disable as many attachments assigned to the product as needed.

Product Attachements on CMS page

Go to PRODUCTS ⟶ Inventory ⟶ Catalog and select the desired page.

File Downloads on CMS page

Add the following code to the body of the page:

{{block class="MageWorx\Downloads\Block\Links" id="2,1" title="My files"}}

where

  • id – ID numbers of the files you need to display. They can be found out in the attachments grid. Use all instead of numbers for all the products.

  • title – a title of a block with the files on a CMS page.

    File Downloads on CMS page

    The way how this block will be seen on the frontend.

It is also possible to add all the attachments assigned to some section by adding another code:

{{block class="MageWorx\Downloads\Block\Section\Links" id=“2,1" title=“My files”}}
where

  • id - ID numbers of the section you need to display. They can be found in the sections grid. Use all instead of numbers for all the products.

  • title – a title of a block with the files on a CMS page.

Got Questions?

MageWorx offers FREE lifetime support and updates for any extension developed for Magento. Need help with the extensions? Feel free submit a ticket from http://www.mageworx.com/support/ 



MageWorx offers outstanding services developing custom-tailored solutions for Magento platform to attain your eCommerce objectives. Our professional impassioned team provides profound and custom oriented development of your project in a short timeframe.