Closed (works as designed)
Project:
Commerce Shipping
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2011 at 13:49 UTC
Updated:
26 Dec 2011 at 17:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
googletorp commentedThe order has reference to line items which has reference to products.
So line item quantity x product weight summed for all line items should give total weight.
Comment #3
Daemon_Byte commentedHi again. I managed to make a weight based shipping module and now I expanded it so it can handle different rates for different areas. Hopefully I will finish the project soon and get some of the code cleaned up for being released. The one thing I have noticed now is when they change the country on the checkout/3 page the shipping options area doesn't change. Instead they have to click continue then back which will change the postage option list. Then they have to click continue again for it to be applied to the price. Is this a rules trigger I have wrong or is this bit of ajax just missing and in need of coding?
Comment #4
googletorp commentedI believe this issue is being addressed in Ryan's work in the 2.x branch.
Comment #5
Daemon_Byte commentedarh I see so it's a known issue? I will see if I can find some more info about it so I can get it fixed :)
Comment #6
Daemon_Byte commentedI've been playing around with 2.x since if I'm going to make this work I might as well put the effort into the latest one. Since it has changed so much I've struggled to edit my module to fit. Before I made fields on the rule that allowed you to set your own rate for each rule. How do I put a field on the calculation rule so I can put in a rate specific to that rule?
Comment #7
BenK commentedSubscribing
Comment #8
minneapolisdan commented+1, I probably will need a shipping module like this at some point
Comment #9
Daemon_Byte commentedI couldn't figure out a way to get it to work with rules properly but I had an idea of sorts so when I get something working I'll post it here along with my failed rules attempt and maybe someone who knows best can decide which approach to take going forward.
Comment #10
Anonymous (not verified) commented+1!
Comment #11
Daemon_Byte commentedHey Googletorp, I switched to the 2.x branch and I have managed to get a system created where you can create rules based on weight and country. It picks the right weight out and everything but once again I am stuck with the inability for the page to refresh when you change the country without clicking next and back. http://shop.styalways.co.uk/checkout/13 (username: test / password: testpassword) It's still a development site but it gives you an idea. A UK address should do 10, EU address 20 and anything else 30.
Can you give me any pointers in where I can find the code I need to get that radio option to update and therefore update the shipping line at the top? Also is it possible to add multiple entries into those radio buttons with just 1 shipping module?
Comment #12
googletorp commented#11 Ryan have made the 2.x branch, I haven't looked much into it yet, so he's your best bet for help/guidance.
Comment #13
dpolant commentedI took a stab at this before I found this thread ... http://drupal.org/sandbox/dpolant/1330738
This module uses a configuration page rather than rules to set different rates for different product types. Feel free to use or fork this project if it will help, although I didn't write anything in to deal with countries.
Comment #14
Daemon_Byte commentedI ended up making a separate configuration page as well. Did you manage to get the prices to change on the checkout form when you change country? I will certainly have a look at yours and see if I can use it to fix the flaws in mine :)
Comment #15
jimkont commentedHi,
I needed a fixed shipping price per weight range module, so I used [#13] 's work to create a new rule.
Now using my module and flat rate shipping I can create shipping rules depending on the total order weight
the code is in github (in case anyone cares)
https://github.com/jimkont/drupal-commerce-order-weight-rule
Best,
Dimtiris
Comment #16
ardnet commentedSubscribe
Comment #17
Daemon_Byte commentedI have attached my version of the weight based shipping module. So far it seems to work rather well but I do need some help with the following issues:
1) I think it could be made cleaner with the way it interacts with commerce module
2) It currently hides the summary table on the checkout page because when you change the country the shipping doesn't change. I could use some help making that happen.
Comment #18
googletorp commentedMaybe you should create a sandbox Deamon_Byte and take the discussion there.
Some pointers:
Looks like weight_shipping_create_instance is missing
You should use Commerce Physical Product to handle storing the weight.
Doing queries on serialized data isn't a good idea, it isn't database agnostic and can easily break.
You haven't use t() a lot of places.
currency_code for the rates is hardcoded
In any rate this issue doesn't really belong here anymore. This is talk about making a new module, more than it is anything related to commerce shipping.