Questions tagged [area]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Map in CMS Block added to Categories Not working

Summary: I have a graphic map on the top of my Categories to show the relative location of some reefs. I am trying to allow the user to select a reef (product) by clicking on the red X on the map. ...
0
votes
0answers
12 views

frontend button only accessible to admin

{ $dateTime = $this->_objectManager->create('Magento\Framework\Stdlib\DateTime\DateTime'); $adminConfig = $this->_objectManager->create('Magento\Security\Model\...
2
votes
1answer
28 views

how to change area in magento 2

I have tried this but this haven't worked for me { if (isset($this->_areaCode)) { throw new MagentoFrameworkExceptionLocalizedException( new MagentoFrameworkPhrase('Area ...
1
vote
1answer
99 views

Magento 2 How to identify order is placed from frontend or rest API?

How to identify order is placed from frontend or rest API ? when we are trying to area code from any event after order placed $this->_checkState->getAreaCode() then we are getting always area ...
0
votes
0answers
15 views

Magento 2 why area code is showing wrong?

we placed order from magento frontend checkout when we check area code from this - $this->_checkState->getAreaCode() then we are getting area code is "webapi_rest" it must be frontend....
-1
votes
2answers
119 views

We would like to call an event which is observed from admin as well as from API, which area I should use?

Please Help me on this point i'm new in thie area , I would like to call an event which is observed from admin side as well as from API, in which area I should put my events.xml an dmy observer file ,...
1
vote
1answer
22 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
128 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
178 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
2k 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
508 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="[...
5
votes
3answers
3k 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
256 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
83 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
53 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
132 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
256 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
2k 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 ...
20
votes
4answers
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/...