exec("CREATE TABLE IF NOT EXISTS trade_applications ( id INTEGER PRIMARY KEY AUTOINCREMENT, company_name TEXT, contact_name TEXT, email TEXT, phone TEXT, trade_type TEXT, postcode TEXT, discount_code TEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP )"); $trade_success = false; $trade_error = ''; $trade_code = ''; // Handle Trade Registration if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'register_trade') { $company = trim($_POST['company_name'] ?? ''); $contact = trim($_POST['contact_name'] ?? ''); $email = trim($_POST['email'] ?? ''); $phone = trim($_POST['phone'] ?? ''); $trade = trim($_POST['trade_type'] ?? ''); $postcode = trim($_POST['postcode'] ?? ''); if (empty($company) || empty($contact) || empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) { $trade_error = 'Please provide a valid company name, contact name, and email address.'; } else { $trade_code = 'TRADE15'; $stmt = $db->prepare("INSERT INTO trade_applications (company_name, contact_name, email, phone, trade_type, postcode, discount_code) VALUES (:company, :contact, :email, :phone, :trade, :postcode, :code)"); $stmt->bindValue(':company', $company, SQLITE3_TEXT); $stmt->bindValue(':contact', $contact, SQLITE3_TEXT); $stmt->bindValue(':email', $email, SQLITE3_TEXT); $stmt->bindValue(':phone', $phone, SQLITE3_TEXT); $stmt->bindValue(':trade', $trade, SQLITE3_TEXT); $stmt->bindValue(':postcode', $postcode, SQLITE3_TEXT); $stmt->bindValue(':code', $trade_code, SQLITE3_TEXT); $stmt->execute(); $trade_success = true; // Notify Operations Desk $subject = "[NEW TRADE ACCOUNT] $company - 15% AcousticHome Discount Issued"; $msg = "A new trade account application has been submitted:\n\n" . "Company: $company\n" . "Contact: $contact\n" . "Email: $email\n" . "Phone: $phone\n" . "Trade Type: $trade\n" . "Postcode: $postcode\n" . "Assigned Trade Code: $trade_code (15% Off)\n" . "Timestamp: " . date('Y-m-d H:i:s') . " GMT\n"; $headers = "From: support@tradelinkregional.co.uk\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion(); @mail(ADMIN_EMAIL, $subject, $msg, $headers); } } // Handle Stripe Checkout Session Creation if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'buy_item') { $item_type = $_POST['item_type'] ?? 'sample_box'; $qty = max(1, intval($_POST['quantity'] ?? 1)); $promo = strtoupper(trim($_POST['promo_code'] ?? '')); $item_name = 'Luxury Acoustic Slat Wood Swatch Sample Box'; $item_desc = 'Includes 4 Real Wood Swatches (Natural Oak, Smoked Walnut, Charcoal Black, Scandinavian Ash) + £10 Voucher toward full wall purchase.'; $unit_price_pence = 499; // £4.99 if ($item_type === 'oak_panel') { $item_name = 'Natural Oak Acoustic Slat Wall Panel (2400x600x21mm)'; $item_desc = 'Real oak wood veneer slats on 9mm recycled sound-damping acoustic felt. Includes Free UK Mainland Delivery.'; $unit_price_pence = 7999; } elseif ($item_type === 'walnut_panel') { $item_name = 'Smoked Walnut Luxury Acoustic Slat Wall Panel (2400x600x21mm)'; $item_desc = 'Deep smoked American walnut veneer on 9mm acoustic felt. Architectural finish with Free UK Mainland Delivery.'; $unit_price_pence = 8999; } elseif ($item_type === 'black_panel') { $item_name = 'Charcoal Black Contemporary Acoustic Slat Wall Panel (2400x600x21mm)'; $item_desc = 'Stealth matte black wood slats on matching black sound-absorbing felt. Free UK Mainland Delivery.'; $unit_price_pence = 7999; } elseif ($item_type === 'ash_panel') { $item_name = 'Scandinavian Ash Acoustic Slat Wall Panel (2400x600x21mm)'; $item_desc = 'Light Scandinavian blonde ash veneer on 9mm black acoustic felt. Free UK Mainland Delivery.'; $unit_price_pence = 7999; } elseif ($item_type === 'custom_package') { $panels_count = max(1, intval($_POST['panels_count'] ?? 1)); $finish_name = $_POST['finish_name'] ?? 'Natural Oak'; $item_name = "Custom Slat Wall Package: $panels_count x $finish_name Panels (2400x600mm)"; $item_desc = "Complete wall coverage package with acoustic dampening felt and Free UK Mainland Delivery."; $unit_price_pence = intval(floatval($_POST['package_price_gbp'] ?? 79.99) * 100); $qty = 1; } // Apply Trade Discount (15% off) if TRADE15 entered if ($promo === 'TRADE15' || $promo === 'TRADE') { $unit_price_pence = intval(round($unit_price_pence * 0.85)); $item_name .= ' (15% Trade Discount Applied)'; } $post_data = [ 'payment_method_types' => ['card'], 'mode' => 'payment', 'line_items' => [ [ 'price_data' => [ 'currency' => 'gbp', 'unit_amount' => $unit_price_pence, 'product_data' => [ 'name' => $item_name, 'description' => $item_desc, ], ], 'quantity' => $qty, ], ], 'shipping_address_collection' => [ 'allowed_countries' => ['GB'], ], 'billing_address_collection' => 'required', 'success_url' => 'https://tradelinkregional.co.uk/acoustichome.php?status=success&session_id={CHECKOUT_SESSION_ID}', 'cancel_url' => 'https://tradelinkregional.co.uk/acoustichome.php?status=cancelled', ]; function http_build_query_for_curl($data, $prefix = '') { $res = []; foreach ($data as $key => $val) { $k = $prefix ? "{$prefix}[{$key}]" : $key; if (is_array($val)) { $res = array_merge($res, http_build_query_for_curl($val, $k)); } else { $res[$k] = $val; } } return $res; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.stripe.com/v1/checkout/sessions'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(http_build_query_for_curl($post_data))); curl_setopt($ch, CURLOPT_USERPWD, STRIPE_SECRET_KEY . ':'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 20); $response = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $json = json_decode($response, true); if ($http_code === 200 && isset($json['url'])) { header('Location: ' . $json['url']); exit; } else { $stripe_error = 'Stripe Checkout connection error: ' . ($json['error']['message'] ?? 'Unable to initialize payment session.'); } } // Check Success Order $order_completed = false; $order_details = null; if (isset($_GET['status']) && $_GET['status'] === 'success' && !empty($_GET['session_id'])) { $session_id = $_GET['session_id']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.stripe.com/v1/checkout/sessions/' . urlencode($session_id)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, STRIPE_SECRET_KEY . ':'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); $res = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($code === 200) { $order_completed = true; $order_details = json_decode($res, true); // Notify Support $customer_email = $order_details['customer_details']['email'] ?? 'Unknown'; $customer_name = $order_details['customer_details']['name'] ?? 'Valued Customer'; $amount_total = number_format(($order_details['amount_total'] ?? 0) / 100, 2); $subj = "[PAID ORDER] AcousticHome UK - £$amount_total from $customer_name"; $body = "New verified paid order on AcousticHome UK:\n\n" . "Customer: $customer_name ($customer_email)\n" . "Total Paid: £$amount_total GBP\n" . "Stripe Session: $session_id\n" . "Date: " . date('Y-m-d H:i:s') . " GMT\n"; $hdrs = "From: support@tradelinkregional.co.uk\r\nReply-To: $customer_email\r\n"; @mail(ADMIN_EMAIL, $subj, $body, $hdrs); } } ?>
Luxury Slat Wall Panels & Architectural Decor
Thank you for your order. Your dispatch is being processed via Royal Mail Tracked. A confirmation receipt has been dispatched to = htmlspecialchars($order_details['customer_details']['email'] ?? 'your email') ?>.
Your trade registration has been approved. Use trade promo code TRADE15 at checkout for an instant 15% discount on all panel orders.
Transform your living room media wall, home office, bedroom, or commercial hospitality venue. Premium real wood veneer slats mounted onto high-density recycled acoustic felt for effortless DIY installation and instant echo elimination.
Touch and feel all 4 premium finishes at home. Cut directly from actual 21mm production panels.
Enter your wall dimensions below to calculate the exact number of 2400x600mm panels and adhesive tubes you need.
Real oak wood veneer slats on 9mm recycled black acoustic felt. Timeless warm aesthetic.
Deep dark American walnut veneer with sound-damping felt. Premium architectural look.
All-black stealth wood slats with matching black felt. Perfect for cinema rooms & studios.
Includes Oak, Walnut, Charcoal & Ash with acoustic felt swatches. Free UK postage.
For Interior Designers, Joiners, Fit-out Contractors, Property Developers, and Decorators.