i'm trying to edit the quote function in the table.php file. I want the shipping costs for each weight category set up in the table added together, instead of calculating by the total weight. For example: if my table was given 2:1.13,4:1.18 and the cart had three items, 2 items at 2ounces and one at 4ounces the shipping cost should be 3.44. Like I said i don't really have much experience with php so bare with me, but it seems pretty straight forward.
$table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST);
$size = sizeof($table_cost);
for ($i=0, $n=$size, $z=0; $z<$n; $i+=2, z+=1) {
if ($the_array_of_weights_in_cart[$z] <= $table_cost[$i]) {
echo $shipping; //this is just to show me what's happening
$shipping += $table_cost[$i+1];
//break; take the break out to keep the loop going
}
in theory if the $the_array_of_weights_in_cart[] was an array of the weights in the cart this would work, but i'm not sure. Thanks for any help in advance.