Summary
Throughout this chapter we have built a shipment module with two shipment methods. Each shipment method provided the available delivery options. The flat rate shipment method has only one fixed value under its delivery options, whereas the dynamic rate method gets its values from the getDeliveryOptions method. We can easily embed a real shipping API as part of getDeliveryOptions in order to provide truly dynamic shipping options.
Obviously, we lack the official interfaces here, as we did with payment methods. However, this is something we can always come back to and refactor in our application as we finalize the final module.
Similar to the payment methods, the idea here was to create a minimal structure that showcases how one can develop ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access