I can't find any parts of the uc_worldquote_quote() that deals with the Max order price setting. I added these snippets of code to make it work:
<?php
//get order weight and price
$pkgweight = 0;
$pkgprice = 0; // << addition
foreach ($products as $product) {
$units = $product->units;
//make everything into kg
$kg = $product->weight;// * constant(strtoupper($units) .'_TO_KG');
// ^^ by the way, the line above gave me errors so I commented it out
$kg = $kg * $product->qty;
$pkgweight += $kg;
$pkgprice += $product->qty * $product->sell_price; // << addition
}
<
snip>
foreach(
$rules as $rule) {
if ($pkgprice <= $rule->max_amount) { // << addition
switch ($rule->flat_weight) {
case 'flat':
$rate += $rule->rate;
break;
case 'weight':
$units = $rule->units;
$rate += $rule->rate * $pkgweight;
break;
}
}
?>Guess this module needs some work. I needed this functionality now, so I settled for these hackish changes for now.
