Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [area]

The tag has no usage guidance.

1
vote
1answer
13 views

Error Area Code is not set when Creating a virtual Product from Upgrade Schema

I'm using magento 2.2.5 , i want to make a virtual product programmatically using UpgradeSchema , but i alws got an error Upgrading data.. Area code is not set when i run bin/magento setup:upgrade ...
0
votes
1answer
23 views

Disable area in magento2

In magento we have following areas by default. admin adminhtml catalog crontab doc frontend global setup webapi_rest webapi_soap How to disable particular area? for example front end area? update: ...
0
votes
2answers
28 views

Area Code not set, caused by programatically creating shipment

While creating a module, the following error occurs after creating a custom cli command: Area code not set: Area code must be set before starting a session. I have already stated the area code in ...
2
votes
2answers
432 views

Change from frontend area to adminhtml area

I try to use an email template which located in adminhtml area from frontend, the problem is i dont know if changing the state area code is the right way because i alway got an error by doing like ...
1
vote
4answers
241 views

Getting error after using order place after event in Magento2

I used below event for order save after Observer. This is my events.xml <event name="checkout_onepage_controller_success_action"> <observer name="sales_order_save_after" instance="[...
3
votes
2answers
856 views

Area code not set: Area code must be set before starting a session when UpgradeData

I'm using magento verison 2.2.5 and i try to use Setup/UpgradeData.php to run a model function to insert data into database from an external API. but when i run php bin/magento setup:upgrade i always ...
0
votes
1answer
195 views

DI Compile fails with “Area code not set” error

I'm trying to use the \Magento\Sales\Model\InvoiceOrder class to invoice some orders. If I include the class in my constructor, however, then I get the "Area code not set: Area code must be set before ...
1
vote
0answers
55 views

Find Correct Location for Setting Area Code

Not sure this is the right question to ask, but I was given this module with the following line: $areaCode = $this->state->getAreaCode(); Enabling it gives an error when accessing the website (...
1
vote
0answers
52 views

Area Code not set when Model is used while using Upgrade Data Script

I have following code in UpgradeData.php protected $test; public function __construct( \Vendor\ModuleName\Model\Test $test ) { $this->test = $test; } public function ...
2
votes
2answers
81 views

Location Specific Sell

I would not like to sell my product in below states of USA. Alaska Hawaii, Porto Rico, po box, Military bases, APO. How can I do that ?
4
votes
2answers
248 views

The order of the scoped config files

In Magento 2, you can have some config files be scoped. For example di.xml can be present in the etc folder of a module and/or etc/frontend and/or etc/adminhtml. Same goes for events.xml and maybe ...
6
votes
3answers
1k views

Magento 2 - Retriving frontend layout blocks from adminhtml

Problem I need to gain access to the children blocks from the parent block alias of customer_account_navigation from the frontend layout to be used in the adminhtml system configuration. Current ...
1
vote
2answers
2k views

Save Button Do nothing and does not work in my backend

My magento admin area does not save anything, whenever i do any activity either in configuration , editing some code in home page or even re-index , the message shows up like it is saved but its not ...
19
votes
3answers
3k views

Magento 2: How Should Module Developers Read their Own Configuration Files

Scenario: I am a Magento 2 module developer. I want to create a configuration file in app/etc. I want this file to be "scoped" by area app/etc/my_file.xml app/etc/frontend/my_file.xml app/etc/...