Sometimes you have some unique shipping rules that cannot quite be covered with the Table Rate method alone. The filter function int his example allows you to modify the calculated cart data without changing any of the plugin’s code. The below examples will help walk you through the process for each Base Table Rules option, and offer valuable examples for how you can vary the results.
In this example, the shop owner wants to calculate the length of all items in the cart, ignoring the multiple quantities. By default, when calculating Per Order, the method will find the length for each item, multiply it by the quantity being purchased, and then combine those numbers for a total length. In this case, the length should only be for the first item in each line, and not multiply it by the number ordered.