Category Archive : Magento2

Installing Magento 2.4 on Windows 10 can be really frustrating because of all the errors related to configurations. Here is a very simple step by step tutorial to install Magento 2.4, configuring and resolving all the errors that arise in the process. A video-based tutorial is also available if you prefer to watch and follow the steps.

Following are the pre-requisites required for installing Magento. Download the setups of the following.

After downloading the setups, You need to install XAMPP and Composer and follow the steps below.

  • Start Apache and MySQL from XAMPP Control Panel.
  • Navigate to htdocs folder inside XAMPP installation directory.
  • Create a new folder inside htdocs with the name of “elasticsearch”. Paste the downloaded Elasticsearch zip file inside the newly created folder. Extract the zip file, navigate to bin folder, and double click on “elasticsearch.bat” to start elasticsearch cluster.
  • Make sure that elasticsearch is up and running by visiting localhost:9200 by any browser. You should see a JSON object.
  • Now visit localhost/phpmyadmin and create a new database ‘magento
  • Create a new folder inside htdocs with the name of ‘magento’. Paste the Magento zip file, that we downloaded earlier, inside this folder and extract it.
  • Inside your magento directory, navigate to vendor\magento\framework\Image\Adapter and open G2d.php with any code editor. Search for the method named “validateURLScheme”, which should be at line # 86. Replace the entire method code with this code:
  • Inside your magento directory, navigate to vendor\magento\framework\View\Element\Template\File and open Validator.php with any code editor. Scroll down to line # 138. Replace the entire line with the following snippet:
  • Inside your magento directory, navigate to vendor\magento\framework\Interception and open PluginListGenerator.php with any code editor. Scroll down to line # 158. Replace the entire line with the following snippet:
  • Inside your XAMPP installation directory, navigate to xampp/php and open php.ini with any code editor. Enable the extensions intl, soap, sockets, xsl on line 921, 943, 944, 949 respectively by removing semi-colon before the word extension. Now restart xampp.
  • Inside your magento directory, open cmd and run the following commands in order. If any command gives an error, make sure your PHP version is 7.3 or greater and you’ve made all the changes mentioned above.
  • We are nearly there. Open localhost/phpmyadmin and switch to database ‘magento’. Now the run the following query in the SQL Query tab:
  • Open localhost/magento/admin in any browser and login using ‘admin’ and ‘admin123’ as username and password respectively. After logging in, if the loader does not disappear and keeps on loading then there is one more change you need to make. Inside your magento directory, navigate to app/etc/di.xml and search for

and replace it with

  • Now refresh the page and voila, you have installed Magento 2.4 successfully! Phew, that was a lot of work.

If you got stuck at any point, there is a video tutorial available and you can watch it for a reference.

How to install the extension

  1. Backup your store’s database and web directory.
  2. Login to your server’s SSH console and navigate to the root directory of the Magento 2 store.
  3. Copy the installation instructions from the page My Downloadable Products to the SSH console and press ENTER.
  4. Run command php -f bin/magento module:enable Mirasvit_Core Mirasvit_Related to enable the extension.
  5. Run command php -f bin/magento setup:upgrade to install the extension.
  6. Run 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

  8. Run command php -f bin/magento indexer:reindex mst_related_index to reindex extension-related data.
  9. Make sure that the native Magento cron job is configured and working correctly. The Related Products for Magento 2 extension runs all tasks in cron.

“(Magento\Framework\Exception\NoSuchEntityException): The attribute with a “sw_menu_block_top_content” attributeCode doesn’t exist. Verify the attribute and try again.”

Remove modulde Smartwave_megamenu from table setup_module on database and ran

$ php -f bin/magento setup:upgrade
$ php -f bin/magento setup:di:compile

 

Disabling the Extension

Temporarily Disable

To temporarily disable the extension please follow these steps:

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

Removing the Extension

To uninstall the extension, please follow these steps:

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

To upgrade the extension, follow these steps:

  1. Backup your store’s database and web directory.
  2. Login to your server’s SSH console and navigate to the root directory of the Magento 2 store.
  3. Run command composer require mirasvit/module-related:* --update-with-dependencies to update current extension with all dependencies.

    Note

    There are some cases when the command above is not applicable; it is not possible when updating the current module; neither will it be applicable when upgrading all the Mirasvit modules in a bundle. In this case, the command above will be of no effect. 

    Run instead composer update mirasvit/* command. It will update all Mirasvit modules installed in your store.

  4. Run command php -f bin/magento module:enable Mirasvit_Core Mirasvit_Related to enable the extension.
  5. Run command php -f bin/magento setup:upgrade to install updates.
  6. Run 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

  8. Run command php -f bin/magento indexer:reindex mst_related_index to reindex the data related to the Related Products for Magento 2 extension.