This store sells age-restricted products. Confirm your age to continue.
How to install on your store
1Back up your theme (Online Store > Themes > Actions > Duplicate) before changing any code.
2Open Online Store > Themes > Edit code and create a new file under Snippets named age-verify.liquid.
3Paste the complete file - markup, styles and JavaScript are already inside the single file, nothing else to install.
4Call the snippet from the template or section where it should appear using the render tag shown in the Usage tab.
5Preview the product, collection or cart page and test on mobile before publishing.
6Render once in layout/theme.liquid before </body> - the gate covers the whole storefront until confirmed.
7The visitor's choice is remembered for the session; it asks again on a new visit.
age-verify.liquid
1<gpl-ageclass="gpl-age" hidden>2<divclass="gpl-age__box"role="dialog"aria-modal="true"aria-label="Age verification">3<h2class="gpl-age__title">{{heading| default: 'Are you of legal age?'}}</h2>4<pclass="gpl-age__text">{{text| default: 'Confirm your age to continue.'}}</p>5<divclass="gpl-age__row">6<buttontype="button"class="gpl-age__yes">{{confirm| default: 'Yes, I am'}}</button>7<aclass="gpl-age__no"href="https://www.google.com">No, leave</a>8</div>9</div>10</gpl-age>