Getting Started

Welcome to the Product Attachments user manual.

You can find all the information you need in order to set up attachments on any page of your site here.

Go ahead, dive in!

  • Please go to My Downloadable Products section of our store and find your Product Attachment module.
  • Learn how to install the extension here, and follow our Quick Start guidelines in order to add your own attachments in no time.
  • If you are interested in the module's more advanced features, check the manual's Configuration section.

How to install the extension

Installation via composer (preferably)

We recommend this installation method because the composer automatically checks and installs necessary dependencies.

  1. Back up your store's database and web directory.
  2. Log in to the SSH console of your server and navigate to the root directory of the Magento 2 store.
  3. Copy installation instructions from the page My Downloadable Products to SSH console and press ENTER.

  4. Run the command php -f bin/magento module:enable Mirasvit_Core Mirasvit_Attachment to enable the extension.
  5. Run the command php -f bin/magento setup:upgrade to install the extension.
  6. Run the command php -f bin/magento cache:clean to clean the cache.
  7. Deploy static view files

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

Installation via direct file upload

You can also install the extension via direct files uploading.

  1. Go to My Downloadable Products / View & Download.

  2. Unpack .zip package and copy contents to magento root directory
  3. Log in to the SSH console of your server and navigate to the magento root directory.
  4. Run the command composer require icomefromthenet/reverse-regex:0.0.6.* for install required libraries.
  5. Run the command php -f bin/magento module:enable Mirasvit_Core Mirasvit_Attachment to enable the extension.
  6. Run the command php -f bin/magento setup:upgrade to install the extension.
  7. Run the command php -f bin/magento cache:clean to clean the cache.
  8. Deploy static view files

    `rm -rf pub/static/; rm -rf var/view_preprocessed/;

Install the extension for Hyva

  1. Run the command

        composer require hyva-themes/magento2-mirasvit-attachment
  2. Enable installed Hyva modules:

        bin/magento module:enable Hyva_MirasvitAttachment
  3. Update Magento database schema and data with the command:

        bin/magento setup:upgrade
  4. Compile the code of the installed extension:

        bin/magento setup:di:compile
  5. Run the command below to clean the cache:
        bin/magento cache:flush

Quick Start

Setting up a New Attachment

You can set up a new attachment in the module's settings:

  1. Go to your Magento admin panel. Click the Catalog tab in the top left.
  2. Click Manage Attachments in the pop-up.
  3. Click Add New in the top right.
  4. Choose whether you want the attachment to be active immediately in the Is Active field.
  5. Decide whether you want the attachment to be a file or a link in the Type field.
  6. Upload the file or paste the URL.
  7. Select its public name in the Label field.

    Note

    If you upload a file, the filename (without the extension) will be used as the default label.
  8. You can choose global sort order for attachment in the Sort Order field.

    Note

    • If several attacments have the same Sort Order value, they will be sorted by attachment_id.
    • You can drag and drop attachments in the attachments tab on the product or category edit page.
  9. (Optional) Select the attachment's icon. If you would like to use different icons, please follow the guidelines here.

    Note

    • If you do not select an icon, the default icon associated with the file type will be used.
    • If there is no icon associated with the file type, a generic file icon will be used.
    • If you add a URL, the URL icon will be used.
  10. Choose the customer groups that will be able to see the attachment in the Customer Group Ids field.
  11. Select which store views will have the attachment in the Store View field.
  12. Click Save in the top right.

You can also set up new attachment while editing a product, category or a CMS page:

  1. Start editing the relevant page.
  2. Scroll down to the bottom.
  3. Expand the Attachments section
  4. Click Add New Attachment
  5. Go to Step 4 of the guide above.

Adding an Attachment to the Page

Useful Info

You can add more than one attachment to a single page.

You can assign an attachment to several pages from the attachment's settings:

  1. Create a new attachment by following the guidelines above or navigate to an existing attachment and click Edit in the rightmost part of the grid.
  2. Expand the Products section, click Add Products and select the product pages where you would like to add the attachment.

    Note

    If you would like to further customize how attachments are displayed on the product page, follow the guidelines below.

Product Page Configuration

You can further customize the way your attachments appear on the product page.

Customizing the Product Page Attachment

  1. Click the Catalog tab in the top left of your admin panel.
  2. Click Configuration in the pop-up.
  3. Choose whether you want the attachment tab to be displayed on the product page in the Display Product Tab field.
    Note: Selecting No will remove the attachment from the page.
  4. Change the attachment tab's name in the Tab Title field. The default name is Attachments.
  5. Choose the attachment tab's order in the Tab Position field. The default order is 100, i.e. it appears last.
  6. Click Save Config in the top right.
  7. Clear Magento cache.

  1. Expand the Categories section, click Add Categories and choose the category pages where you would like to add the attachment.
  2. Expand the Cms Pages section, click Add Pages and choose the CMS pages where you would like to add the attachment.
  3. Click Save in the top right.
  4. Clear Magento cache.

Alternatively, you can assign several attachments to a page while changing product, category or CMS page settings:

  1. Start editing the relevant page.
  2. Scroll down to the bottom.
  3. Expand the Attachments section.
  4. Click Assign Attachments.
  5. Check all attachments that apply.
  6. Click Save in the top right.
  7. Clear Magento cache.

Setting up Icons

The Product Attachments module includes icons for most commonly used file types. You can also add your own icons or change existing ones.

Creating a New Icon

  1. Click the Catalog tab in the top left of your admin panel.
  2. Click Icons in the pop-up.
  3. Click Add New in the top right or navigate to an existing icon and click Edit in the rightmost part of the grid.
  4. Enable or disable the icon by changing the Is Active toggle.
  5. Add the icon's name to the Label field.
  6. Upload the icon file in the Icon field. JPEG, GIF, and PNG images are currently supported.
  7. (Optional) Select which file type you would like to associate with the icon in the Types field. If you add a corresponding attachment without choosing an icon manually, this icon will be used automatically.

    Note

    Choosing a url file type will make it the default icon for URLs.
    If you do not specify any file type, it will become a generic icon for all file types without their own icons.
    If you add several icons associated with the same file type, the icon that is highest in the grid will be used.
  8. Click Save in the top right.

Customizing the Product Page

You can further customize the way your attachments appear on the product page.

Customizing the Product Page Attachment

  1. Click the Catalog tab in the top left of your admin panel.
  2. Click Configuration in the pop-up.
  3. Determine whether you want the attachment tab to be displayed on the product page in the Display Product Tab field.

    Note

    Selecting No will remove the attachment from the page.
  4. Change the attachment tab's name in the Tab Title field. The default name is Attachments.
  5. Choose the attachment tab's order in the Tab Position field. The default order is 100, i.e. it appears last.
  6. Click Save Config in the top right.
  7. Clear Magento cache.

Checking the Attachment's Performance

You can check how many times the attachment has been clicked on throughout the day (12 AM to the current time), during either the last 30 days or for all time.

Accessing the Performance Section

  1. Click the Catalog tab in the top left of your admin panel.
  2. Click Manage Attachments in the pop-up.
  3. Review the attachment's performance in the grid's Downloads column.

Creating an Attachment Widget

You can make a widget with several attachments. It will help you to streamline the content update.

Setting up a Widget

Note

Make sure you have already set up all the necessary attachments.
  1. Click the Content tab in the top left of your admin panel.
  2. Click Widgets in the pop-up.
  3. Click Add Widgets in the top right.
  4. Select Attachments in the Type field.
  5. Select the theme you would like to use in Design Theme field.
  6. Click Continue.
  7. Set up the widget's location in the Storefront Properties tab.
  8. Click the Widget Options tab in the top left.
  9. Enter the widget's name in the Title field.
  10. Click Select Attachments near the Attachment Ids field.
  11. Click on the attachments you would like to add in the popup.
  12. Close the popup.
  13. Click Save in the top right.

How to upgrade the extension

To upgrade the extension, follow these steps:

  1. Back up your store's database and web directory.
  2. Log in to the SSH console of your server and navigate to the root directory of the Magento 2 store.
  3. Log in to the SSH console of your server and navigate to the root directory of the Magento 2 store.
    If the extension was installed via:
    • Composer: run command composer require mirasvit/module-attachment:* --update-with-dependencies to update current extension with all dependencies.

      Note

      In some cases, the command above is not applicable, or it's not possible to update just the current module, and you will need to upgrade all Mirasvit modules in a bundle. In this case, the command above will have no effect.

      Instead, run the composer update mirasvit/* command. It will update all Mirasvit modules installed in your store.

    • Direct file upload: download new extension package from our store and copy contents to root Magento directory
  4. Run the command php -f bin/magento module:enable Mirasvit_Core Mirasvit_Attachment to re-enable the extension.
  5. Run the command php -f bin/magento setup:upgrade to install updates.
  6. Run the command php -f bin/magento cache:clean to clean the cache.
  7. Deploy static view files

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

Disabling the Extension

Temporarily Disable

To temporarily disable the extension, please take the following steps:

  1. Log in to the SSH console of your server and navigate to the root directory of the Magento 2 store.
  2. Run the command php -f bin/magento module:disable Mirasvit_Attachment to disable the extension.
  3. Log in to the Magento backend and refresh the store cache (if enabled).

Extension Removing

To uninstall the extension, please take the following steps:

  1. Log in to the SSH console of your server and navigate to the root directory of the Magento 2 store.
  2. Run the command composer remove mirasvit/module-attachment to remove the extension.
  3. Log in to the Magento backend and refresh the store cache (if enabled).

Change Log

1.1.12

(2024-07-12)

Fixed

  • Issue with preview of uploaded file in attachment form

1.1.11

(2024-07-09)

Fixed

  • Issue with S3 storage

1.1.10

(2024-04-05)

Fixed

  • Filter by Store View
  • Undefined variable $links error

1.1.9

(2024-03-26)

Improvements

  • Adding global attachment position

1.1.8

(2024-03-13)

Improvements

  • Adding possibility to define attachment order on category and product pages

1.1.7

(2023-12-01)

Improvements

  • Open the attachment in a new tab

1.1.6

(2023-07-24)

Fixed

  • Compatibility with php less than 7.4
  • Assign attachment to product on product edit page in Magento EE

1.1.5

(2023-03-15)

Fixed

  • PHP 8.2

1.1.4

(2023-03-03)

Fixed

  • Error when adding a product if MSI is used

1.1.3

(2022-09-30)

Fixed

  • mkdir(): File exists

1.1.2

(2022-09-26)

Fixed

  • Filter by customer group

1.1.1

(2022-06-20)

Improvements

  • remove db_schema_whitelist.json

1.1.0

(2022-05-23)

Improvements

  • migrate to declarative schema

1.0.1

(2020-11-09)

Fixed

  • Analytics for links
  • Compatibility with Magento 2.3.x
  • Invalidate cache

1.0.0

(2020-10-27)

Improvements

  • Initial release