Category

Magento2 Admin

Category

When we work in magento with out of box customization then we might need to create/update admin user information programmatically in magento2.In this blog, We will see how we can create and update admin user information programmatically. Admin User Create/Update Here is code for create/update admin user using data patch. We can use similar code in Model or Helper classes. Our aims to write quality blog with tested code so we add this code to…

We’ll show you how to add category attributes in magento2 and display in category form. We show here 3 easy step for add category attribute and display attribute to category form. Step 1: Create patch file for create category attribute. Create file below.app/code/MageDad/Module/Setup/Patch/Data/AddAttributeCategoryAttribute.php Step 2: In this step we are going to add attribute in category form. Create file – app/code/MageDad/Module/view/adminhtml/ui_component/category_form.xml Step 2: Run setup upgrade commandphp bin/magento setup:upgrade I hope this blog is useful…

In this blog in explain about how we can get current admin user details from session.We need to use session class Magento\Backend\Model\Auth\Sessiont to get current loggedin admin data.Here is simple code is to get admin details. Code is writter with PHP8 and supported to magento 2.4.6 😍 Created one simple class and loaded Session in construct method You can get more details about user with different methods like for get admin user name $this->authSession->getUser()->getUsername();Here is…