Closed (won't fix)
Project:
Commerce Flat Rate
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2012 at 13:47 UTC
Updated:
17 Nov 2012 at 01:52 UTC
is it possible to calculate shipping costs taking only in consideration the total of the products of a certain type of product?
thanks!
Comments
Comment #1
facine commentedWould that be correct? Or is there a better alternative?
Thanks
Comment #2
mortona2k commentedHey, I'm new to commerce/shipping/flat rate. Where do you put this code? I just want to start by adding the flat rate for every 10 items in the cart.
Comment #3
rszrama commentedWhat you're doing in this example is looking at the line item type, which is different from the product type. There is a core Drupal Commerce condition called "Total product quantity comparison" that can compare against the total of all products in the cart, but it doesn't differentiate by product type. You could loop over the line items and tally up the total of all products of a particular type, but it would get cumbersome. Best to write a custom integration instead of trying to build it solely through the Rules interface.