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 wishes to add an action to a pre-existing route, but does not wish to interfere with the functionality of the actions from the original route.
What must the developer do to ensure that their action works without any side effects in the original module?
To add an action to a pre-existing route without interfering with the functionality of the original route, the developer must use the before or after parameters in the route declaration. This will load the developer's module in before or after the original module, respectively.
For example, the following code would add an action to the my_module/index route before the action from the original module:
<route id='my_module/index'>
<before>my_module_before</before>
</route>
The my_module_before action would be executed before the MyModule\Controller\Index action, which would allow the developer to perform any necessary setup before the original action is executed.
An Adobe Commerce developer was asked to provide additional information on a quote. When getting several quotes, the extension attributes are returned, however, when getting a single quote it fails to be returned.
What is one reason the extension attributes are missing?
The extension attributes are missing because the collection='true' attribute is not set in the etc/extension_attributes.xmi file. This attribute tells Magento that the extension attributes should be returned when the quote is retrieved.
To fix this issue, the developer needs to add the collection='true' attribute to the my_attributes extension attribute.
Once the collection='true' attribute is set, the extension attributes will be returned when the quote is retrieved.
An Adobe Commerce developer is tasked with adding an new export option for the order grid, they have added the following code for the export button within sales_order_grid.xml:
Upon testing, they are getting redirected, what would be a cause for this error?
The developer has to add a formkey for the new export option because the formkey is required for security reasons. Without the formkey, the request will be rejected and redirected to the dashboard page. Verified Reference: [Magento 2.4 User Guide] [Magento 2.4 DevDocs]
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');
}
Billy
4 days agoJacquline
10 days agoUla
15 days agoCorrina
18 days agoTricia
1 months agoJina
1 months agoEladia
1 months agoSophia
3 months agoFidelia
3 months agoSharita
4 months agoShawna
4 months agoAntione
5 months agoVi
5 months agoKristel
6 months agoSkye
7 months agoGussie
7 months agoCristen
7 months agoTequila
8 months agoDonette
8 months agoOzell
8 months agoPaulina
9 months agoMarylyn
9 months agoNatalie
9 months agoIsaiah
9 months agoMargarita
10 months agoMicheal
10 months agoBettye
10 months agoBernardine
10 months agoDesiree
10 months agoDick
11 months agoAhmed
11 months agoDelmy
11 months agoLeontine
11 months agoWeldon
11 months agoSerina
12 months agoEdelmira
12 months agoFairy
12 months agoIsaac
1 years agoVirgina
1 years agoLouann
1 years agoDallas
1 years agoVicki
1 years agoSylvia
1 years agoAshanti
1 years agoGeorgeanna
1 years agoStephaine
1 years agoMartha
1 years agoDesire
1 years agoSherman
1 years agoSharika
1 years agoAnnmarie
1 years agoCyndy
1 years agoLarue
1 years agoDoyle
1 years ago