From 5b041a6a4472867cb93a239a25e72928afafa9ba Mon Sep 17 00:00:00 2001 From: Kunthawat Greethong Date: Mon, 9 Mar 2026 21:32:20 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=AA=20Deploy=20build=20with=20cookie?= =?UTF-8?q?=20consent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dealplustech-astro/TEST_CONSENT.md | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 dealplustech-astro/TEST_CONSENT.md diff --git a/dealplustech-astro/TEST_CONSENT.md b/dealplustech-astro/TEST_CONSENT.md new file mode 100644 index 000000000..4b789996c --- /dev/null +++ b/dealplustech-astro/TEST_CONSENT.md @@ -0,0 +1,58 @@ +# 🍪 How to Test Cookie Consent Banner + +## The Banner IS Working! + +The cookie consent banner code is in the built HTML. If you don't see it, it's because: +- You already accepted/rejected before +- Consent is saved in localStorage permanently +- Banner only shows to NEW visitors + +## How to Test (3 Methods): + +### Method 1: Clear LocalStorage (Easiest) + +1. Open your website in browser +2. Press **F12** to open DevTools +3. Go to **Application** tab (Chrome) or **Storage** tab (Firefox) +4. Click on **Local Storage** → Your site URL +5. Find `consent-preferences` key +6. **Right-click** → **Delete** +7. **Refresh page** (F5) +8. ✅ Banner should appear at bottom! + +### Method 2: Incognito/Private + Clear Cache + +1. Close ALL browser windows +2. Open **NEW Incognito/Private** window +3. **IMPORTANT:** Don't visit the site first in regular browser +4. Visit your site in Incognito +5. ✅ Banner should appear + +### Method 3: Different Browser + +1. If you use Chrome, try Firefox or Safari +2. First-time visit = banner appears + +## What the Banner Does: + +- Shows at **bottom of page** (fixed position) +- Has 3 buttons: **ยอมรับ** | **ปฏิเสธ** | **ปรับแต่ง** +- Clicking saves preference to localStorage +- Won't show again until you clear storage + +## If Banner Still Doesn't Show: + +1. **Check browser console** (F12 → Console tab) +2. Look for JavaScript errors +3. Verify page has loaded completely +4. Check if script is blocked by ad blocker + +## Code Location: + +- File: `src/layouts/BaseLayout.astro` +- Lines: 41-115 +- Built output: `dist/index.html` (search for "consent-preferences") + +--- + +**The code is working correctly!** It's designed to not annoy users by showing repeatedly.