Monthly Archives: September 2020

  1. How to debug 301/302 redirect in Magento 2?

    If you face an unexpected 301 or 302 redirect in Magento 2 and you don't know why it happens or what code causes it, you can easily find this out by temporarily editing the following files:


    Open Response.php and add the following line to the beginning of the setRedirect function:

    var_dump($url); \Magento\Framework\Debug::backtrace(false, true, false); exit();


    public function setRedirect($url, $code = 302)
        var_dump($url); \Magento\Framework\Debug::backtrace(false, true, false); exit();
        $this->setHeader('Location', $url, true)
    Read more »
  2. Uninstalling Magento 2 Extended Product Grid

    Uninstalling Magento 2 Extended Product Grid

    If you decided to remove Magento 2 Extended Product Grid by Magefan, please follow the steps below, also you can contact our team for a free consultation in case you have any issues with Magefan's extension.

    Remove Extension Files

    Removing files instruction depends on the way the Extended Product Grid has been installed in.

    1. If you can find the extension files in the folder


    then remove this folder.

    2. If the extension was installed via the composer and its files are located in the folder


    then run composer CLI command to remove it

    composer remove magefan/module-product-grid-inline

    Read more »
  3. Updating Magefan Extended Product Grid

    Updating Magefan Extended Product Grid

    If you need to update Magento 2 Extended Product Grid by Magefan, please follow the steps below. Note that the update instructions depend on the method Extended Product Grid was installed with.

    Update using composer (Method 1)

    If the Extended Product Grid was installed via the composer (check if vendor/magefan/module-product-grid-inline folder exists), then you need to run these simple CLI commands in Magento 2 directory:

    composer remove magefan/module-product-grid-inline
    composer require magefan/module-product-grid-inline ^x.x.x
    # replace x.x.x with the version you want to use
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy


    Read more »
  4. Magento 2 Extended Product Grid Installation

    Magento 2 Extended Product Grid Installation

    Do you want us to install the Extended Product Grid for you?

    Let our technical engineers do it – check out our Installation Service.

    To install Magento 2 Extended Product Grid by Magefan, please use one of these installation methods.

    Installation Method 1 - Installing via Composer (Recommended/Easier)

    Please navigate to your Magefan Account > My Downloads > Install via Composer to get the composer installation instructions.

    Read more »
  5. Debugging PHP Infinite loop in Magento 2

    There are situations in Magento 2 when page keeps loading and then you get 500 fatal error, memory limit, or timeout error. This is an infinite loop in the PHP code, when the same code is executed over and over again. It is related to some core Magento issues or, most likely, third party extension.

    To debug an infinite loop and find the loop entrance, please follow the steps below:

    1. Open the app/bootstrap.php file and add this code right after PHP open tag <?php in the next line

    $_SERVER['MAGE_PROFILER'] = 'html';

    2. Open the vendor/magento/framework/Profiler.php file and add this code to the beginning of "public static function start($timerName, array $tags = null)" function, e.g.

    Read more »
  6. Debug Backtrace in Magento 2

    In case you work with a lot of different Magento instances as a temporary project you might want to have a nice method to check debug backtrace of some function execution in Magento 2 quickly without installing or enabling additional software on the server, e.g. Xdebug.

    In this case, you can use the native Magento backtrace function from \Magento\Framework\Debug class and call it whenever you need:

    \Magento\Framework\Debug::backtrace(false, true, false);

    As a result, you will get this nice HTML debug-backtrace:

    Magento 2 Debug Backtrace

    Read more »