Skip to content
Snippets Groups Projects
Commit a5e3c27a authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Version 2.4.7: Fix uppercasing of ZIP; first steps to implementing round/max/min functions

parent 8797ebbf
Branches
Tags V2.4.7
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -42,7 +42,9 @@ class plgVmShipmentRules_Shipping_Advanced extends plgVmShipmentRules_Shipping_B
*/
protected function addCustomCartValues (VirtueMartCart $cart, $cart_prices, &$values) {
$values['coupon'] = $cart->couponCode;
$zip=strtoupper($values['zip']);
if ($values['zip']) {
$zip=strtoupper($values['zip']);
}
// Postal code Check for UK postal codes: Use regexp to determine if ZIP structure matches and also to extract the parts.
// Also handle UK overseas areas/islands that use four-letter outward codes rather than "A{1,2}0{1,2}A{0,1} 0AA"
......
......@@ -755,9 +755,16 @@ class ShippingRule {
case "-": $res = ($args[0] - $args[1]); break;
case "*": $res = ($args[0] * $args[1]); break;
case "/": $res = ($args[0] / $args[1]); break;
case "%": $res = ($args[0] % $args[1]); break;
case "%": $res = (fmod($args[0], $args[1])); break;
case "^": $res = ($args[0] ^ $args[1]); break;
# TODO: Document these functions:
case "round": $res = round($args[0]); break;
case "ceil": $res = ceil($args[0]); break;
case "floor": $res = floor($args[0]); break;
case "max": $res = max($args); break;
case "min": $res = min($args); break;
default: $res = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment