Skip to content

magento man

Should we use require_once in a module’s registration.php?

I am of the opinion that using require_once in registration.php is not ok and possibly against Magento coding standards. Am I right or wrong? <?php MagentoFrameworkComponentComponentRegistrar::register( MagentoFrameworkComponentComponentRegistrar::MODULE, ‘Vendor_Module’, __DIR__ ); require_once(BP.’/lib/internal/SomeModule/src/somemodule/autoload.php’);

magento 2 : is it impact on isting page performance for $_product->getResource()->getAttribute(‘custom_attribute_code’)?

I have a custom attribute which has 15 text values. I am using $_product->getResource()->getAttribute($attributecode)->getFrontend()->getValue($_product); . In catalog page I have used above code get the text value of attribute for every product in for loop, is it impacted on performance… Read More »magento 2 : is it impact on isting page performance for $_product->getResource()->getAttribute(‘custom_attribute_code’)?

Magento 2.3: Error on admin product save after changing attribute set

I am getting this error after I change the attribute set and save the product: Fatal error: Uncaught Error: Call to a member function getBackendTable() on boolean in /chroot/home/aa8492ec/018d4ad51c.nxcli.net/html/vendor/magento/module-catalog/Model/ResourceModel/Product.php:350 Stack trace: #0 /chroot/home/aa8492ec/018d4ad51c.nxcli.net/html/vendor/magento/module-catalog/Model/ResourceModel/Product.php(331): MagentoCatalogModelResourceModelProduct->deleteSelectedEntityAttributeRows(Object(MagentoCatalogModelProductInterceptor), Array) #1 /chroot/home/aa8492ec/018d4ad51c.nxcli.net/html/vendor/magento/module-catalog/Model/ResourceModel/Product.php(304): MagentoCatalogModelResourceModelProduct->removeNotInSetAttributeValues(Object(MagentoCatalogModelProductInterceptor)) #2 /chroot/home/aa8492ec/018d4ad51c.nxcli.net/html/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1942):… Read More »Magento 2.3: Error on admin product save after changing attribute set