skip to Main Content

Magento 2 InstallSchema method not executed

On my own Magento 2 custom module, I want to install a custom database table. This is the InstallSchema class code: <?php namespace MyVendorMyModuleSetup; use MagentoFrameworkSetupInstallSchemaInterface; use MagentoFrameworkSetupModuleContextInterface; use MagentoFrameworkSetupSchemaSetupInterface; class InstallSchema implements InstallSchemaInterface { /** * @inheritdoc */ public…

VIEW QUESTION

Get dropdown attribute text – Magento 2

I am trying to retrieve the text value for the manufacturer attribute. It is a dropdown field. I tried this: $manufacturerName = $_product->getAttributeText('manufacturer'); $manufacturerId = $_product->getManufacturer(); $manufacturerName should display "BrandName", but it always displays 1 even if I change the…

VIEW QUESTION

I am converting custom php of magento 1 into magento 2

this is the error. Fatal error: Uncaught MagentoFrameworkExceptionLocalizedException: Area code is not set in /var/www/html/magento22/vendor/magento/framework/App/State.php:152 Stack trace: #0 /var/www/html/magento22/vendor/magento/framework/Session/SessionManager.php(173): MagentoFrameworkAppState->getAreaCode() #1 /var/www/html/magento22/generated/code/Magento/Framework/Session/Generic/Interceptor.php(50): MagentoFrameworkSessionSessionManager->start() #2 /var/www/html/magento22/vendor/magento/framework/Session/SessionManager.php(130): MagentoFrameworkSessionGenericInterceptor->start() #3 /var/www/html/magento22/generated/code/Magento/Framework/Session/Generic/Interceptor.php(14): MagentoFrameworkSessionSessionManager->__construct(Object(MagentoFrameworkAppRequestHttp), Object(MagentoFrameworkSessionSidResolverProxy), Object(MagentoFrameworkSessionConfig), Object(MagentoFrameworkSessionSaveHandler), Object(MagentoFrameworkSessionValidator), Object(MagentoFrameworkSessionStorage), Object(MagentoFramewor in /var/www/html/magento22/vendor/magento/framework/Session/SessionManager.php on line 175…

VIEW QUESTION
Back To Top
Search