A logistics company with an Adobe Commerce extension sends a list of reviewed shipment fees to all its clients every month in a CSV file. The merchant then uploads this CSV file to a "file upload" field in admin configuration of Adobe Commerce.
What are the two requirements to display the "file upload" field and process the actual CSV import? (Choose two.)
A)
B)
C)
D)
To display the 'file upload' field and process the actual CSV import, the following two requirements must be met:
The developer must create a new system configuration setting that specifies the path to the CSV file.
The developer must create a new controller action that handles the file upload and import process.
The system.xml file is used to define system configuration settings. The following XML snippet shows how to define a new system configuration setting for the CSV file path:
XML
<config>
<system>
<config>
<shipment_fees_csv_path>/path/to/csv/file</shipment_fees_csv_path>
</config>
</system>
</config>
The Controller\Adminhtml\ShipmentFees controller class is used to handle the file upload and import process. The following code shows how to create a new controller action that handles the file upload and import process:
PHP
public function uploadAction()
{
$file = $this->getRequest()->getFile('shipment_fees_csv_file');
if ($file->isUploaded()) {
$importer = new ShipmentFeesImporter();
$importer->import($file);
}
return $this->redirect('adminhtml/system_config/edit/section/shipment_fees');
}
An Adobe Commerce developer has created a process that exports a given order to some external accounting system. Launching this process using the Magento CLI with the command php bin/magento my_module:order: process --order_id=
Example: php bin/magento my_module:order:process --order_id=1245.
What is the correct way to configure the command?
A)
B)
C)
D)
An Adobe Commerce Developer is tasked with creating a custom form which submits its data to a frontend controller They have decided to create an action and have implemented the \Magento\Framework\App\Action\HttpPostActioninterface class, but are not seeing the data being persisted in the database, and an error message is being shown on the frontend after submission.
After debugging and ensuring that the data persistence logic is correct, what may be cause and solution to this?
According to the Magento Stack Exchange answer, form key validation is a security feature that prevents CSRF attacks by checking if the form key in the request matches the one generated by Magento. If the developer does not include the form_key in their custom form, the validation will fail and an error will be shown. Therefore, the developer needs to add the form_key to their requests by using <?= $block->getBlockHtml ('formkey') ?> in their template file. Verified Reference: https://magento.stackexchange.com/questions/95171/magento-2-form-validation
There is an integration developed using a cron service that runs twice a day, sending the Order ID to the integrated ERP system if there are orders that are able to create an invoice. The order is already loaded with the following code:
$order = $this->orderRepository->get($orderId);
In order to verify if the store has invoices to be created, what implementation would the Adobe Commerce developer use?
A)
B)
C)
The developer can use the canInvoice method of the order object to check if the order can be invoiced or not. This method returns true if the order has a state of new, processing, or payment review and has not been fully invoiced yet. The developer can use this method in a conditional statement to send the order ID to the ERP system only if the order can be invoiced. Verified Reference: [Magento 2.4 DevDocs] [Magento Stack Exchange]
An Adobe Commerce developer has installed a module from a third-party vendor. This module fires a custom event named third_party_event_after and also defines an observer named third_party_event_after_observer that listens to that event. The developer wants to listen to this custom event in their own module but wants to execute their observer's logic after the third_party_event_after_observer observer has finished executing.
What would the developer do to ensure their observer runs after the observer defined by the third-party module?
To ensure that the developer's observer runs after the observer defined by the third-party module, they need to set the sort order of the new observer to be less than that of the third-party vendor's observer.
The sort order is a number that is assigned to each observer. The lower the number, the earlier the observer will be executed.
For example, if the third-party vendor's observer has a sort order of 10, the developer's observer would need to have a sort order of 9 or lower.
Sharita
6 days agoShawna
17 days agoAntione
1 months agoVi
2 months agoKristel
2 months agoSkye
3 months agoGussie
3 months agoCristen
4 months agoTequila
4 months agoDonette
4 months agoOzell
5 months agoPaulina
5 months agoMarylyn
5 months agoNatalie
5 months agoIsaiah
6 months agoMargarita
6 months agoMicheal
6 months agoBettye
6 months agoBernardine
7 months agoDesiree
7 months agoDick
7 months agoAhmed
7 months agoDelmy
7 months agoLeontine
7 months agoWeldon
8 months agoSerina
8 months agoEdelmira
8 months agoFairy
8 months agoIsaac
9 months agoVirgina
9 months agoLouann
9 months agoDallas
9 months agoVicki
9 months agoSylvia
10 months agoAshanti
10 months agoGeorgeanna
10 months agoStephaine
10 months agoMartha
11 months agoDesire
11 months agoSherman
1 years agoSharika
1 years agoAnnmarie
1 years agoCyndy
1 years agoLarue
1 years agoDoyle
1 years ago