From 42e69c0aabcfcc8891e55db7b43456314a3e41d1 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Sun, 26 May 2013 18:32:45 +0100 Subject: [PATCH] Fix discount and parenthesis Now parse line return the *raw* discount (instead of /100). Meaning its treated exactly as the other. Before formula where converted to integer (/100) before being expanded or evaluated. --- includes/textcart_manager.inc | 7 +++++-- test/textcartManager/parseTest.php | 4 ++-- test/textcartManager/processTest.php | 9 +++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/includes/textcart_manager.inc b/includes/textcart_manager.inc index c0f1bfb..45acd24 100644 --- a/includes/textcart_manager.inc +++ b/includes/textcart_manager.inc @@ -223,6 +223,9 @@ class TextCartManager { } + // convert the percentage to float. + if($discount) $discount /= 100; + #echo "Stock Code : $stock_code