Hi all,
I would like to update those interested of some big coming changes to the shop module, which will probably be labelled relase v0.9
Shipping framework overhaulhttps://github.com/burnbright/silverstripe-shop/issues/14I've been building a new and improved shipping system for the shop module. I've started by introducing an abstracted ShippingMethod class. This serves as a foundation for on-site shipping calculators, or off-site api connected calculations. Shipping information can be passed around using a ShippingPackage, which stores weight, and dimensions, value, etc.
I have included a TableShippingMethod, which allows merchants to define prices per range, and region. Range measurements can be weight, volume, value, quantity. I believe this shipping method alone will help merchants to easily to make complex shipping schemes without the intervention of a developer.
database diagram (in progress):
https://docs.google.com/drawings/d/1H209PYgagJtJBMIqg5rXxT6OHiz8J5Mw8pKiywcXyog/editStepped checkouthttps://github.com/burnbright/silverstripe-shop/issues/96In conjunction with improving the shop shipping calculation system, I also needed to make some major changes to the way the checkout works.
Historically the checkout has been based on a single OrderForm. Whilst its nice to place an order in a single form submission, in most cases different parts of the checkout process rely on the data of others. In particular, to provide prices for shipping, we first need an address. To do this in a single form, we require the aid of javascript/ajax.
My personal approach for developing the shop module is to ensure all front-end functionality works without javascript, which will provide a platform for then adding javascript. Graceful degradation.
The solution I've come up with breaks up the checkout into different steps: contact, address, shipping, payment, summary. I've created a CheckoutStep class which is just an extension of Extension. Each step has an action, a form, and a form processing action.
I've also abstracted out (of CheckoutPage / OrderForm) much of the checkout functionality into a Checkout class, so this can be used from each step. I think this will also help for making orders programatically: either through testing, or a REST API. Here's the architecture diagram I'm trying to keep consistent with:
https://docs.google.com/drawings/d/1vQJE2vU_UHukI4YCS0j_bdpGL8WxrzG8z03D7STW52E/editOther notable changes
questions and comments, and any other feedback are welcome, or any other feedback
Jeremy