Magento 2 Migration Extensions webpconverted Sale

How to?

  1. 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 »
  2. How to display CMS Blocks on Magento 2 Pages using Widgets?

    Magento 2 CMS blocks are a great way to show different information to your customers. CMS blocks not only make your Magento 2 website more engaging but help you drive customers' attention to certain products, offers, or services. Static blocks are those pieces of content you can display practically on every page of your Magento 2 store.

    You can show CMS block on category page to notify your customers about the top products, add a static block to the CMS page or even another CMS block to diversify their content. 

    In case you don't want to spend too much time going through the CMS block configurations you can call the CMS block in PHTML file or using the layout XML file. However, in this article, you will learn about the most common way to display the CMS block on Magento 2 page which is adding it with the help of widget. So, once you create the CMS block you're good to go.

    Read more »
  3. How to call CMS block in Magento 2 using Layout XML?

    Magento 2 CMS blocks are managed directly from Magento admin using widgets / WYSWYG editor widgets and displayed on any page of your Magento 2 store. Except for displaying CMS block on CMS Page or CMS Block, showing it on category page there is an option to call CMS block programmatically using XML file.

    Use this code in order to add the CMS block using Magento 2 layout XML:

    <referenceContainer name="content">
      <block class="Magento\Cms\Block\Block" name="unick_block_name">
        <arguments>
          <argument name="block_id" xsi:type="string">my_cmsblock_identifier</argument>
        </arguments>
      </block>
    </referenceContainer>

    Read more »
  4. How to display CMS block on Magento 2 Category Page?

    Displaying CMS blocks on Magento 2 category page allows you to inform your customers about some special offers and new category products. There are plenty of other reasons to add CMS block to the catalog category page in Magento 2. And many of you know them already. So, let's not stop here and start learning how to display CMS block on Magento 2 category page.

    Take the following steps to add CMS block to Magento 2 category page:

    1. Go to Catalog > Categories and choose the Category you want to display the CMS block on.

    Magento 2 Category

    2. In the Content section Add the CMS block you want to add.

    Read more »
  5. How to Call CMS block in Magento 2 PHTML file?

    There are cases when you need to display Magento 2 CMS block inside a PHTML template file. To programmatically call the CMS block in .phtml template file please use this code:

    <?php
        echo $this->getLayout()
            ->createBlock(\Magento\Cms\Block\Block::class)
            ->setBlockId('my_cmsblock_identifier') //replace my_cmsblock_identifier with real CMS bock identifier
            ->toHtml();
    ?>

    Note that your CMS block should exist and be enabled. If the CMS block is disabled or does not exist, this code will not display any content.

    The use of createBlock method is a fast but not ideal way in terms of best practices.

    So what you can do is add CMS block into your block using layout, use this code in a proper layout XML handle file and don't forget to flush Magento cache once the layout is changed: 

    Read more »
  6. How to Insert Magento 2 CMS Block into WYSIWYG Editor?

    In case you've already created the Magento 2 CMS block, you might be interested where you can display it. Magento allows you to display the CMS block on the category page, call the CMS block using layout XML or in PHTML file. But, what we're going to show you in this article is how to display the CMS block on Magento 2 CMS page or CMS block with the help of WYSIWYG editor. You can use this guide for WYSIWYG on other admin pages as well.

    For this tutorial, we've decided to include CMS block into CMS page as an example. So take the next steps or watch the video down below.

    Follow these steps to display the CMS block in content using WYSIWYG editor:

    1. Navigate to Content > Pages, choose the CMS page you want to display the CMS block on and in the Action section choose Edit.

    Magento 2 CMS Pages

    2. Unfold the Content section and press the Widget button to insert the widget.

    Read more »
  7. How to Create New CMS Block in Magento 2?

    Creating CMS Blocks in Magento 2 opens a lot of opportunities for you. For example, CMS blocks allow you to share some information with your customers or just make your Magento 2 store pages more interesting and engaging. Magento enables you to create CMS blocks directly from the admin and show them on different pages of your Magento 2 store. 

    Follow these steps to create new CMS block in Magento 2:

    1. Go to Content > Elements > Blocks and press the Add New Block button.

    Magento 2 Blocks

    Read more »
  8. How to Remove Currency Switcher in Magento 2?

    There are different reasons you would want to remove the currency switcher dropdown from Magento 2 storefront.

    Magento 2 Currency Switcher Remove

    For example, you may want to remove it because you use Magento 2 Automatic Currency Switcher and don't want to allow customers to manually change a currency.

    In order to remove the currency switcher dropdown follow these steps:

    1. Create a new file inside your storefront theme folder:

    app/design/frontend/ThemeVendor/ThemeName/Magento_Theme/layout/default.xml

    2. Add this code into it:

    <?xml version="1.0"?>
    <page
    Read more »
  9. How to Remove Language Switcher in Magento 2?

    There are cases when you want to remove the language switcher dropdown from the storefront.

    Magento 2 Language Switcher Remove

    For example, you may want to remove it because you use Magento 2 Automatic Language Switcher and don't want to allow customers to manually change a store view.

    It is an easy task to do. Please follow these simple steps:

    1. Create a new file inside your storefront theme folder:

    app/design/frontend/ThemeVendor/ThemeName/Magento_Theme/layout/default.xml

    2. Add this code into it:

    <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    Read more »
  10. How to create New Category in Magento 2?

    In order to create a new category in Magento 2 follow the steps:

    1. Navigate to Catalog > Categories.

    Magento 2 categories

    Read more »
Posts loader
^Top
Chat