Change language fix

This commit is contained in:
Flatlogic Bot 2026-01-09 12:08:32 +00:00
parent f420b145c6
commit 834f5e016d
3 changed files with 102 additions and 4 deletions

View File

@ -45,7 +45,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['status']) && get_user
// Fetch order and client details for email // Fetch order and client details for email
$stmt = $pdo->prepare(" $stmt = $pdo->prepare("
SELECT o.*, c.name as client_company_name, c.language as client_language, u.email as client_email SELECT o.*, c.name as client_company_name, u.email as client_email
FROM orders o FROM orders o
JOIN clients c ON o.client_id = c.id JOIN clients c ON o.client_id = c.id
JOIN users u ON c.id = u.client_id JOIN users u ON c.id = u.client_id
@ -56,7 +56,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['status']) && get_user
if ($order_details_for_email && !empty($order_details_for_email['client_email'])) { if ($order_details_for_email && !empty($order_details_for_email['client_email'])) {
$client_email = $order_details_for_email['client_email']; $client_email = $order_details_for_email['client_email'];
$client_language = $order_details_for_email['client_language'] ?? 'en'; $client_language = 'pl'; // Hardcoded fallback
// 4. Client - Payment Confirmation // 4. Client - Payment Confirmation
MailService::sendTemplatedMail( MailService::sendTemplatedMail(

View File

@ -14766,3 +14766,101 @@ Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84
Found product price. Net: 233.2, Gross: 286.84 Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning 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
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
---

View File

@ -9,6 +9,8 @@ require_once __DIR__ . '/../db/config.php';
require_once __DIR__ . '/helpers.php'; require_once __DIR__ . '/helpers.php';
require_once __DIR__ . '/currency.php'; require_once __DIR__ . '/currency.php';
require_once __DIR__ . '/auth.php';
if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['lang'])) { if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['lang'])) {
$new_lang = $_GET['lang']; $new_lang = $_GET['lang'];
set_lang($new_lang); set_lang($new_lang);
@ -41,8 +43,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['lang'])) {
exit; exit;
} }
require_once __DIR__ . '/auth.php';
// Redirect handlowiec from client area to admin dashboard // Redirect handlowiec from client area to admin dashboard
if (is_logged_in() && get_user_role() === 'handlowiec' && strpos($_SERVER['PHP_SELF'], '/admin/') === false) { if (is_logged_in() && get_user_role() === 'handlowiec' && strpos($_SERVER['PHP_SELF'], '/admin/') === false) {
header('Location: /admin/orders.php'); header('Location: /admin/orders.php');