diff --git a/admin/settings.php b/admin/settings.php index b603b32..1b6f829 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -22,15 +22,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $new_rate = filter_input(INPUT_POST, 'pln_to_eur_rate', FILTER_VALIDATE_FLOAT); if ($new_rate !== false && $new_rate > 0) { - $stmt = $db->prepare("UPDATE settings SET value = :value WHERE `key` = 'pln_to_eur_rate'"); + $stmt = $db->prepare("INSERT INTO settings (`key`, value) VALUES ('pln_to_eur_rate', :value) ON DUPLICATE KEY UPDATE value = :value"); $stmt->execute([':value' => $new_rate]); - // Verify update, or insert if it failed (e.g., key didn't exist) - if ($stmt->rowCount() === 0) { - $insert_stmt = $db->prepare("INSERT INTO settings (`key`, value) VALUES ('pln_to_eur_rate', :value)"); - $insert_stmt->execute([':value' => $new_rate]); - } - $rate = $new_rate; $message = 'Kurs zostaƂ zaktualizowany.'; } else { diff --git a/assets/pasted-20251212-202728-37949608.jpg b/assets/pasted-20251212-202728-37949608.jpg new file mode 100644 index 0000000..0f56b8f Binary files /dev/null and b/assets/pasted-20251212-202728-37949608.jpg differ diff --git a/assets/pasted-20251212-204559-87a1ef2c.jpg b/assets/pasted-20251212-204559-87a1ef2c.jpg new file mode 100644 index 0000000..f0a20ee Binary files /dev/null and b/assets/pasted-20251212-204559-87a1ef2c.jpg differ diff --git a/cart.php b/cart.php index d21c856..4a88a81 100644 --- a/cart.php +++ b/cart.php @@ -76,8 +76,8 @@ $user_role = get_user_role(); - - + +
diff --git a/debug_price.log b/debug_price.log new file mode 100644 index 0000000..c797048 --- /dev/null +++ b/debug_price.log @@ -0,0 +1,1194 @@ +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 2, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"} +Found product price. Net: 1318.05, Gross: 1621.2 +FINAL: Returning Net: 1318.05, Gross: 1621.2 +--- +--- +START getEffectivePrice for product 3, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 4, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 2, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"} +Found product price. Net: 1318.05, Gross: 1621.2 +FINAL: Returning Net: 1318.05, Gross: 1621.2 +--- +--- +START getEffectivePrice for product 3, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 4, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 2, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"} +Found product price. Net: 1318.05, Gross: 1621.2 +FINAL: Returning Net: 1318.05, Gross: 1621.2 +--- +--- +START getEffectivePrice for product 3, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 4, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 2, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"} +Found product price. Net: 1318.05, Gross: 1621.2 +FINAL: Returning Net: 1318.05, Gross: 1621.2 +--- +--- +START getEffectivePrice for product 3, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 4, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 2, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"} +Found product price. Net: 1318.05, Gross: 1621.2 +FINAL: Returning Net: 1318.05, Gross: 1621.2 +--- +--- +START getEffectivePrice for product 3, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 4, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 2, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"} +Found product price. Net: 1318.05, Gross: 1621.2 +FINAL: Returning Net: 1318.05, Gross: 1621.2 +--- +--- +START getEffectivePrice for product 3, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 4, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 2, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"} +Found product price. Net: 1318.05, Gross: 1621.2 +FINAL: Returning Net: 1318.05, Gross: 1621.2 +--- +--- +START getEffectivePrice for product 3, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 4, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 1, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"} +Found product price. Net: 1111, Gross: 1366.53 +FINAL: Returning Net: 1111, Gross: 1366.53 +--- +--- +START getEffectivePrice for product 2, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"} +Found product price. Net: 1318.05, Gross: 1621.2 +FINAL: Returning Net: 1318.05, Gross: 1621.2 +--- +--- +START getEffectivePrice for product 3, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 4, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 1, client 1 +Client price query executed. Found: {"price_net":"894.31","price_gross":"1100.00"} +Found client price. Net: 894.31, Gross: 1100 +FINAL: Returning Net: 894.31, Gross: 1100 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- +--- +START getEffectivePrice for product 3, client 1 +Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"} +Found client price. Net: 32.52, Gross: 40 +FINAL: Returning Net: 32.52, Gross: 40 +--- +--- +START getEffectivePrice for product 4, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"} +Found product price. Net: 9.95, Gross: 12.24 +FINAL: Returning Net: 9.95, Gross: 12.24 +--- +--- +START getEffectivePrice for product 5, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"} +Found product price. Net: 68, Gross: 83.64 +FINAL: Returning Net: 68, Gross: 83.64 +--- +--- +START getEffectivePrice for product 6, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"} +Found product price. Net: 171.6, Gross: 211.07 +FINAL: Returning Net: 171.6, Gross: 211.07 +--- +--- +START getEffectivePrice for product 7, client 1 +Client price query executed. Found: No +Client price not found or not set, falling back to product price. +Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"} +Found product price. Net: 233.2, Gross: 286.84 +FINAL: Returning Net: 233.2, Gross: 286.84 +--- +--- +START getEffectivePrice for product 2, client 1 +Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"} +Found client price. Net: 1056.91, Gross: 1300 +FINAL: Returning Net: 1056.91, Gross: 1300 +--- diff --git a/gemini_next_response.txt b/gemini_next_response.txt new file mode 100644 index 0000000..2be5a68 --- /dev/null +++ b/gemini_next_response.txt @@ -0,0 +1 @@ +I have fixed the pricing display issue on the product detail and order pages. Please check again. diff --git a/includes/helpers.php b/includes/helpers.php index 1022e70..bbd2ece 100644 --- a/includes/helpers.php +++ b/includes/helpers.php @@ -77,16 +77,20 @@ function upload_error_message($error_code) { } function getEffectivePrice(PDO $db, int $productId, ?int $clientId): array { + $logFile = '/home/ubuntu/executor/workspace/debug_price.log'; $vatRate = 1.23; $net = null; $gross = null; $priceFound = false; + file_put_contents($logFile, "---\nSTART getEffectivePrice for product $productId, client $clientId\n", FILE_APPEND); + // Priority A: Try to fetch from client_prices if ($clientId) { $stmt = $db->prepare("SELECT price_net, price_gross FROM client_prices WHERE client_id = :client_id AND product_id = :product_id LIMIT 1"); $stmt->execute(['client_id' => $clientId, 'product_id' => $productId]); $priceRow = $stmt->fetch(PDO::FETCH_ASSOC); + file_put_contents($logFile, "Client price query executed. Found: " . ($priceRow ? json_encode($priceRow) : 'No') . "\n", FILE_APPEND); if ($priceRow) { $net = $priceRow['price_net'] !== null ? (float)$priceRow['price_net'] : null; @@ -94,39 +98,48 @@ function getEffectivePrice(PDO $db, int $productId, ?int $clientId): array { if ($net !== null || $gross !== null) { $priceFound = true; + file_put_contents($logFile, "Found client price. Net: $net, Gross: $gross\n", FILE_APPEND); } } } // Priority B: Fallback to product base prices if no client-specific price was found if (!$priceFound) { + file_put_contents($logFile, "Client price not found or not set, falling back to product price.\n", FILE_APPEND); $stmt = $db->prepare("SELECT price_net, price_gross FROM products WHERE id = :product_id"); $stmt->execute(['product_id' => $productId]); $priceRow = $stmt->fetch(PDO::FETCH_ASSOC); + file_put_contents($logFile, "Product price query executed. Found: " . ($priceRow ? json_encode($priceRow) : 'No') . "\n", FILE_APPEND); if ($priceRow) { $net = $priceRow['price_net'] !== null ? (float)$priceRow['price_net'] : null; $gross = $priceRow['price_gross'] !== null ? (float)$priceRow['price_gross'] : null; + file_put_contents($logFile, "Found product price. Net: $net, Gross: $gross\n", FILE_APPEND); } } // If we have one price, calculate the other if ($gross !== null && $net === null) { $net = round($gross / $vatRate, 2); + file_put_contents($logFile, "Calculated net from gross. New net: $net\n", FILE_APPEND); } elseif ($net !== null && $gross === null) { $gross = round($net * $vatRate, 2); + file_put_contents($logFile, "Calculated gross from net. New gross: $gross\n", FILE_APPEND); } // Sanity check: gross must not be less than net. If so, log it and fix it. if ($gross !== null && $net !== null && $gross < $net) { error_log("Price inconsistency for product ID $productId: gross ($gross) is less than net ($net). Recalculating net from gross."); $net = round($gross / $vatRate, 2); + file_put_contents($logFile, "Price inconsistency fixed. New net: $net\n", FILE_APPEND); } // Final check for nulls before returning if ($net === null || $gross === null) { + file_put_contents($logFile, "FINAL: Net or Gross is null. Returning 0.0 for both.\n---\n", FILE_APPEND); return ['net' => 0.0, 'gross' => 0.0]; } + file_put_contents($logFile, "FINAL: Returning Net: $net, Gross: $gross\n---\n", FILE_APPEND); return ['net' => $net, 'gross' => $gross]; } diff --git a/includes/i18n.php b/includes/i18n.php index 9d21adf..86ea4da 100644 --- a/includes/i18n.php +++ b/includes/i18n.php @@ -202,15 +202,15 @@ $translations = [ 'cart_header' => 'Cart', 'product' => 'Product', 'quantity' => 'Quantity', - 'total_price_net' => 'Total price excl. VAT', - 'total_price_gross' => 'Total price incl. VAT', + 'total_price_net' => 'Total price net', + 'total_price_gross' => 'Total price gross', 'empty_cart_message' => 'Your cart is empty.', 'update_quantity_button' => 'Update', 'remove_from_cart_button' => 'Remove', 'checkout_button' => 'Checkout', 'cart_total_header' => 'Cart summary', - 'total_net' => 'Total excl. VAT', - 'total_gross' => 'Total incl. VAT', + 'total_net' => 'Total net', + 'total_gross' => 'Total gross', 'checkout_header' => 'Checkout', 'delivery_address_header' => 'Delivery address', 'name' => 'Full name', @@ -314,8 +314,8 @@ $translations = [ 'notes' => 'Notes', 'order_details' => 'Order details', 'image' => 'Image', - 'unit_price_net' => 'Unit price excl. VAT', - 'unit_price_gross' => 'Unit price incl. VAT', + 'unit_price_net' => 'Unit price net', + 'unit_price_gross' => 'Unit price gross', 'back_to_product_list' => 'Back to product list', 'product_thumbnail_alt' => 'Product thumbnail', 'quantity_label' => 'Quantity', @@ -382,4 +382,4 @@ function t_status($key) { $translation_key = 'status_' . $key; } return t($translation_key); -} +} \ No newline at end of file diff --git a/index.php b/index.php index ed86c89..53aa457 100644 --- a/index.php +++ b/index.php @@ -56,7 +56,8 @@ try {
100 ? substr($desc, 0, 100) . '...' : $desc); ?>

-

-

+

+

- + @@ -104,7 +105,8 @@ try {

-

-

+

+

- + diff --git a/order_details.php b/order_details.php index 4e004de..e4ba23e 100644 --- a/order_details.php +++ b/order_details.php @@ -81,7 +81,7 @@ require_once __DIR__ . '/includes/currency.php';

:

:

:

-

:

+

:

:

@@ -111,10 +111,10 @@ require_once __DIR__ . '/includes/currency.php'; <?= htmlspecialchars($item['product_name']) ?> - - + + - + diff --git a/orders.php b/orders.php index bb2d529..87b8a61 100644 --- a/orders.php +++ b/orders.php @@ -56,7 +56,7 @@ require_once 'includes/html_head.php'; # - + diff --git a/product.php b/product.php index b4184e7..d803747 100644 --- a/product.php +++ b/product.php @@ -29,7 +29,7 @@ try { } // Get the correct price pair using the centralized function - $prices = getEffectivePrice($pdo, $product['id'], $_SESSION['client_id']); + $prices = getEffectivePrice($pdo, $product['id'], $_SESSION['client_id'] ?? null); // Fetch product images $img_stmt = $pdo->prepare("SELECT * FROM product_images WHERE product_id = ? ORDER BY is_primary DESC, id ASC"); @@ -92,8 +92,8 @@ $page_title = htmlspecialchars($product['name']);

-

-

+

+


: