Skip to content

custom-attributes

Auto Added by WPeMatico

Magento 2 category attribute value returns null

Vendor/Extension/Setup/Patch/Data/CustomAttribute.php <?php namespace VendorExtensionSetupPatchData; use MagentoEavSetupEavSetup; use MagentoEavSetupEavSetupFactory; use MagentoFrameworkSetupModuleDataSetupInterface; use MagentoFrameworkSetupPatchDataPatchInterface; use MagentoCatalogModelCategory; class CreateCustomCategoryAttribute implements DataPatchInterface { private $moduleDataSetup; private $eavSetupFactory; public function __construct(ModuleDataSetupInterface $moduleDataSetup, EavSetupFactory $eavSetupFactory) { $this->moduleDataSetup = $moduleDataSetup; $this->eavSetupFactory = $eavSetupFactory; } /** * {@inheritdoc}… Read More »Magento 2 category attribute value returns null

Custom Attribute not saving into the Sales_Order Table

This is my PLugin : <?php namespace VendorModulePlugin; use MagentoSalesApiDataOrderItemExtensionFactory; use MagentoSalesApiDataOrderItemInterface; use MagentoSalesApiDataOrderItemSearchResultInterface; use MagentoSalesApiOrderItemRepositoryInterface; use MagentoCatalogModelProductFactory; /** * Class OrderItemRepositoryPlugin */ class OrderItemRepositoryPlugin { protected $orderItemExtensionFactory; protected $productFactory; /** * OrderItemRepositoryPlugin constructor * * @param OrderItemExtensionFactory $orderItemExtensionFactory *… Read More »Custom Attribute not saving into the Sales_Order Table

Magento 2 – Add two custom attributes to customer in a new section

In a Magento 2 (2.4.5) instance, I created a new section in CUSTOMER > CUSTOMER INFORMATION, after “Customer View” (thanks to the tutorial of @rakeshjesadiya https://www.rakeshjesadiya.com/create-tab-in-admin-customer-edit-page-in-magento-2). Now, I need to create two custom customer attributes: “OFFICE” and “LEVEL”. Each customer… Read More »Magento 2 – Add two custom attributes to customer in a new section