Hi Guys,

Excuse the long title, this one has been a long process.

Firstly, thanks for all you do for the community Ryan and co, Drupal Commerce is awesome and we're still getting to grips with it's functionality coming from D6 / Ubercart.

We have a scenario where one size courier package can fit Two x 250ML bottles for a price of $4.40.
Another bottle size of 500ML/750ML fits Two bottles into a slightly larger $5.70 courier package.

Ultimately we want to be able to mix and match the bottles automatically calculated at checkout so you don't get the choice to choose a flat rate at all as it's handled for you.

I've got the flat rates calculating base price plus additional bottles on both sizes however a few problems prevent the desired result.

1) Both flat rate services (250ML & 500ML/750ML) are getting incremented pricing when adding additional bottles however if you only add one size you get both incremented prices for both rates, I couldn't lock down the size in a condition using their vocab > term_id as the identifier. I tried a Data comparison but not sure everything is implemented exactly as it should be.

2) I would prefer to hide the flat rates altogether (or at least the rates that aren't being calculated from) and automatically append the calculated shipping amount for both sizes - if at all possible? This would allow the calculations to happen without having to choose anything which is what I would like to achieve.

3) If I add 1 of each bottle size to the cart I should get a desired $5.70 + $4.40 combined - the calculation increment works but doesn't combine the total amounts and forces the user to choose a flat rate service so this is unhelpful.

4) If I add 2 of each bottle size to the cart I should get the same $5.70 + $4.40 combined - currently my setup adds two of each product sizes resulting in $8.80 and $10.10 for each of the flat rates.

5) If I add 3 of each that should increment the prices by double $5.70 + $4.40 x 2 combined. < This is not happening at all for what ever reason.
What is happening is if I add one instance of either bottle size, both flat rate services are incrementing but you still have to choose between one or the other rather than it combining the prices for both which isn't correct.

Obviously if you need more info I'll do my best to provide it :)

http://pastebin.com/VPZQ1uCe - Export of reaction rule "Add $4.40 for Two x 250ML bottles
http://pastebin.com/i6NmjHfs - Export of reaction rule "Add $5.70 for Two x 500ML/750M

Thanks in advance.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Title: How to calculate separate flat rates for separate product sizes in the same courier package combined » Add support for a composite flat rate service
Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Component: Documentation » Code
Category: Support request » Feature request

Sorry it took so long to follow-up here. I've had the same request in the recent past, where someone needed to be able to define flat rates but never actually show them individually on the checkout form. Instead they wanted to sum all the flat rates that would apply to an order together to create one composite shipping rate for the order.

I advised that site to simply hook into the rate calculation process directly and perform that logic / summing in their own code. However, I'm open to ideas to see how we might allow for a composite flat rate service that looks for any flat rate service that might apply to an order and sums them all up into a single service. This should have the option either to use a single price component or to specify each flat rate individually as a price component in the calculated rate.