Skip to main content

Installing the extension

Use these steps to install the extension on your store.

Prepare for installation​

  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 your Magento 2 store.
  3. Copy the installation instructions from the My Downloadable Products page and paste them into the SSH console. Press ENTER to proceed.

Execute the following commands to install the extension​

  1. Run the following command to enable the extension:

    php -f bin/magento module:enable Mirasvit_Core Mirasvit_Report Mirasvit_Credit Mirasvit_CreditGraphQl
  2. Run the following command to install the extension:

    php -f bin/magento setup:upgrade
  3. Clear the cache:

    php -f bin/magento cache:clean
  4. Deploy static view files:

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

GraphQl support​

The GraphQl API (the credit fields on Customer and Cart and the applyCreditToCart mutation, see GraphQL objects reference) ships with the extension and is installed by the commands above. There is no separate module to install.


If you are using the Hyvä theme​

Hyvä support ships with the extension, so there is no compatibility module to install. On a Luma store the Hyvä part stays dormant. The "Use Store Credit" form, the Store Credit account page and the credit product options carry their own Tailwind styles, so the theme has to be rebuilt once after installation.

  1. Register the extension with the Hyvä build:

    bin/magento hyva:config:generate
  2. Rebuild the theme assets:

    cd /path/to/theme/web/tailwind/
    npm run build

    On a theme older than Hyvä 1.4, run npm run build-prod instead.

  3. Deploy static view files:

    cd /path/to/project/
    rm -rf pub/static/*; rm -rf var/view_preprocessed/*;
    php -f bin/magento setup:static-content:deploy
  4. Flush the cache:

    bin/magento cache:flush
Note

Until version 1.4.0 Hyvä and GraphQl support were separate packages: mirasvit/module-credit-hyva (the Hyva_MirasvitCredit module) and mirasvit/module-credit-graph-ql. Both packages are gone, and Hyva_MirasvitCredit no longer exists. If they are still installed on your store, upgrading the extension removes them by itself. See How to upgrade the extension.


If you want to upgrade the extension, please refer to the How to upgrade the extension section. To temporarily disable or remove it, use the commands from the How to disable the extension section.