Category

Magento2

Category

In this blog, I created customer attribute programmatically in magento 2. Code is supported to php8 and magento 2.4.6  😍Let’s see, how to create customer attribute programmatically. We are creating customer attribute name external_id.First, Create data patch class like AddExternalIdCustomerAttribute.php file at path app/code/Vendor/Module/Setup/Patch/Data/AddExternalIdCustomerAttribute.php After create patch run magento setup upgrade command to create customer attribute.php bin/magento setup:upgradeWe can see newly created customer attribute in customer edit/add. I hope this blog is useful for create customer…

In this blog we will get customer data by customer id using REST API.First we need to admin token to get customer info.We can refer blog for generate admin tokenhttps://www.magedad.com/magento-2-how-to-generate-admin-token-using-rest-api/ Rest API endpoint = https://domain.test/rest/V1/customers/:customerIdRest API endpoint for store(default is store code) = https://domain.test/rest/default/V1/customers/:customerId Method = GETContent type = Content-Type:application/jsonHeader = Authorization: Bearer xxxx_admin_token_xxxx Examples:The following image shows a get customer using customer id by a REST client: Here is simple php code for call…

In this blog, we will call rest api for get customer list in magento2.First we need to generate admin token to get customer.You can refer blog for generate admin tokenhttps://www.magedad.com/magento-2-how-to-generate-admin-token-using-rest-api/ Rest API endpoint = https://domain.test/rest/V1/customers/searchMethod = GETContent type = Content-Type:application/jsonHeader = Authorization: Bearer xxxx_token_xxxxParams =searchCriteria[sortOrders][0][field]=entity_idsearchCriteria[sortOrders][0][direction]=ascExample:The following image shows a get customer list using a REST client. I hope this blog is useful to get customer list using Rest API. In case, I missed anything or…

In this blog I will show you how we can generate admin token using REST API.Rest API endpoint = https://domain.test/rest/V1/integration/admin/tokenMethod: POSTContent type = Content-Type:application/jsonPost Data = {“username”:”<USER-NAME>”, “password”:”<PASSWORD>”} Example:The following image shows a token request for the admin account using a REST client: We can refer adobe commerce document for generate tokens.I hope this blog is useful to generate admin token using Rest API. In case, I missed anything or need to add some more…

If you want to delete legacy database table then you can follow this blog. In blog, We try to delete database entries using root script in magento2.Here is script for delete entries from magento database. Create file deleteData.php in magento root directory. You can run script in magento root path on server. You can use php $argv for pass parameters while run script. See documentHere is code you delete entries with parameter command.Command php deleteData.php…

Sometimes we need to perform some quick action for get data or update data in magento database then this root script help. Root script is easy to create and use. sometimes it’s save lots time of developer and client. We can create root script for different reasons. For example, if you want to get the list of product which contain attribute x value y and update those product attribute a value b.We can use root…

If you get error while install akeneo eneterprice in magento2 then follow below solution. Errors:Sync mirror failed: Failed to execute git remote set-url origin — ‘ssh://git@distribution.akeneo.com:443/magento2-connector-enterprise’ && git remote update –prune origin && git remote set-url origin — ‘ssh://git@distribution.akeneo.com:443/magento2-connector-enterprise’fatal: Couldn’t find remote ref HEADerror: Could not fetch originfatal: the remote end hung up unexpectedly Failed to update ssh://git@distribution.akeneo.com:443/magento2-connector-enterprise, package information from this repository may be outdated Fixed: https://docs.akeneo.com/6.0/cloud_edition/flexibility_mode/docs/composer_settings.html

As we have lots files on server var/log folder. so I have tips for debug logs in adobe cloud or on-premises. Let’s start to analyse logs in magento2.Here is three tips for analyse logs.1. You can monitor live logs using below command. When you run command then you can see live logs.tail -f var/log/*.log 2. If you want to check specific error in old log files then run bewlo command.grep -r ‘error xyz’ var/log/* 3.…

In this blog, I will show you how to upgrade Magento 2.4.5-p1 to 2.4.6-p3 opensource project.If your project integrated with git then first create new branch like release/magento246-p3 using commandgit checkout -b release/magento246-p3We need to upgrade software first. We can see software requirement here Software2.4.5-p12.4.6-p3Composer2.22.2Elasticsearch7.178.7OpenSearch1.22.5MariaDB10.410.6PHP8.18.2, 8.1RabbitMQ3.93.11Redis6.27.0Varnish7.07.3 Run below command to update module version in composer.jsoncomposer require magento/product-community-edition 2.4.6-p3 –no-updateORManually update package version in composer.json file “magento/product-community-edition”: “2.4.6-p3”, Next step is run composer updatethen run magento…