-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Warehouse Selection Algorithm for the Shipping #5
Comments
Let's be consistent and use "Source" term instead of "Warehouse". Some insight and performance degradation we had with Minimal delivery cost algorithm calculation. In our investigation, we made a half of year ago https://wiki.corp.magento.com/pages/viewpage.action?spaceKey=MAGE2&title=MNI+Multi+Node+Inventory+part+2.+HLD#MNIMultiNodeInventorypart2.HLD-Performanceissues we saw that we have a linear dependency on a number of products in the basket and amount of sources, so all together it gives us square law variation which would be killing for big merchants. But we have priority based algorithm which performance satisfies us. So, we have an idea to make “Minimal Delivery Cost” algorithm work like priority based. But priority would be not static (provided by merchant beforehand), but dynamic – chosen dependent on the delivery address and source address. All that we need is to sort sources in accordance to remoteness from the delivery address and then apply priority based algorithm. Taking as an assumption that shorter distance delivery will cost less than longer distance delivery. We don’t have Geo API and can’t calculate the distance from the source to the delivery address, but actually we no need it, moreover, distance is not always correct way, because delivery from the same State will cost less, even if the distance is longer. |
Description of how
https://wiki.corp.magento.com/display/MPD/%5BMNI%5D+Shipping+Rate+Algorithms By PriorityAlgorithm steps:
By Minimal Delivery Cost:Algorithm steps:Delivery to fulfill the order could be made from one or several (more than one) sources Example 1. Each product item delivered from a single Source:Pre-Condition: Source 1 (Flat Rate - 10$) Source 2 (Flat Rate - 15$) Algorithm steps:1.1) Collect all common sources (with delivery cost) for all products in shopping cart Example 2 delivery made from several Sources:Pre-Condition: Source 1 (Flat Rate - 10$) Source 2 (Flat Rate - 15$) Algorithm steps:1.1) Collect one product delivery cost for each source: Example 3 without common Source (more complexity):Pre-Condition: Shopping Cart Source 1 (Flat Rate - 10$) Source 2 (Flat Rate - 15$) Algorithm steps:1.1) Collect one product delivery cost for each source: Result:
(this value is display for customer) |
Additional AC: |
…ile creating new customer … #5 #14204 - Merge Pull Request magento/magento2#14204 from rostyslav-hymon/magento2:2.3-develop-PR-port-13024 - Merged commits: 1. 255b682 2. e37ae24
…ile creating new customer … #5 #14204
…ile creating new customer … #5 #14204
Accepted Public Pull Requests: - magento/magento2#14210: [Forwardport] Inconsistent Redirect in Admin Notification Controller (by @dimonovp) - magento/magento2#14209: [Forwardport] Invoice grid shows wrong subtotal for partial items invoice. It shows order's subtotal instead if invoiced item's subtotal (by @AlexWorking) - magento/magento2#14207: [Forwardport] Make scope parameters of methods to save/delete config optional (by @mastiuhin-olexandr) - magento/magento2#14205: [Forwardport] Allow changing head and body element through xml layout updates (by @dimonovp) - magento/magento2#14204: [Forwardport] resolved default country selection issue while creating new customer � #5 (by @rostyslav-hymon) - magento/magento2#14203: [Forwardport] Use event object in 'ajax:addToCart' trigger when adding a product to the cart (by @mastiuhin-olexandr) - magento/magento2#14199: [Forwardport] Issue-13768 Fixed error messages on admin user account page after redirect for force password change (by @dimonovp) - magento/magento2#14194: [Forwardport] [FIX] small refactoring and removing not using variable from templates (by @mastiuhin-olexandr) - magento/magento2#14192: [Forwardport] magento/magento2#13820: IE11 minicart not updating on configurable pr� (by @mastiuhin-olexandr) - magento/magento2#14191: [Forwardport] Removed unnecessary protected member variables. (by @dimonovp) - magento/magento2#14190: [Forwardport] Modify Report processor to return 500 (by @AlexWorking) - magento/magento2#14185: [Forwardport] Added missing event parameter for proxy function on the search form submit (by @dimonovp) - magento/magento2#14184: [Forwardport] Add @api annotation to block argument marker interface (by @dimonovp) - magento/magento2#14214: [Forwardport] Fix $useCache for container child blocks (by @rostyslav-hymon) - magento/magento2#14212: [Forwardport] Fix typo in securityCheckers array (by @AlexWorking) - magento/magento2#14215: [Forwardport] #13899 Solve Canada Zip Code pattern (by @AlexWorking) - magento/magento2#14216: [Forwardport] Fix cache issue for currencies with no symbol (by @dimonovp) - magento/magento2#14213: [Forwardport] Added alias to block 'product.info.description' (by @mastiuhin-olexandr) Fixed GitHub Issues: - magento/magento2#13804: Invoice grid shows wrong subtotal for partial items invoice. It shows order's subtotal instead if invoiced item's subtotal (reported by @ankurvr) has been fixed in magento/magento2#14209 by @AlexWorking in 2.3-develop branch Related commits: 1. 0bfc3e1 - magento/magento2#4454: CMS Page with <head> in layout update xml (reported by @zhiyicai) has been fixed in magento/magento2#14205 by @dimonovp in 2.3-develop branch Related commits: 1. 822c6e9 - magento/magento2#3483: Default country selection issue while creating new customer from backend (reported by @keyurshah070) has been fixed in magento/magento2#14204 by @rostyslav-hymon in 2.3-develop branch Related commits: 1. 255b682 2. e37ae24 - magento/magento2#13768: Expired backend password - Attention: Something went wrong (reported by @janssensjelle) has been fixed in magento/magento2#14199 by @dimonovp in 2.3-develop branch Related commits: 1. 4df41e1 - magento/magento2#13820: IE11 minicart not updating on configurable product page (ES6) (reported by @Pumppa) has been fixed in magento/magento2#14192 by @mastiuhin-olexandr in 2.3-develop branch Related commits: 1. 6d4065a - magento/magento2#11512: Incorrect use of 503 status code (reported by @andrewhowdencom) has been fixed in magento/magento2#14190 by @AlexWorking in 2.3-develop branch Related commits: 1. 72c502f - magento/magento2#13791: Submitting search form (mini) with empty value throws error on preventDefault (reported by @koenner01) has been fixed in magento/magento2#14185 by @dimonovp in 2.3-develop branch Related commits: 1. 808487b - magento/magento2#13899: Postal code (zip code) for Canada should allow postal codes without space (reported by @sl02) has been fixed in magento/magento2#14215 by @AlexWorking in 2.3-develop branch Related commits: 1. c87b104 2. ac37727 3. bda63c7 4. cb04f93
removed request_schema attribute added in previous commits
MQE-2076: [PHPUnit 9] assertEquals and assertNotEquals optional parameters removed
[Arrows] Fixes for 1.2-develop (pr1)
Overview
Multiple Nodes Inventory implies that the products will be stored in multiple locations. When Customer buys the product, it should be shipped from the particular location. A customer usually does not care what location product was shipped from, as soon as this is the cheapest option. For the Merchant, it is important to have minimal overhead for the inventory storage and shipping costs. An algorithm which assigns the particular inventory to the order item should take all these considerations into account and select the best possible options.
Use-Case
To visualize the process of the warehouse selection let's describe the following use-case. Customers create an Order to buy products A, B and C:
Merchant has following stock quantities in warehouses X, Y and Z
There are multiple possible options on how to fulfill the order:
As you can see there are multiple possible strategies on how to optimize order fulfillment:
The order fulfillment algorithm should pick the location of the product and use it to calculate the shipping cost.
Problem
Earlier implementations of MNI identified the problems with the advanced algorithms of the warehouse selection. For example, if the warehouse selected based on the delivery cost, for every possible combination of warehouses system should perform the API call to the carrier to retrieve the shipping cost.
Approach
It is impossible for the Magento platform to predict all the circumstances which affect inventory and shipping costs for the particular merchant. That's why instead of implementing all possible optimizations of the algorithm selection, the framework will contain the interface which is used to resolve the Source for the order item. Different implementations of the algorithm will contain
Implementations, provided by the 3-d party extensions will allow affecting the priorities of the warehouse selection depending on the particular case where Magento is used.
Magento framework will provide the default, rule-based algorithm which allows configuring the priority of warehouses depending on the source origin, shipping address and the selected carrier.
Interfaces
Following interface will be called by the Magento framework at the point of shipment calculation. Changing the implementation of the interface allows affecting the algorithm of the Warehouse resolution.
Default Algorithm
Magento will allow creating rules of selecting the fulfillment warehouse based on following pieces of information:
The rules will be defined in the format:
(Customer State, Carrier) -> Warehouse
The rules will be configured in the CSV file and imported to the Magento.
Implementation Items
Following items need to be implemented in order to make Warehouse selection work in Magento:
The text was updated successfully, but these errors were encountered: