Kategorie: Magento
Magento 2: Fix for error "Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count()" after upgrade to 2.4.4 with PHP 8.1/8.2
The following error occurs # bin/magento setup:upgrade PHP Fatal error: During inheritance of Countable: Uncaught Exception: Deprecated Functionality: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/htdocs/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php on line 277 in /srv/www/htdocs/vendor/magento/fr...
Magento: Remove old session files
find var/session/ -name "sess*" -type f -delete A litte bash script, if there a > 1 Mio files in this folder. #!/bin/bash NUMBERS="0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z" for number in `echo $NUMBERS` do for number2 in `echo $NUMBERS` do rm var/session/sess_$number$number2* done done
Magento 1.7: VAT ID check failed
Reason: The URL and parameters changed File: /app/code/core/Mage/Customer/Helper/Data.php Remove country code from VatNumber. Line 474: $requestParams['vatNumber'] = str_replace(array($countryCode,' ', '-'), array('','', ''), $vatNumber); Change VAT_VALIDATION_WSDL_URL to 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'
Slides zum Vortrag "Magento 002 - Migriere an einem anderen Tag" sind online
Die Slides zum Vortrag, den ich auf dem Aachener Magento Stammtisch hielt, können hier heruntergeladen werden. Ich habe viel mündlich vorgetragen, aber vielleicht helfen dem ein oder anderen die angesprochenen Probleme. Magento 002 -Migriere an einem anderen Tag Die alternativen Vortragsnamen lauteten: Migriere langsam 2 Magento 2 und die Migration des Todes
FireGento2 für Magento 2 intallieren
php composer.phar require firegento/magesetup2 dev-develop
Magento: Validation of new gTLDs
At this moment it is not possible to validate the new global domain names (gTLDs) in Magento. Neither it is possible to use the new domain names in frontend nor in backend. Magento uses the Zend validation classes which are outdated. You can patch the lib/Zend/Validate/Hostname.php class with the official ICANN list.
Magento: Performance-Optimierung bei Kategorie-Ansicht
Folgender Code kann die Performance von Kategorie-Ansichten enorm beschleunigen, denn diese kann besonders bei Bundle-Products ziemlich schlecht sein. Steigerungen von 400% konnte ich messen. Mage/Catalog/Block/Product/List.php protected function _construct() { $this->addData(array('cache_lifetime' => false)); } public function getCacheKey() { $category = Mage::getModel('catalog/category')->load($this->getCategoryId()); return $this->getRequest()->getRequ...
Magento: Wrong redirect with store code in url when switching language
Change the following line in file /app/code/core/Mage/Core/Model/Url/Rewrite.php (line 252): From $targetUrl = $request->getBaseUrl(). '/' . $this->getRequestPath(); to $targetUrl = $request->getBaseUrl(). '/' . $currentStore->getCode() . '/' . $this->getRequestPath();
Magento: Get resized catalog thumbnail image
My solution for generating a resized thumbnail image is to overwrite the model class of catalog. Here my xml file: <?xml version="1.0"?> <config> <global> <models> <catalog> <rewrite> <category>YOURMODULE_SUBMODULE_Model_Catalog_Category</category> </rewrite> </catalog> </models> </global> </config> The class (/app/code/local/YOURMODULE/SUBMODULE/Model/Catalog/Category.php): class YOURMODULE_SUBMODULE_Mod...
Magento: Add block to content area of home page
Go over the main menu to CMS -> Pages and open the home page. Then go to the tab "Design" and edit the code. The following example adds a block at the end of the content area. <reference name="content"> <block type="core/template" name="cms_name_of_the_block" template="page/widget/2columns.phtml"> </block> </reference>