I'd like to use the module that allows shipping rates based on order value, but I keep getting the following error with it:
Undefined variable: flat_charge in /var/www/vhosts/mysite/httpdocs/administrator/components/com_virtuemart/classes/shipping/shipvalue.php on line 80
So, in that file, line 80 is part of the code that determines which rate to use. Here's an excerpt:
if($order_total < $base_ship1) {
$flat_charge *= $taxrate;
$shipping_rate_id = urlencode($this->classname."|STD|Standard Shipping under ".$base_ship1."|".$flat_charge1);
$html = "";
$html .= "\n<input type=\"radio\" name=\"shipping_rate_id\" checked=\"checked\" value=\"$shipping_rate_id\" />\n";
$html .= "Standard Shipping: ".$CURRENCY_DISPLAY->getFullValue($flat_charge1);
$_SESSION[$shipping_rate_id] = 1;
}
else if($order_total < $base_ship2) {
$flat_charge *= $taxrate;
$shipping_rate_id = urlencode($this->classname."|STD|Standard Shipping under ".$base_ship2."|".$flat_charge2);
$html = "";
$html .= "\n<input type=\"radio\" name=\"shipping_rate_id\" checked=\"checked\" value=\"$shipping_rate_id\" />\n";
$html .= "Standard Shipping: ".$CURRENCY_DISPLAY->getFullValue($flat_charge2);
$_SESSION[$shipping_rate_id] = 1;
}
/
I notice the author of the module hasn't been on the forums for several months, so if anyone could suggest what I might need to fix, and where, I'd be grateful for any input!
Hi there,
I had the same error. What i did was:
//Flat rate shipping charge up to minimum value
$flat_charge = BASE_CHARGE1;
$flat_charge1 = BASE_CHARGE1;
$flat_charge2 = BASE_CHARGE2;
$flat_charge3 = BASE_CHARGE3;
$flat_charge4 = BASE_CHARGE4;
$flat_charge5 = BASE_CHARGE5;
$flat_charge6 = BASE_CHARGE6;
$flat_charge7 = BASE_CHARGE7;
$flat_charge8 = BASE_CHARGE8;
$flat_charge9 = BASE_CHARGE9;
$flat_charge10 = BASE_CHARGE10;
Its not a fix but it gets rid of the error! hope this helps!