Hello!
Our site is built on the Motion 2.0 theme. Included in this theme is an Age Verification Popup option.
We would like to enable this popup, but only on one specific product page — not sitewide. Could someone please help me edit the .liquid code for the Age Verification Popup to restrict it to that one page? The default code is below in bold.
Thank you!
<age-verification-popup
id=“AgeVerificationPopup-{{ section.id }}”
class="
**age-verification-popup modal modal--square modal--mobile-friendly**
{% if section.settings.image != blank %}
**age-verification-popup--image-true**
{% else %}
**age-verification-popup--image-false**
{% endif %}
"
data-test-mode=“{{ section.settings.enable_test_mode }}”
data-section-id=“{{ section.id }}”
>
{% if section.settings.image != blank %}
{% comment %} Full width image so don’t need to adjust sizes attribute, fallback is 100vw {% endcomment %}
{%- render ‘image-element’,
img: section.settings.image,
img_width: 2400,
classes: ‘age-verification-popup__background-image’,
**-%}**
{% style %}
.age-verification-popup__background-image {
{% if section.settings.blur_image %}
filter: blur(4px);
transform: scale(1.03);
{% endif %}
**}**
{% endstyle %}
{% endif %}
<div
class="
**modal__centered-content modal__centered-content--padded**
**"**
>
<div
class=“age-verification-popup__content age-verification-popup__content–active”
data-age-verification-popup-content
>
{% if section.settings.heading != blank %}
{{ section.settings.heading }}
{% endif %}
{% if section.settings.text != blank %}
{% endif %}
{% if section.settings.decline_button_label != blank and section.settings.approve_button_label != blank %}
{% endif %}
{% if section.settings.decline_button_label != blank %}
<button
class=“btn {% if section.settings.approve_button_label != blank %}btn–no-animate{% endif %}”
data-age-verification-popup-decline-button
>
{{ section.settings.decline_button_label }}
{% endif %}
{% if section.settings.approve_button_label != blank %}
<button
class=“btn btn–no-animate”
data-age-verification-popup-exit-button
>
{{ section.settings.approve_button_label }}
{% endif %}
{% if section.settings.decline_button_label != blank and section.settings.approve_button_label != blank %}
{% endif %}
<div
class=“age-verification-popup__decline-content age-verification-popup__decline-content–inactive”
data-age-verification-popup-decline-content
>
{% if section.settings.decline_heading != blank %}
{{ section.settings.decline_heading }}
{% endif %}
{% if section.settings.decline_text != blank %}
{% endif %}
{% if section.settings.return_button_label != blank %}
<button
class=“btn”
data-age-verification-popup-return-button
>
{{ section.settings.return_button_label }}
{% endif %}
**
**
{% schema %}
{
“name”: “t:sections.age-verification-popup.name”,
“settings”: [
**{**
“type”: “checkbox”,
“id”: “enable_test_mode”,
“label”: “t:sections.age-verification-popup.settings.enable_test_mode.label”,
“info”: “t:sections.age-verification-popup.settings.enable_test_mode.info”,
“default”: false
**},**
**{**
“type”: “header”,
“content”: “t:sections.age-verification-popup.settings.header_background_image”
**},**
**{**
“type”: “image_picker”,
“id”: “image”,
“label”: “t:sections.age-verification-popup.settings.image.label”,
“info”: “t:sections.age-verification-popup.settings.image.info”
**},**
**{**
“type”: “checkbox”,
“id”: “blur_image”,
“label”: “t:sections.age-verification-popup.settings.blur_image.label”,
“default”: false
**},**
**{**
“type”: “header”,
“content”: “t:sections.age-verification-popup.settings.header_age_verification_question”
**},**
**{**
“type”: “text”,
“id”: “heading”,
“label”: “t:sections.age-verification-popup.settings.heading.label”,
“default”: “Confirm your age”
**},**
**{**
“type”: “richtext”,
“id”: “text”,
“label”: “t:sections.age-verification-popup.settings.text.label”,
“default”: “
Are you 18 years old or older?
” **},**
**{**
“type”: “text”,
“id”: “decline_button_label”,
“label”: “t:sections.age-verification-popup.settings.decline_button_label.label”,
“default”: “No I’m not”
**},**
**{**
“type”: “text”,
“id”: “approve_button_label”,
“label”: “t:sections.age-verification-popup.settings.approve_button_label.label”,
“default”: “Yes I am”
**},**
**{**
“type”: “header”,
“content”: “t:sections.age-verification-popup.settings.header_declined”
**},**
**{**
“type”: “paragraph”,
“content”: “t:sections.age-verification-popup.settings.content”
**},**
**{**
“type”: “text”,
“id”: “decline_heading”,
“label”: “t:sections.age-verification-popup.settings.decline_heading.label”,
“default”: “Come back when you’re older”
**},**
**{**
“type”: “richtext”,
“id”: “decline_text”,
“label”: “t:sections.age-verification-popup.settings.decline_text.label”,
“default”: “
Sorry, the content of this store can’t be seen by a younger audience. Come back when you’re older.
” **},**
**{**
“type”: “text”,
“id”: “return_button_label”,
“label”: “t:sections.age-verification-popup.settings.return_button_label.label”,
“default”: “Oops, I entered incorrectly”
**}**
**\]**
}
{% endschema %}
