After an update or after removing an extension in Magento 2, you may see the error No such file or directory in composer autoload_real.php in the command line. The exact message depends on the Magento version and will look something…
Updating the DHL Shipping extension (Magento 2)
Would you like to update your old Magento 2 DHL Shipping extension (https://github.com/netresearch/dhl-module-shipping-m2) but are unsure how to proceed? This step-by-step guide should help you move to the latest version of the DHL Shipping extension, now called Post & DHL…
Pager missing after updating to Magento 2.4.3?
Sometimes after updating to Magento 2.4.3 the pager on the category page goes missing. This happens when you are overwriting templates/product/list.phtml in your theme. Just open that file and replace
|
1 |
<?= $block->getToolbarHtml() ?> |
with
|
1 |
<?= $block->getChildBlock('toolbar')->setIsBottom(true)->toHtml() ?>. |
This should solve the problem, your pager…
“Session size exceeded allowed session max size” problem solution (Magento 2)
You get the error main.WARNING: Session size of … exceeded allowed session max size of … when adding items to an order in the Magento 2 admin area? There is an easy solution to that problem, just run the following…
Unable to add products to an order in the admin (Magento 2)
If you cannot add products to an order from the Magento 2 admin area, run the following command in your Magento 2 root directory:
|
1 |
php bin/magento config:set system/security/max_session_size_admin 0 |
That should resolve the issue.
Fixing Session size exceeded allowed session max size (Magento 2)
Do you receive the message main.WARNING: Session size of … exceeded allowed session max size of …when adding products to an order from the Magento 2 admin area? There is a simple fix: run the following command from your Magento…
Pager missing after updating to Magento 2.4.3?
If the pager disappears from your Magento category page after upgrading to version 2.4.3, you may have overridden templates/product/list.phtml in your theme. Open the file and replace the following code:
|
1 |
<?= $block->getToolbarHtml() ?> |
with
|
1 |
<?= $block->getChildBlock('toolbar')->setIsBottom(true)->toHtml() ?> |
That should resolve the problem.
Running PHP Mess Detector and checking Magento coding standards
To check the quality of Magento 2 code or an extension against the Magento coding standard, you can use PHP Mess Detector. The following command analyzes any directory or individual file:
|
1 |
vendor/bin/phpmd Ihr/Verzeichnis text dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml |
Run the command from the Magento 2 root…
Using jQuery in a template (phtml) (Magento 2)
The following code shows how to load and use jQuery in a Magento 2 .phtml template.
|
1 2 3 4 5 6 7 8 9 |
<script> // Separate additional libraries with commas // In this example, jQuery UI require(['jquery', 'jquery/ui'], function($){ $(document).ready( function() { alert("fertig :-)"); }); }); </script> |