diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..d8dff1d --- /dev/null +++ b/contact.php @@ -0,0 +1,169 @@ + 'Home', 'url' => 'https://tomsjavajive.com'], + ['name' => 'Contact', 'url' => 'https://tomsjavajive.com/contact.php'] +]; +require_once __DIR__ . '/includes/functions.php'; + +$sent = false; +$errors = []; + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $name = trim($_POST['name'] ?? ''); + $email = trim($_POST['email'] ?? ''); + $subject = trim($_POST['subject'] ?? ''); + $message = trim($_POST['message'] ?? ''); + + if (empty($name)) $errors['name'] = 'Name is required.'; + if (empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) + $errors['email'] = 'A valid email address is required.'; + if (empty($subject)) $errors['subject'] = 'Please choose a subject.'; + if (empty($message)) $errors['message'] = 'Message cannot be empty.'; + + if (empty($errors)) { + $body = "Name: {$name}\nEmail: {$email}\nSubject: {$subject}\n\n{$message}"; + cybermailSend('hello@tomsjavajive.com', "Contact Form: {$subject}", $body, $name, $email); + $sent = true; + } +} + +require_once __DIR__ . '/includes/header.php'; +?> + + + + + + Contact Us + Questions about your order or just want to talk coffee? We'd love to hear from you. + + + + + + + + + Get in Touch + + + + + + + Email + hello@tomsjavajive.com + We reply within 1 business day + + + + + + + + + Phone + (817) 555-0120 + Mon–Fri, 9am–5pm CT + + + + + + + + + Location + Weatherford, TX 76086 + United States + + + + + + + + Quick Links + + Track Your Order + Returns & Refunds + Shipping Info + FAQ + + + + + + + + + + + ☕ + Message Sent! + Thanks for reaching out. We'll get back to you within one business day. + Browse Our Coffee + + + Send a Message + + + + Your Name * + + + = $errors['name'] ?> + + + + Email Address * + + + = $errors['email'] ?> + + + + + + Subject * + + — Select a subject — + >Order Question + >Shipping & Delivery + >Returns & Refunds + >Product Question + >Wholesale Inquiry + >Other + + + = $errors['subject'] ?> + + + + + Message * + = htmlspecialchars($_POST['message'] ?? '') ?> + + = $errors['message'] ?> + + + + + Send Message + + + + + + + + + + + diff --git a/merchant-feed.php b/merchant-feed.php index 9081f2c..dc95fba 100644 --- a/merchant-feed.php +++ b/merchant-feed.php @@ -31,12 +31,22 @@ foreach ($products as $p) { $imageUrl = !empty($images) ? $base . $images[0] : $base . '/assets/images/placeholder-product.svg'; $categoryLabel = $p['category'] === 'Bean' ? 'Whole Bean' : 'Ground'; + $grindNote = $p['category'] === 'Bean' + ? 'Available as whole bean so you can grind fresh for maximum flavor.' + : 'Pre-ground to a versatile medium grind, ready to brew right out of the bag.'; $title = htmlspecialchars($p['name'] . ' ' . $categoryLabel . ' Coffee'); - $desc = htmlspecialchars( - $p['name'] . ' flavored artisan coffee — ' . strtolower($categoryLabel) . '. ' . - 'All natural flavoring. ' . - '12 oz bag.' - ); + $rawDesc = $p['description'] ?? ''; + if (!empty($rawDesc)) { + $desc = htmlspecialchars( + strip_tags($rawDesc) . ' ' . $grindNote . ' 12 oz bag. Ships from Weatherford, TX.' + ); + } else { + $desc = htmlspecialchars( + "Tom's Java Jive {$p['name']} flavored artisan coffee, freshly roasted in small batches in Weatherford, Texas. " . + "All-natural flavoring with no artificial additives. {$grindNote} " . + "12 oz bag. Free shipping on orders over \$50." + ); + } $link = htmlspecialchars($base . '/product.php?id=' . $p['product_id']); $imageLink = htmlspecialchars($imageUrl); $price = number_format((float)($p['sale_price'] ?? $p['price']), 2, '.', ''); @@ -66,11 +76,17 @@ foreach ($products as $p) { echo " {$gCategory}\n"; echo " Coffee > Flavored Coffee > {$categoryLabel}\n"; echo " false\n"; + echo " {$categoryLabel}\n"; echo " \n"; echo " US\n"; echo " Standard\n"; echo " 5.99 USD\n"; + echo " 1\n"; + echo " 2\n"; + echo " 3\n"; + echo " 7\n"; echo " \n"; + echo " default\n"; echo " \n"; } diff --git a/product.php b/product.php index 0795e9d..5f3b72f 100644 --- a/product.php +++ b/product.php @@ -69,12 +69,32 @@ $productSchemaData = [ 'description' => $metaDescription, 'brand' => ['@type' => 'Brand', 'name' => "Tom's Java Jive"], 'offers' => [ - '@type' => 'Offer', - 'priceCurrency' => 'USD', - 'price' => number_format((float) $displayPrice, 2, '.', ''), - 'availability' => $inStock ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock', - 'url' => $canonicalUrl, - 'seller' => ['@type' => 'Organization', 'name' => "Tom's Java Jive"], + '@type' => 'Offer', + 'priceCurrency' => 'USD', + 'price' => number_format((float) $displayPrice, 2, '.', ''), + 'priceValidUntil' => date('Y-12-31', strtotime('+1 year')), + 'availability' => $inStock ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock', + 'url' => $canonicalUrl, + 'seller' => ['@type' => 'Organization', 'name' => "Tom's Java Jive"], + 'shippingDetails' => [ + '@type' => 'OfferShippingDetails', + 'shippingRate' => ['@type' => 'MonetaryAmount', 'value' => '5.99', 'currency' => 'USD'], + 'shippingDestination'=> ['@type' => 'DefinedRegion', 'addressCountry' => 'US'], + 'deliveryTime' => [ + '@type' => 'ShippingDeliveryTime', + 'handlingTime' => ['@type' => 'QuantitativeValue', 'minValue' => 1, 'maxValue' => 2, 'unitCode' => 'DAY'], + 'transitTime' => ['@type' => 'QuantitativeValue', 'minValue' => 3, 'maxValue' => 7, 'unitCode' => 'DAY'], + ], + ], + 'hasMerchantReturnPolicy' => [ + '@type' => 'MerchantReturnPolicy', + 'applicableCountry' => 'US', + 'returnPolicyCategory' => 'https://schema.org/MerchantReturnFiniteReturnWindow', + 'merchantReturnDays' => 30, + 'returnMethod' => 'https://schema.org/ReturnByMail', + 'returnFees' => 'https://schema.org/FreeReturn', + 'returnPolicyLink' => 'https://tomsjavajive.com/returns.php', + ], ], ]; if ($reviewCount > 0) {
Questions about your order or just want to talk coffee? We'd love to hear from you.
Thanks for reaching out. We'll get back to you within one business day.