File manager - Edit - /home/webapp69.cm.in.th/u69319090048/shop69319090048/product.php
Back
<?php // PHP 7.4 compatible Product Configuration Page require_once 'header.php'; $product_id = isset($_GET['id']) ? $_GET['id'] : 'basic'; $product = get_product_by_id($product_id); if (!$product) { echo '<div class="container" style="padding: 80px 0; text-align: center;">'; echo ' <h1 style="font-size: 24px; margin-bottom: 16px;">Product not found.</h1>'; echo ' <a href="index.php" class="btn btn-primary">Return to Collection</a>'; echo '</div>'; require_once 'footer.php'; exit; } ?> <!-- Product Config Header --> <div class="config-header"> <div class="container config-header-container"> <div class="config-header-titles"> <h2><?php echo htmlspecialchars($product['tier']); ?> Tier</h2> <h1>Configure <?php echo htmlspecialchars($product['name']); ?></h1> </div> <div class="price-summary-sticky"> <div class="price-label">Total Price</div> <div class="price-val" id="top-price-display">$<?php echo number_format($product['price'], 2); ?></div> </div> </div> </div> <div class="container"> <!-- Form targeting bag.php with configurations --> <form id="configurator-form" action="bag.php" method="POST" data-base-price="<?php echo $product['price']; ?>"> <input type="hidden" name="action" value="add"> <input type="hidden" name="product_id" value="<?php echo htmlspecialchars($product['id']); ?>"> <div class="config-grid"> <!-- Left Sticky Column - Image --> <div class="config-visual"> <img src="<?php echo htmlspecialchars($product['image_url']); ?>" alt="<?php echo htmlspecialchars($product['name']); ?>"> </div> <!-- Right Column - Configurable Options --> <div class="config-options"> <!-- Description Section --> <div> <h3 class="config-section-title">Description / รายละเอียด</h3> <p style="font-size: 14px; color: var(--text-secondary); margin-bottom: 8px;"> <?php echo htmlspecialchars($product['description']); ?> </p> <p style="font-family: 'Prompt'; font-size: 13px; color: var(--text-secondary);"> <?php echo htmlspecialchars($product['thai_description']); ?> </p> </div> <!-- 1. Size Selection --> <div> <h3 class="config-section-title">Size / ขนาด</h3> <div class="size-grid"> <input type="radio" name="size" id="size-s" value="S" class="option-card-input" checked> <label for="size-s" class="option-card-label">S</label> <input type="radio" name="size" id="size-m" value="M" class="option-card-input"> <label for="size-m" class="option-card-label">M</label> <input type="radio" name="size" id="size-l" value="L" class="option-card-input"> <label for="size-l" class="option-card-label">L</label> <input type="radio" name="size" id="size-xl" value="XL" class="option-card-input"> <label for="size-xl" class="option-card-label">XL</label> <input type="radio" name="size" id="size-xxl" value="XXL" class="option-card-input"> <label for="size-xxl" class="option-card-label">XXL</label> <input type="radio" name="size" id="size-free" value="Free Size" class="option-card-input"> <label for="size-free" class="option-card-label">Free Size</label> </div> </div> <!-- 2. Apple Trade-In Style Discount --> <div> <h3 class="config-section-title">Tee Trade In</h3> <p class="config-section-desc">Trade in an old cotton T-shirt for an immediate credit. Select the wear condition of your trade-in:</p> <div class="tradein-list"> <input type="radio" name="trade_in" id="trade-none" value="No Trade-in" data-discount="0" class="option-card-input" checked> <label for="trade-none" class="tradein-card-label"> <div class="option-card-details"> <span class="option-card-name">No Trade-in</span> <span class="option-card-sub">Keep your existing shirts.</span> </div> <span class="option-card-price">$0.00</span> </label> <input type="radio" name="trade_in" id="trade-recycle" value="Recycle Condition" data-discount="3.00" class="option-card-input"> <label for="trade-recycle" class="tradein-card-label"> <div class="option-card-details"> <span class="option-card-name">Recycle Condition</span> <span class="option-card-sub">Worn out, stained, or torn cotton garments.</span> </div> <span class="option-card-price discount">-$3.00</span> </label> <input type="radio" name="trade_in" id="trade-good" value="Good Condition" data-discount="7.00" class="option-card-input"> <label for="trade-good" class="tradein-card-label"> <div class="option-card-details"> <span class="option-card-name">Good Condition</span> <span class="option-card-sub">Light wear, minor fading, structurally sound.</span> </div> <span class="option-card-price discount">-$7.00</span> </label> <input type="radio" name="trade_in" id="trade-excellent" value="Excellent Condition" data-discount="12.00" class="option-card-input"> <label for="trade-excellent" class="tradein-card-label"> <div class="option-card-details"> <span class="option-card-name">Excellent Condition</span> <span class="option-card-sub">Like new, no fading, stretch, or blemishes.</span> </div> <span class="option-card-price discount">-$12.00</span> </label> </div> </div> <!-- 3. Extended Warranty Option --> <div> <h3 class="config-section-title">Tee Care+</h3> <p class="config-section-desc">Protect your shirt against stitching failures, neck stretching, or accidental fabric tears:</p> <div class="warranty-list"> <input type="radio" name="warranty" id="warranty-none" value="No Tee Care+" data-price="0" class="option-card-input" checked> <label for="warranty-none" class="warranty-card-label"> <div class="option-card-details"> <span class="option-card-name">No Tee Care+</span> <span class="option-card-sub">Standard 14-day return period.</span> </div> <span class="option-card-price">$0.00</span> </label> <input type="radio" name="warranty" id="warranty-1year" value="1-Year Tee Care+" data-price="9.00" class="option-card-input"> <label for="warranty-1year" class="warranty-card-label"> <div class="option-card-details"> <span class="option-card-name">1-Year Tee Care+</span> <span class="option-card-sub">Covers shape-retention issues and stitching damage.</span> </div> <span class="option-card-price">+$9.00</span> </label> <input type="radio" name="warranty" id="warranty-2year" value="2-Year Tee Care+" data-price="19.00" class="option-card-input"> <label for="warranty-2year" class="warranty-card-label"> <div class="option-card-details"> <span class="option-card-name">2-Year Tee Care+</span> <span class="option-card-sub">Full coverage, includes 1 free accidental tear replacement.</span> </div> <span class="option-card-price">+$19.00</span> </label> </div> </div> <!-- Specs List --> <div> <h3 class="config-section-title">Material Specs / ข้อมูลวัสดุ</h3> <ul class="specs-list"> <?php for($i = 0; $i < count($product['specs']); $i++): ?> <li> <span><?php echo htmlspecialchars($product['specs'][$i]); ?></span> <div style="font-family: 'Prompt'; font-size: 11px; color: var(--text-secondary);"> <?php echo htmlspecialchars($product['thai_specs'][$i]); ?> </div> </li> <?php endfor; ?> </ul> </div> </div> </div> <!-- Sticky Bottom Bar --> <div class="sticky-bottom-bar"> <div class="container sticky-bottom-container"> <div class="sticky-bottom-info"> <span class="title"><?php echo htmlspecialchars($product['name']); ?></span> <span class="summary" id="options-summary">Size M</span> </div> <div class="sticky-bottom-actions"> <div class="sticky-bottom-price" id="bottom-price-display">$<?php echo number_format($product['price'], 2); ?></div> <button type="submit" class="btn btn-primary" style="padding: 12px 24px;">Add to Bag</button> </div> </div> </div> </form> </div> <?php require_once 'footer.php'; ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings