Entries by puneetk00

Magento 2 | What is proxies in magento 2.

  Video link for real example. Proxies Design Pattern Proxies is a powerful and easy technique to help you overcome a huge problem of Magento 2. Basically, we can say it is design pattern, which is remove cycle of dependency injection. However, its role and importance are still underestimated. Therefore, in this post, I am going […]

Dependency Injection in Magento 2

 Dependency Injection in Magento 2 Magento 2 In Magento 2 Dependency Injection is one of the most useful design patterns. We all are aware about class and objects, class is collection of objects and methods, while object is an instance of class. Dependency means the class will use objects to perform some function. Injection is […]

Magento 2.4.x install | getting error Invalid credentials for ‘xxxproject-community-edition/magento-project-community-edition-2.4.2.0.zip’, aborting.

 I am trying to install Magento 2.4.x via composer but it giving below error. Have any one idea.  Invalid credentials for ‘https://repo.magento.com/archives/magento/project-community-edition/magento-project-community-edition-2.4.2.0.zip’, aborting. _____________________________________________________________________________________ Puneet Kumar Magento Developer

How to use magento 1 customer password in magento 2

 Magento 1 use MD5 hash to encrypt the password and Magento 2 use SHA-256. In Magento 1, they use Mage_Core_Model_Encryption class with following functions. 1 2 3 4 5 6 7 8 public function getHash($password, $salt = false) {     if (is_integer($salt)) {         $salt = $this–>_helper–>getRandomString($salt);     }     return $salt === false ? $this–>hash($password) : $this–>hash($salt . $password) . ‘:’ . $salt; }   1 2 3 4 5 public function hash($data) {     return md5($data); }   Magento 1 generate hash by md5(salt + […]

Magento 2 : How do create Setup/InstallSchema.php?

Install Script: InstallSchema & InstallData The InstallSchema and InstallData classes will be run during the module install. The InstallSchema setup script in magento 2 will be use to change the database schema (create or change database table). This’s the setup script to create the m2commerce_adminlog_post table: File: app/code/M2commerce/Adminlog/Setup/InstallSchema.php <?php namespace M2commerceAdminlogSetup; class InstallSchema implements MagentoFrameworkSetupInstallSchemaInterface { public function install(MagentoFrameworkSetupSchemaSetupInterface $setup, […]

Magento 2.x | Steps for create a new module

Module is a structural element of Magento 2 – the whole system is built upon modules. Typically, the first step in creating a customization is building a module. To create a module, you have to complete the following high-level steps: Create the module folder e.g VendorName/ModuleName. Create the VendorName/ModuleName/etc/module.xml file. Create the VendorName/ModuleName/registration.php file. Run the bin/magento setup:upgrade script to install […]