How should this functionality be implemented?

A client has multiple warehouses where orders can be fulfilled. The cost of shipping goods from each warehouse varies by day, due to the number of workers available. The Architect needs to make sure that when an order is shipped, it is shipped from the lowest cost warehouse that is open.

How should this functionality be implemented?
A . Create a new class as a preference for MagentoinventoryShippingpiuginSalesshipmentAssignSourceCodeToShipmentPlugin to set the lowest-cost warehouse on a shipment.
B . Create a new class implementing MagentoinvtntorysourceSelectionApiModeisourceSelectioninterfacece. which returns open warehouses sorted by cost.
C . Create an after plugin On HagentoInventoryDistanceBasedSourceSelectionHodelAlgorithmsDistanceBasedAlgorithto sort to Warehouse sources by cost

Answer: B

Explanation:

According to the Adobe Commerce documentation, the Source Selection Interface is the main interface for implementing custom source selection algorithms. The interface defines a method called execute(), which takes a list of items to be shipped and a stock ID as parameters, and returns a SourceSelectionResultInterface object, which contains the recommended sources and quantities for each item. The Architect can create a new class that implements this interface and provides the logic for finding the lowest-cost warehouse that is open for each item. The Architect can then register the new class as an option for the source selection algorithm in the di.xml file of the custom module.

Reference: Source Selection Algorithm | Adobe Commerce Developer Guide Source Selection Interface | Adobe Commerce Developer Guide

Latest AD0-E722 Dumps Valid Version with 50 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments