Skip to content

magento man

Issue with exporting custom column(s) to Excel XML

This a Category.php in UiComponentListingColumn in a child module public function prepareDataSource(array $dataSource) { $fieldName = $this->getData(‘name’); if (isset($dataSource[‘data’][‘items’])) { foreach ($dataSource[‘data’][‘items’] as & $item) { //print_r($item);die; if (isset($item[‘product_id’])) { $product = $this->_productloader->create()->load($item[‘product_id’]); $cats = $product->getCategoryIds(); $objectManager = MagentoFrameworkAppObjectManager::getInstance(); $categories… Read More »Issue with exporting custom column(s) to Excel XML

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

Error: Call to a member function setActive() on bool in /var/www/html/project.local/vendor/magento/module-backend/Model/View/Result/Page.php:26

showing this error while clicking on a menu item created for a grid public function execute() { /** @var MagentoBackendModelViewResultPage $resultPage */ $resultPage = $this->_resultPageFactory->create(); $resultPage->setActiveMenu(‘Vendor_Grid::menu_id’); $resultPage->getConfig()->getTitle()->prepend(__(‘Certificate Grid List’)); return $resultPage; }