4

I have two shipping rules for a particular product.

Case 1. (Shipping box)

Quantity: 1-12
Width: 6
Height: 6
Length: 8.75
Weight: 3

Case 2. (Shipping box)

Quantity: 13-24
Width: 8
Height: 6.5
Length: 11.25
Weight: 4

When a user purchases this particular product, if the quantity below 12, use Case 1 shipping dimensions. If greater than 12, use Case 2.

Anyone can point out how to achieve this? I'm using Drupal Commerce with Commerce FedEx as shipping service.

There's a tutorial on how to achieve something like this but it uses flat rate and not any shipping box dimensions.

5
  • Do you have to use FedEx module. Seems like it would be easy to set up with flat rate.
    – googletorp
    Sep 26, 2016 at 14:51
  • @Pierre.Vriens only 1 get triggered, if the quantity is < 12, use 1st case shipping dimensions, if more than 12, use 2nd case dimensions
    – slashsharp
    Sep 26, 2016 at 15:03
  • @googletorp the requirement is to use FedEx module, I already included a link for flat rate tutorial
    – slashsharp
    Sep 26, 2016 at 15:05
  • @slashsharp : ok, that part (in your last comment) I understand, but what is the problem with that, and how would you want it to work? Also: (a) I find the 1-24 for "case 2" bizarre: shouldn't that be like "13-24"? (b) please include your exported rules as I asked in my prior comment (your question seems really confusing to me, posting those rules may help (c) is "2 case" the same as "case 2", if so please be consistent. Sep 26, 2016 at 15:25
  • Sorry for that, I've updated my question. I don't have any rules configured yet as I don't know how. The only thing I have setup are one product with default shipping dimension (Case 1 shipping width/height/weight) and two shipping boxes (using Drupal Commerce box). How am I going to change shipping dimensions (width/height/weight) when user purchase this product if the quantity is more than 12?
    – slashsharp
    Sep 26, 2016 at 15:47

1 Answer 1

3
+50

Using the Commerce Box module, for which only a DEV version exists, you can create Commerce Box entities, but that's about it. E.g. it does not add any specific Rules Actions you can use to select the appropriate shipping box, such as based on product items and/or quantities.

However, there is an inspiring issue for the Commerce Fedex module, titled "Allow altering of default package dimensions". And comment nr 17 of that issue contains an interesting patch which allows for package dimensions alterations.

1
  • Thanks, I ended up editing the module itself. For those who face the same challenges, the file is commerce_fedex_soap_client.inc and the function is _commerce_fedex_get_package_items
    – slashsharp
    Oct 13, 2016 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.