File Downloads & Product Attachments FAQ
How to add file downloads block to CMS/Static pages/blocks¶
To add the file downloads block to CMS/Static page/block you need to add the following code to the page/block source code:
js
{{block type="mageworx_downloads/link" id=5 title="Documentation"}}
or
js
{{block type="mageworx_downloads/link" id="5,6,7" title="Files"}}
where
id
is ids of files you need to displaytitle
is title of the block on the front-end.
How to display all the files of a specific category on CMS page or in Static Block¶
To show all downloadable files of a particular category on CMS page or in a static block you need to add the following code to page source (CMS ⟶ Static Pages or CMS ⟶ Static Blocks):
js
{{block type="mageworx_downloads/category_link" id=5 title="Documentation"}}
where
-
id
is the id of a category you want to display on CMS page (useid=all
for all categories) -
title
is the title of the block where files will be shown.
How to import relations between files and products¶
To import relations between files and products you should do the following:
-
Upload necessary files to the /media/downloads_import/ folder on your server
-
Create a CSV file with relations files-products.
The structure of a CSV file is as follows:
csv
sku1;sku2,filePath1;filePath2;filePath3
sku3,filePath4
sku5;sku6,filePath5
so that the documents in
-
filePath1
,filePath2
andfilePath3
are the same for the products with thesku1
andsku2
-
filePath4
is for the product withsku3
-
filePath5
is the same for bothsku5
andsku6
. -
Go to System ⟶ Import/Export ⟶ File Relations and upload a CSV file with relations. The files will be added to the site automatically and assigned to necessary products.
You can skip the column names. If you want to upload all files to the default category, you should just use the file name, i.e text.txt
in the CSV file. However, if you need to assign files to different categories, while uploading and importing relations, you should create folders with IDs of categories as the names inside the folder /media/downloads_import/, upload files to correct folders (categories) and use the paths to files like /24/text.txt
, where 24
is the name of the folder.
How to move downloads block to any part of the page¶
To move the block with downloads to any part of the product page please edit the file /downloads/catalog-product-view.phtml (please backup the file before changing anything) and move the following code to the necessary place:
```php
isEnabled()): ?> getChildHtml('downloads.product') ?>```
Save the changes and clear the cache.
“Unable to save file” error when uploading a file.¶
This error occurs if a size file you are uploading is more than allowed file size on your server. You should increase the upload_max_filesize and post_max_size parameters in the .htaccess file of your Magento. If it doesn’t help, you should change them in the php.ini file on your server.