Skip to main content

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 your Magento 2 store.

  3. Run the following command to update the current extension along with all dependencies:

    composer require mirasvit/module-rewards:* --update-with-dependencies

    In some cases, the command above may not be applicable, or you may be unable to update only the current module. If that's the case, you will need to upgrade all Mirasvit modules in a bundle. The command above will have no effect in such scenarios.
    Instead, run the following commands to update all Mirasvit modules installed in your store:

    composer update mirasvit/*

    If mirasvit/module-rewards-hyva or mirasvit/module-rewards-graph-ql is installed, you don't have to remove it first. From version 3.6.0 Hyvä and GraphQl support ship inside the extension itself, and composer takes the old packages off during this update. No settings are lost: Mirasvit_RewardsGraphQl keeps its name, and setup:upgrade removes the retired Hyva_MirasvitRewards* module names from app/etc/config.php for you.

  4. Install the updates by running the following command:

    php -f bin/magento setup:upgrade
  5. Clean the cache by running the following command:

    php -f bin/magento cache:clean
  6. On a Hyvä storefront, rebuild the theme assets, so the build picks up the Reward Points templates from their new location:

    bin/magento hyva:config:generate
    cd /path/to/theme/web/tailwind/
    npm run build
    cd /path/to/project/

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

    If your Hyvä theme overrides Reward Points templates, check them. Overrides of the Mirasvit_Rewards* templates are still read, but most of those templates are now shared between Luma and Hyvä, so compare your copy with the new one. The templates the Hyvä package used under its own name moved, and an override left at the old path is simply not read:

    Until 3.6.0From 3.6.0
    Hyva_MirasvitRewardsCatalog::pricing/adjustment.phtmlMirasvit_RewardsCatalog::pricing/adjustment.phtml
    Hyva_MirasvitRewardsCheckout::checkout/price-summary/total-segments/*.phtmlMirasvit_RewardsCheckout::checkout/price-summary/total-segments/*.phtml
    Hyva_MirasvitRewardsCheckout::checkout/cart/wireusepoints.phtmlMirasvit_RewardsCheckout::checkout/cart/usepoints.phtml
    Hyva_MirasvitRewardsBehavior::js/social.phtmlnone: the script is now Mirasvit_RewardsBehavior::js/social.js

    On Hyvä the cart block now uses Mirasvit_RewardsCheckout::checkout/cart/rewardspoints-hyva.phtml, so a Hyvä theme override of checkout/cart/rewardspoints.phtml is no longer read there.

  7. Deploy the static view files:

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