# Group (the cart) products by

## Grouping products will change the shipping costs

We can analyze cart products grouped under different criteria, to determine if it matches over one rule and thus is applicable to shipping cost calculation.

The possible criteria for grouping are:

### None [no grouping]: | Each product will be analyzed individually, even if they have the same reference
### Per ID / SKU: | The products with the same reference will be grouped
### Per product [group variations]: | Every product variations included will be grouped
### Per shipping class: | All products with the same shipping class will be grouped
### All grouped as one: | The whole cart products will make up a only group

## Another simple example

Let's show, how the different grouping criteria, switch how the cart is processed to calculate the shipping costs:

Let's say we want to charge 1€ shipping costs for products that weigh 500 g., or more:

Let's consider this cart:

Product | Quantity | Weight | Shipping class
--- | --- | --- | ---
Shirt (size S variation) | 1 | 225 g. | Clothes
Shirt (size L variation) | 2 | 280 g. | Clothes
Polo | 1 | 360 g. | Clothes
External hard drive | 1 | 425 g. | Computers

## Grouping None [no grouping]

Each cart item will be analyzed separately:

Product | Quantity | Weight | Rule #1 | Cost
--- | --- | --- | --- | ---
Shirt (size S variation) | 1 | 225 g. | Min. 500 g.: | /
Shirt (size L variation) | 1 | 280 g. | Min. 500 g.: | /
Shirt (size L variation) | 1 | 280 g. | Min. 500 g.: | /
Polo | 1 | 360 g. | Min. 500 g.: | /
External hard drive | 1 | 425 g. | Min. 500 g.: | /
Rule #1 cost: |  |  |  |

Note that even the two shirts L-sized are analyzed separately. This rule will not be taken because no product matches the selection criterion.

Important: If no rules to apply, because no product matches the selection criteria, the shipping method will be disabled for that cart.

## Grouping Per ID / SKU

With the ID / SKU criterion, the variations are still analyzed separately, but grouped the products that are identical :

Product | Quantity | Weight | Grouped weight | Rule #1 | Cost
--- | --- | --- | --- | --- | ---
Shirt (size S variation) | 1 | 225 g. | 225 g. | Min. 500 g.: | /
Shirt (size L variation) | 1 | 280 g. | 560 g. | Min. 500 g.: | 1€ * 2 = 2€
Shirt (size L variation) | 1 | 280 g.
Polo | 1 | 360 g. | 360 g. | Min. 500 g.: | /
External hard drive | 1 | 425 g. | 425 g. | Min. 500 g.: | /
Rule #1 cost: | 2€

Note that only products that matches the selection criteria impact on the cost of the rule.

If one or more product (group in this case) matches the selection, the rule applies, and it will enable the shipping method for that cart.

## Grouping Per product [group variations]

With the Per product [group variations] criterion, products that are the same, including variations, are grouped together:

Product | Quantity | Weight | Grouped weight | Rule #1 | Cost
--- | --- | --- | --- | --- | ---
Shirt (size S variation) | 1 | 225 g. | 785 g. | Min. 500 g.: | 1€ * 3 = 3€
Shirt (size L variation) | 1 | 280 g.
Shirt (size L variation) | 1 | 280 g.
Polo | 1 | 360 g. | 360 g. | Min. 500 g.: | /
External hard drive | 1 | 425 g. | 425 g. | Min. 500 g.: | /
Rule #1 cost: | 3€

Note that the shirt S-sized itself does not match the selection criterion, but if it is grouped with the other two L-sized, it does.

## Grouping Per shipping class

With the Per shipping class criterion, all clothing will be analyzed as a single group, and the hard disk as a second group:

Product | Quantity | Weight | Shipping class | Grouped weight | Rule #1 | Cost
--- | --- | --- | --- | --- | --- | ---
Shirt (size S variation) | 1 | 225 g. | Clothes | 1145 g. | Min. 500 g.: | 1€ * 4 = 4€
Shirt (size L variation) | 1 | 280 g. | Clothes
Shirt (size L variation) | 1 | 280 g. | Clothes
Polo | 1 | 360 g. | Clothes
External hard drive | 1 | 425 g. | Computers | 425 g. | Min. 500 g.: | /
Rule #1 cost: | 4€

## Grouping All grouped as one

And finally, with the criterion All grouped as one, the whole cart will be grouped as one:

Product | Quantity | Weight | Shipping class | Grouped weight | Rule #1 | Cost
--- | --- | --- | --- | --- | --- | ---
Shirt (size S variation) | 1 | 225 g. | Clothes | 1570 g. | Min. 500 g.: | 1€ * 5 = 5€
Shirt (size L variation) | 1 | 280 g. | Clothes
Shirt (size L variation) | 1 | 280 g. | Clothes
Polo | 1 | 360 g. | Clothes
External hard drive | 1 | 425 g. | Computers
Rule #1 cost: | 5€

## And ... what about the other selection methods?

Products can be grouped, in the same way as we have seen with weight, to: | And can't be grouped (always take the products one by one) the next ones:
--- | ---
Product data: Price Weight Volume Volumetric PRO Volumetric set PRO Advanced: Cart items Number of groups | Product data: Min / Mid / Max dimension Length+Width+Height PRO Length+Girth (L + 2W + 2H) PRO All product kind selectors Advanced: Cart total User Roles All data&time selectors All shipping address selectors

Why can't they be grouped? Well, relative to size, it would not make sense to sum the dimensions of the products. And about taxonomies, different products may belong to different taxonomies, so they cannot be considered together. In any case, it will be taken product per product.

## Different grouping criteria on each condition PRO

In the PRO version, a different grouping for each condition can be set.

Let's say we want to set a flat shipping cost of 10€ if the cart has more than 4 products, discarding those weighing more than 500g.:

You must first uncheck the option to group globally:

And this would be the shipping rules table, with differentiated grouping options:

## All the control

Special Actions allow you to modify the execution of the rules or send messages to your customers:

Special Actions

Wp-Centrics | Advanced Shipping Rates for WooCommerce