Blog

  1. VirtualType of Magento2 DI

    In Magento 2, a VirtualType is a type of object that is created and configured using the dependency injection (DI) mechanism.

    A VirtualType is not a concrete class, but rather a way to define a set of arguments and configurations that can be used to generate an instance of an object on-the-fly. This can be useful when you need to create an object that requires a complex set of dependencies or configuration options, but you don't want to create a concrete class for it.

    To create a VirtualType in Magento 2, you first need to define it in the di.xml file of your module.

    To define a virtual type, you need to specify the following in the di.xml file:

    name: The name of the virtual type. This should be a unique identifier that is used to refer to the virtual type in other parts of the Magento 2 codebase.
    type: The class that the virtual type is based on.
    shared: A Boolean value that indicates whether the virtual type is a singleton or not. If set to true,

    Read more »
  2. How to increase product prices in bulk

    To increase the prices of all products in Magento 2, you can follow these steps:

    1. Log in to your Magento 2 admin panel.
    2. Go to Catalog > Products.
    3. Select all the products for which you want to increase the price. You can do this by selecting the checkbox next to each product or by selecting "Select All" from the "Action" drop-down menu.
    4. ...
    Read more »
  3. Order email arrives without product list - Magento2

    If after updating Magento (Adobe Commerce) to version 2.4.4 and higher your customers receive order emails without a list of products, then the solution below should help you solve your problem.

    First of all, you need to check your email templates for "New Order" and "New Order for Guest".
    If they contain such a code

    {{layout handle="sales_email_order_items" order=$order area="frontend"}}

    then change the selected part in it as shown below
    {{layout handle="sales_email_order_items" order_id=$order_id area="frontend"}}

    Read more »
  4. Error with command catalog:images:resize

    If you noticed that your images have not appeared on your Magento2 site you can check the log file. There you can see the error below

    imagecolorsforindex(): Argument #2 ($color) is out of range#0

    /vendor/magento/framework/Image/Adapter/Gd2.php(347): imagecolorsforindex()

    This error happens because the PHP library GD2 for PHP 8.1 has a bug. 

    For fixing this issue you should run the command below

    bin/magento config:set dev/image/default_adapter IMAGEMAGICK

    Read more »
  5. Magento admin login problem

    If you can't log in to the admin panel, but no error is shown, then you may have a problem with the session size.

    Below is one solution to this problem.

    Read more »
  6. Magento 2. Too many redirects

    Given

    The site is working on Adobe Commerce (Magento) 2.
    Site loads by HTTPS (SSL).
    There is an ERR_TOO_MANY_REDIRECTS error on your server.

    Read more »
  7. The website with id 1 that was requested wasn't found. Verify the website and try again.

    If you have the error as in the title of this page this solution can help you.

    In our case, this error happened when we synchronize live DB in dev DB.

    The solution

    Before anything action, you must make backup your DB

    Read more »
  8. Problem with update Magento to 2.4.3 version

    If you get this error when running bin / magento setup: upgrade command
    Unable to apply data patch Magento\Paypal\Setup\Patch\Data\UpdateBmltoPayLater for module Magento_Paypal.

    Original exception message: Notice:

    Undefined offset: 1 in /vendor/magento/module-paypal/Setup/Patch/Data/UpdateBmltoPayLater.php on line 138

    then you need to execute the following command in the Database
    DELETE FROM `core_config_data` WHERE path="payment/paypal_express_bml/active";

    Read more »
  9. How do I get a Site ID and Password to work with the DHL API?

    To use our DHL Express Comprehensive Shipping for Magento® 2.x or MyDHL Express Comprehensive Shipping for Magento® 2.x modules, you must have a Site ID and Password that is not the same as your dhl.com login details.

    To obtain a Site ID and Password, contact your DHL manager, he will make a request for an account to work with the DHL API.

    Read more »
  10. Proxy class not generated when running php bin/magento setup:di:compile command

    If after running the command php bin / magento setup: di: compile your proxy class was not created, then a possible reason may be that your di.xml has line breaks in the "argument" field.

    Read more »
Page