Closed (works as designed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Contributed modules
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Nov 2010 at 03:43 UTC
Updated:
23 Mar 2011 at 01:42 UTC
Comments
Comment #1
redben commentedPart of which modul should this be ?
Comment #2
googletorp commentedI have created the foundation of what could become the shipping module for Drupal commerce. I mostly have taken code from the payment and product modules as the shipping system mostly is a mix of these features:
• Payment: Allow modules to define shipping methods, integrate with rules and create a form to pick shipping method etc.
• Product: Create shipping line and display it during review.
The shipping system that I made works as is, but there is room for improvements and added features, like being able to select multiple shipping methods. Some alterations will most likely be needed when physical products is implemented, but that is for the most part something modules defining shipping methods needs to worry about.
The code can be found at github.
One thing to be aware of, If the shipping module should function properly in all cases, the order needs to change status when the cart contents is changed #1001540: Change order status to cart if the contents of the shopping cart is changed., which again needs #1001288: Inconsistant implementation of save method on DrupalDefaultEntityController subclasses. to function properly.
Comment #3
jon pughI tested this and it works great, as advertised. I think you should definitely file a Pull Request to get this synced up with the main repository.
Also, its in better shape than the tax system is right now, which doesn't even have an example module yet. I am actually planning on implementing a tax example module based on this model, as I think its best handled as an additional line item, like your module handles it.
+1 to putting this in the pipeline
Comment #4
jon pughI take some of that back... it doesn't seem to alter the actual order total price yet...
Still trying to wrap my head around how everything works, once I do I can probably start patching
Comment #5
googletorp commentedI haven't had the time to keep this code up to date, as I have been bussy. Anyways I'm currently in the process of updating the site that runs this to the latest commerce, and fix the shipping module in the process.
Some alterations that is needed for the shipping module in it's current form to have have been in and out of commerce, so we might need to make some tweaks either to commerce or the shipping module. The main issue that had making this, was that customers can alter the cart after the shipping costs have been calculated, which would require a recalculation as the shipping price could change when the cart contents are changed.
Commerce does all the work with the order totals, so doubt the shipping module is at fault there. It works by creating shipping line_item type, the line_item type that the shipping module defines. Line items has quantity and price, which added to the order total. When the line item(s) are added to the order, commerce makes sure to add their totals to the order total.
Anyways, will try to get the shipping module up to speed and write here when I have.
Comment #6
jon pughAccording to this http://www.drupalcommerce.org/node/269 shipping will not be in commerce core for 1.0 release....
Perhaps for now we should post just the shipping module to a new contrib project?
Comment #7
rszrama commentedfwiw, the roadmap is based on me not having a chance to review the shipping code... it's not set in stone, so I wouldn't want to discourage any work from happening here. It's mostly just a time and resources thing in the run-up to DrupalCon. : )
Comment #8
googletorp commented#6 Personally I have been pushing for this to get into commerce. Ryan can tell how many times I have asking him if he has reviewed the code yet. What I would like to avoid is what I'm doing right now, updating the shipping module to fit the actual state of the commerce way of doing this, like now using arrays instead of objects for pane hooks etc. Also the shipping module is needed by many and could be improved further if it was used more.
Also the roadmap states that shipping calculation should be in contrib for now, which is something I personally agree upon. The shipping module creates a basic functionality that contrib modules can hook into. Stuff like rules integration, handling creation of line items etc. But the actual heavy lifting of calculating the shipping cost is done in a contrib module. In time it would be nice to offer different configurable shipping modules that can cover a lot of the basic needs, but that shouldn't be out focus now, in my opinion.
Comment #9
rszrama commentedThis work should at least be reviewed prior to rolling a beta to see if it makes sense to include... but I'm not sure it makes sense to include this and not a Physical Product module - so their fates are tied together. See #962948: Add fields for describing physical products.
Comment #10
rszrama commentedUntagging. I think it's best for this work to mature in contrib unless something drastically changes after the beta 1. I do fully intend to carry on the Physical Product development, I'm just afraid of hampering it in core while we try to sort out the best way to calculate shipping in contrib. : (
Is the shipping line item type module up to date? I see commits as recent as the 14th.
Comment #11
googletorp commentedI accidentally deleted the commit history of the shipping module, when cleaning up my commerce branch, so the commit days are probably a bit off. The Shipping module is, however, updated to work with commerce 5 days ago. I know there have been a lot of changes up to the beta release, but it should still be fully functional.
One of these days, I plan to give it some love, and clean up the code a bit, and use entity_metadata_wrapper, which we didn't use much when I made this in December. I also plan on making a simple API function to trigger shipping calculation, needed for upsellling or other use cases.
Comment #12
rszrama commentedSounds good. If you don't mind, I'd be happy to have a hand in cleaning it up and helping maintain it as one of our "essential non-core modules."
Comment #13
damienmckennaAny chance of getting that module back to d.o instead of github? Thanks :)
Comment #14
rszrama commentedClosing this issue for now as work is going on in the Commerce Shipping project: http://drupal.org/project/commerce_shipping