In this blog, I created customer address attribute programmatic in magento 2. Code is supported to php8 and magento 2.4.6 Let’s see how to create customer address attribute programmatically. We are creating customer address attribute name unique_id.First, Create data patch class like AddUniqueIdAddressAttribute.php file at path app/code/Vendor/Module/Setup/Patch/Data/AddUniqueIdAddressAttribute.php After create patch run magento setup upgrade command for execute code.php bin/magento setup:upgradeWe can see newly created customer address attribute in customer edit/add. I hope this blog is useful for…
If you faced issue of customer attribute not saving value in admin panel then this blog is for you. This issue happen if new created attribute not assigned to attribute set. Maybe you missed below code in your patch. Here is complete blog for create customer attribute if you still facin issue please refer blog I hope this blog is useful for fix customer attribute not saving issue in magento2. In case, I missed anything…
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…
TES
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