Possible Bug With Table Rate Shipping

Table Rate shipping was not working for us so I had a look a quick look at the code.

I noticed in the calculate_shipping method (ln 258), the logic for all individual case statements is to break only after a $price is set.

Except in the case 'CA' block. In this block the break statement occurs outside of the if statement and I'm guessing it is always executed first loop. In our case the result was that shipping was never getting set and customers were getting free shipping.

I moved the break statement to within the if statement as it is in all of the other case statements so now it looks like this (and seems to be working):

case 'CA':
	for ($i = $settings['shipping']['table-rate']['rowcount'] - 1; $i >= 0; $i--)
	{
		if ($total >= $settings['shipping']['table-rate'][$i]['mincost'])
		{
			if ($country == 'CA')
				$price = $settings['shipping']['table-rate'][$i]['in_country'];
			else if ($country == 'US')
				$price = $settings['shipping']['table-rate'][$i]['usa'];
			else
				$price = $settings['shipping']['table-rate'][$i]['international'];
			break;
		}
	}
break;