Closed (fixed)
Project:
Commerce Physical Product
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2011 at 21:23 UTC
Updated:
6 Nov 2011 at 19:40 UTC
Jump to comment: Most recent file
Comments
Comment #0.0
chriscalip commentedbetter desc.
Comment #0.1
chriscalip commentedbetter description
Comment #0.2
chriscalip commentedwell total height , length, and width is probably dependent on shipping service.
Comment #1
chriscalip commentedAs i go into the code more I kept on changing the request ..
This is possible with commerce_physical_product_line_item_weight
But probably not advisable with each element (width,height,length) of dimensions. Padding is probably required with each element depending on service. (Could use some feedback here). As it is.. i think the logic of just multiplying each element to the product quantity would not be advisable (i think).
Comment #2
chriscalip commentedPatch obsolete. Use #3 and #4 patch
Comment #3
ultimikeChris,
Great minds think alike. Here's the rest of the patch we'll need to calculate the total volume of the order in order to calculate the number of packages.
Thanks,
-mike
Comment #4
chriscalip commentedMike, Nice one!
Here's a patch that complements volumecalc-1295224-3.patch pretty much just additions to the commerce_physical.api.php file to describe volumecalc feature.
Please ignore dimensions-helper-functions-1295224-3.patch.
Comment #5
ultimikeChris,
Sweet - now we just need to get Ryan's attention so he'll accept the patches!
Thanks,
-mike
Comment #6
rszrama commentedReviewing the code, I made a minor change in that the two base API functions to determine the dimensions of an entity / product line item are purely going to be returning dimensions. As the patch stood, you were converting a product line item's dimensions to inches and calculating a volume in an API function that's really just supposed to return a product's dimensions. Instead, the volume calculations should be limited to the commerce_physical_order_volume() function where we know what unit to convert the dimensions to before calculating volume anyways. The return value from this function remains the same, so I'm guessing it won't interfere with your usage in Commerce UPS at all, right? Let me know if I screwed something up.
I committed each patch separately to credit each of you with a different commit. Here's the final version of the API functions committed:
http://drupalcode.org/project/commerce_physical.git/commitdiff/ca64ce2
The hook documentation patch was committed as so:
http://drupalcode.org/project/commerce_physical.git/commitdiff/e2a8866
Comment #7
ultimikeRyan,
In my initial test, it looks like any changes you made to the patch didn't affect Commerce UPS at all. Thanks for giving the patch a thorough review - much appreciated. I'll let you know if anything funky pops up.
Thanks,
-mike
Comment #8.0
(not verified) commentedinitial request was too resource expensive.