Why isn't my password protection message displaying on my online store?

Solved

Why isn't my password protection message displaying on my online store?

omgbeauty
Tourist
7 0 2

I need to restrict access to my store for a few days, so have enabled password protection, however, the message I have placed in the "message to your visitors" box isn't showing, only a message that says "coming soon".

 

Is there something more I should be doing to have the message show, or is this a bug?

Accepted Solution (1)
Sheesh_b
Shopify Partner
523 116 120

This is an accepted solution.

Hi @omgbeauty 

Glad that it helps.

If you wanted to format it in a better way just put <br> after last word of line which after you want a line break.

 

Also, kindly mark as accepted answer to help other members as an accepted answer.

 

Thanks

Sheesh B

We're here to simplify website creation for those looking to establish a strong online presence. Book a meeting slot if you want to discuss. It's FREE. BOOK NOW | Try Shopify for $1 for 3 Months: Shopify Trial | Shopify Web Store Developer |
LIKE or mark as ACCEPTED SOLUTION

View solution in original post

Replies 10 (10)

Sheesh_b
Shopify Partner
523 116 120

Hi @omgbeauty 

If you're on any Shopify plan then the message would appear and if you're still trying building your store, it'll show coming soon.
However, old themes have password.liquid files and Shopify allowed to place the custom text but now Shopify deprecated the password.liquid file.

Please let us know your store's theme name and website url to check further.

 

Thanks

Sheesh B

We're here to simplify website creation for those looking to establish a strong online presence. Book a meeting slot if you want to discuss. It's FREE. BOOK NOW | Try Shopify for $1 for 3 Months: Shopify Trial | Shopify Web Store Developer |
LIKE or mark as ACCEPTED SOLUTION
omgbeauty
Tourist
7 0 2

Hi Sheesh_b, thanks so much for your reply.  I am on a paid plan using Testament theme.  Website url is www.omgbeauty.co.nz

Sheesh_b
Shopify Partner
523 116 120

Hi @omgbeauty 

You can go to edit code and the under Sections find password.liquid.

You can see some options there to change the text.

Sheesh_b_0-1686768251200.png

 

Let us know if that helps.

 

Thanks

Sheesh B

We're here to simplify website creation for those looking to establish a strong online presence. Book a meeting slot if you want to discuss. It's FREE. BOOK NOW | Try Shopify for $1 for 3 Months: Shopify Trial | Shopify Web Store Developer |
LIKE or mark as ACCEPTED SOLUTION
omgbeauty
Tourist
7 0 2

Hi Sheesh,

This is all I have displayed in the edit code area

{% section 'password-template' %}

 

and when I change it to 

{% section 'shopify-section-password-template' %} 

There is an error that appears.  Can you please advise what I need to change it to.

Sheesh_b
Shopify Partner
523 116 120

Hi @omgbeauty 

Let's make it simple.

When you see this code

{% section 'password-template' %}

It means a file is inserted here from a Sections folder

Sheesh_b_0-1686810012100.png

Now, when you see files in Sections folder, look for "password-template.liquid"

and share the code so that I can provide you changes where you needed to add your custom message.

 

Thanks

Sheesh B

 

We're here to simplify website creation for those looking to establish a strong online presence. Book a meeting slot if you want to discuss. It's FREE. BOOK NOW | Try Shopify for $1 for 3 Months: Shopify Trial | Shopify Web Store Developer |
LIKE or mark as ACCEPTED SOLUTION
omgbeauty
Tourist
7 0 2

Hi Sheesh,

I can't thank you enough for your help with this.  This is all the code I see when going to the "password-template.liquid", all 326 lines

 

{% layout none %}
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
<title>
{{ page_title }}
</title>
{% if page_description %}
{%- comment %}<locksmith:2662>{% endcomment -%}
{%- capture var %}{% render 'locksmith-variables', variable: 'transparent', hiding_scope: 'resource' %}{% endcapture %}{% if var == 'true' %}<meta name="description" content="{{ page_description }}" />{% endif -%}
{%- comment %}original: <meta name="description" content="{{ page_description }}" />{%- endcomment %}
{%- comment %}</locksmith:2662>{% endcomment -%}
{% endif %}
{{ 'stylesheet.css' | asset_url | stylesheet_tag }}
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
{{ content_for_header }}
</head>
<body class="password gridlock {{ template }}" data-section-id="{{ section.id }}">

<div class="slideout">
<div class="closeslide slideout-toggle">
<i class="fa fa-times" aria-hidden="true"></i>
</div>
<div>
{% form 'storefront_password' %}
{{ form.errors | default_errors }}
<label for="password">{{ 'password.general.enter_store' | t }}</label>
<input type="password" name="password" placeholder="{{ 'password.general.password' | t }}">
<input type="submit" value="{{ 'password.general.enter' | t }}">
{% endform %}
</div>
</div>

<div class="slideout-toggle open_password">
<i class="fa fa-lock" aria-hidden="true"></i>
{{ 'password.general.enter_store' | t }}
</div>

{% if section.settings.background_image %}
<div class="password-page lazyload lazyfade"
data-bgset="{% include 'bgset', image: section.settings.background_image %}"
data-sizes="auto">
{% else %}
<div class="password-page">
{% endif %}
<div id="logo">
{% if section.settings.logo != blank %}
<a href="{{ routes.root_url }}">
<img src="{{ section.settings.logo | img_url: '600x' }}" alt="{{ section.settings.logo.alt | default: shop.name }}" itemprop="logo">
</a>
{% else %}
<a href="{{ routes.root_url }}">{{ shop.name }}</a>
{% endif %}
</div>

<div id="signup-holder">
<div id="signup-wrap">
{% unless section.settings.newsletter_details == blank %}
<div id="newsletter-details">
{{ section.settings.newsletter_details }}
</div>
{% endunless %}
<div id="password-signup">
{% form 'customer' %}
{{ form.errors | default_errors }}
{% if form.posted_successfully? %}
<p class="success">{{ 'password.general.thanks' | t }}</p>
{% else %}
<input type="hidden" name="contact[tags]" value="prospect, password page">
<input type="email" name="contact[email]" id="password-email" placeholder="{{ 'password.general.email_address' | t }}">
<input type="submit" id="password-subscribe" value="{{ 'password.general.submit' | t }}">
{% endif %}
{% endform %}
</div>
</div>
</div>
<div class="clear"></div>

<div class="password-page-footer">
<div class="password-page-icons">
{% include 'social-icons' %}
</div>

<div>
{{ 'password.general.powered' | t }}
<a rel="nofollow" href="//www.shopify.com/">shopify</a>
</div>
</div>

</div>

<script>
$(document).ready(function() {
$('.slideout-toggle').on('click', function(event) {
event.preventDefault();
var slideout = $('.slideout');
var slideoutWidth = 320;
slideout.toggleClass('open');
if (slideout.hasClass('open'))
{
slideout.animate({right: '0'}, 250);
}
else
{
slideout.animate({right: -slideoutWidth}, 250);
}
});
if ( $('.storefront-password-form .errors').size() ) {
var $errortoggle = $('.slideout');
$($errortoggle).addClass('open');
$('.slideout-toggle').trigger('click');
}

$(document).on('shopify:section:load', function(event) {
$('.slideout-toggle').on('click', function(event) {
event.preventDefault();
var slideout = $('.slideout');
var slideoutWidth = 250;
slideout.toggleClass('open');
if (slideout.hasClass('open'))
{
slideout.animate({right: '0'}, 250);
}
else
{
slideout.animate({right: -slideoutWidth}, 250);
}
});
if ( $('.storefront-password-form .errors').size() ) {
var $errortoggle = $('.slideout');
$($errortoggle).addClass('open');
$('.slideout-toggle').trigger('click');
}
});
});
</script>

</body>
</html>

{%- assign image_size = '2048x' -%}
{% assign opacity = section.settings.overlay_color_opacity | divided_by: 100.00 %}
<style>
.password-page {
{%- if section.settings.background_color -%}
background-color: {{ section.settings.background_color }};
{%- endif -%}

{% if section.settings.background_image %}
background:
{%- if section.settings.show_overlay_color -%}
linear-gradient(
{{ section.settings.background_overlay_color | color_modify: 'alpha', opacity }},
{{ section.settings.background_overlay_color | color_modify: 'alpha', opacity }}),
{%- endif -%}
url({{ section.settings.background_image | img_url: image_size }})
{% endif %};
background-position: center center;
color: {{ section.settings.text_color }};
margin-top: -40px;
background-repeat: no-repeat;
background-size: cover;
}
{% if section.settings.logo_max_width != blank %}
.password-page #logo img { max-width: {{ section.settings.logo_max_width }}px; }
{% endif %}
input#password-email::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: {{ section.settings.text_color }};
}
input#password-email::-moz-placeholder { /* Firefox 19+ */
color: {{ section.settings.text_color }};
}
input#password-email:-ms-input-placeholder { /* IE 10+ */
color: {{ section.settings.text_color }};
}
input#password-email:-moz-placeholder { /* Firefox 18- */
color: {{ section.settings.text_color }};
}
input#password-subscribe {
background-color: {{ section.settings.button_color }};
color: {{ section.settings.button_text_color }};
}
input#password-subscribe:hover {
opacity: 0.75;
}
input#password-email {
border-color: {{ section.settings.border_color }};
}
.password-page p,
.password-page h1,
.password-page h2,
.password-page h3
#password-signup h3,
.password-page-footer,
.slideout-toggle.open_password {
color: {{ section.settings.text_color }};
}
.password-page a {
opacity: 0.8;
}
.password-page a:hover {
opacity: 1.0;
}
#password-message,
#newsletter-details p {
font-size: {{ section.settings.text_size }}px;
line-height: initial;
}
</style>


{% schema %}
{
"name": "Password page",
"settings": [
{
"type": "header",
"content": "Logo"
},
{
"type": "image_picker",
"id": "logo",
"label": "Logo image"
},
{
"type": "range",
"id": "logo_max_width",
"min": 100,
"max": 600,
"step": 10,
"unit": "px",
"label": "Logo image width",
"default": 300
},
{
"type": "richtext",
"id": "newsletter_details",
"label": "Coming soon message",
"default": "<p>Coming Soon</p><p>Signup for our newsletter and get updated when we launch our site <a href=\"https://example.com/\">see our newsletter policy.</a></p>"
},
{
"type": "range",
"id": "text_size",
"min": 12,
"max": 36,
"step": 1,
"unit": "px",
"label": "Password page message size",
"default": 18
},
{
"type": "color",
"id": "text_color",
"label": "Text Color",
"default": "#000000"
},
{
"type": "header",
"content": "Background"
},
{
"type": "paragraph",
"content": "Choose between a background color or background image."
},
{
"type": "color",
"id": "background_color",
"label": "Background Color",
"default": "#f5f5f5"
},
{
"type": "image_picker",
"id": "background_image",
"label": "Background image"
},
{
"type": "checkbox",
"id": "show_overlay_color",
"label": "Show background overlay color",
"default": false
},
{
"type": "color",
"id": "background_overlay_color",
"label": "Background Image Overlay Color",
"default": "#f5f5f5"
},
{
"type": "range",
"id": "overlay_color_opacity",
"min": 10,
"max": 100,
"step": 10,
"unit": "%",
"label": "Color Overlay Opacity",
"default": 80
},
{
"type": "header",
"content": "Signup Form"
},
{
"type": "color",
"id": "border_color",
"label": "Form Border Color",
"default": "#000000"
},
{
"type": "color",
"id": "button_color",
"label": "Button Background Color",
"default": "#000000"
},
{
"type": "color",
"id": "button_text_color",
"label": "Button Text Color",
"default": "#ffffff"
}
]
}
{% endschema %}

 

Sheesh_b
Shopify Partner
523 116 120

Hi @omgbeauty 

Just paste below code again and look for line number 64 and add your text after removing the line that I added there to explain it and it'll work.

{% layout none %}
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
<title>
{{ page_title }}
</title>
{% if page_description %}
{%- comment %}<locksmith:2662>{% endcomment -%}
{%- capture var %}{% render 'locksmith-variables', variable: 'transparent', hiding_scope: 'resource' %}{% endcapture %}{% if var == 'true' %}<meta name="description" content="{{ page_description }}" />{% endif -%}
{%- comment %}original: <meta name="description" content="{{ page_description }}" />{%- endcomment %}
{%- comment %}</locksmith:2662>{% endcomment -%}
{% endif %}
{{ 'stylesheet.css' | asset_url | stylesheet_tag }}
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
{{ content_for_header }}
</head>
<body class="password gridlock {{ template }}" data-section-id="{{ section.id }}">

<div class="slideout">
<div class="closeslide slideout-toggle">
<i class="fa fa-times" aria-hidden="true"></i>
</div>
<div>
{% form 'storefront_password' %}
{{ form.errors | default_errors }}
<label for="password">{{ 'password.general.enter_store' | t }}</label>
<input type="password" name="password" placeholder="{{ 'password.general.password' | t }}">
<input type="submit" value="{{ 'password.general.enter' | t }}">
{% endform %}
</div>
</div>

<div class="slideout-toggle open_password">
<i class="fa fa-lock" aria-hidden="true"></i>
{{ 'password.general.enter_store' | t }}
</div>

{% if section.settings.background_image %}
<div class="password-page lazyload lazyfade"
data-bgset="{% include 'bgset', image: section.settings.background_image %}"
data-sizes="auto">
{% else %}
<div class="password-page">
{% endif %}
<div id="logo">
{% if section.settings.logo != blank %}
<a href="{{ routes.root_url }}">
<img src="{{ section.settings.logo | img_url: '600x' }}" alt="{{ section.settings.logo.alt | default: shop.name }}" itemprop="logo">
</a>
{% else %}
<a href="{{ routes.root_url }}">{{ shop.name }}</a>
{% endif %}
</div>

<div id="signup-holder">
<div id="signup-wrap">
{% unless section.settings.newsletter_details == blank %}
<div id="newsletter-details">
Write here your text after removing this line insted of coming soon text
</div>
{% endunless %}
<div id="password-signup">
{% form 'customer' %}
{{ form.errors | default_errors }}
{% if form.posted_successfully? %}
<p class="success">{{ 'password.general.thanks' | t }}</p>
{% else %}
<input type="hidden" name="contact[tags]" value="prospect, password page">
<input type="email" name="contact[email]" id="password-email" placeholder="{{ 'password.general.email_address' | t }}">
<input type="submit" id="password-subscribe" value="{{ 'password.general.submit' | t }}">
{% endif %}
{% endform %}
</div>
</div>
</div>
<div class="clear"></div>

<div class="password-page-footer">
<div class="password-page-icons">
{% include 'social-icons' %}
</div>

<div>
{{ 'password.general.powered' | t }}
<a rel="nofollow" href="//www.shopify.com/">shopify</a>
</div>
</div>

</div>

<script>
$(document).ready(function() {
$('.slideout-toggle').on('click', function(event) {
event.preventDefault();
var slideout = $('.slideout');
var slideoutWidth = 320;
slideout.toggleClass('open');
if (slideout.hasClass('open'))
{
slideout.animate({right: '0'}, 250);
}
else
{
slideout.animate({right: -slideoutWidth}, 250);
}
});
if ( $('.storefront-password-form .errors').size() ) {
var $errortoggle = $('.slideout');
$($errortoggle).addClass('open');
$('.slideout-toggle').trigger('click');
}

$(document).on('shopify:section:load', function(event) {
$('.slideout-toggle').on('click', function(event) {
event.preventDefault();
var slideout = $('.slideout');
var slideoutWidth = 250;
slideout.toggleClass('open');
if (slideout.hasClass('open'))
{
slideout.animate({right: '0'}, 250);
}
else
{
slideout.animate({right: -slideoutWidth}, 250);
}
});
if ( $('.storefront-password-form .errors').size() ) {
var $errortoggle = $('.slideout');
$($errortoggle).addClass('open');
$('.slideout-toggle').trigger('click');
}
});
});
</script>

</body>
</html>

{%- assign image_size = '2048x' -%}
{% assign opacity = section.settings.overlay_color_opacity | divided_by: 100.00 %}
<style>
.password-page {
{%- if section.settings.background_color -%}
background-color: {{ section.settings.background_color }};
{%- endif -%}

{% if section.settings.background_image %}
background:
{%- if section.settings.show_overlay_color -%}
linear-gradient(
{{ section.settings.background_overlay_color | color_modify: 'alpha', opacity }},
{{ section.settings.background_overlay_color | color_modify: 'alpha', opacity }}),
{%- endif -%}
url({{ section.settings.background_image | img_url: image_size }})
{% endif %};
background-position: center center;
color: {{ section.settings.text_color }};
margin-top: -40px;
background-repeat: no-repeat;
background-size: cover;
}
{% if section.settings.logo_max_width != blank %}
.password-page #logo img { max-width: {{ section.settings.logo_max_width }}px; }
{% endif %}
input#password-email::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: {{ section.settings.text_color }};
}
input#password-email::-moz-placeholder { /* Firefox 19+ */
color: {{ section.settings.text_color }};
}
input#password-email:-ms-input-placeholder { /* IE 10+ */
color: {{ section.settings.text_color }};
}
input#password-email:-moz-placeholder { /* Firefox 18- */
color: {{ section.settings.text_color }};
}
input#password-subscribe {
background-color: {{ section.settings.button_color }};
color: {{ section.settings.button_text_color }};
}
input#password-subscribe:hover {
opacity: 0.75;
}
input#password-email {
border-color: {{ section.settings.border_color }};
}
.password-page p,
.password-page h1,
.password-page h2,
.password-page h3
#password-signup h3,
.password-page-footer,
.slideout-toggle.open_password {
color: {{ section.settings.text_color }};
}
.password-page a {
opacity: 0.8;
}
.password-page a:hover {
opacity: 1.0;
}
#password-message,
#newsletter-details p {
font-size: {{ section.settings.text_size }}px;
line-height: initial;
}
</style>


{% schema %}
{
"name": "Password page",
"settings": [
{
"type": "header",
"content": "Logo"
},
{
"type": "image_picker",
"id": "logo",
"label": "Logo image"
},
{
"type": "range",
"id": "logo_max_width",
"min": 100,
"max": 600,
"step": 10,
"unit": "px",
"label": "Logo image width",
"default": 300
},
{
"type": "richtext",
"id": "newsletter_details",
"label": "Coming soon message",
"default": "<p>Coming Soon</p><p>Signup for our newsletter and get updated when we launch our site <a href=\"https://example.com/\">see our newsletter policy.</a></p>"
},
{
"type": "range",
"id": "text_size",
"min": 12,
"max": 36,
"step": 1,
"unit": "px",
"label": "Password page message size",
"default": 18
},
{
"type": "color",
"id": "text_color",
"label": "Text Color",
"default": "#000000"
},
{
"type": "header",
"content": "Background"
},
{
"type": "paragraph",
"content": "Choose between a background color or background image."
},
{
"type": "color",
"id": "background_color",
"label": "Background Color",
"default": "#f5f5f5"
},
{
"type": "image_picker",
"id": "background_image",
"label": "Background image"
},
{
"type": "checkbox",
"id": "show_overlay_color",
"label": "Show background overlay color",
"default": false
},
{
"type": "color",
"id": "background_overlay_color",
"label": "Background Image Overlay Color",
"default": "#f5f5f5"
},
{
"type": "range",
"id": "overlay_color_opacity",
"min": 10,
"max": 100,
"step": 10,
"unit": "%",
"label": "Color Overlay Opacity",
"default": 80
},
{
"type": "header",
"content": "Signup Form"
},
{
"type": "color",
"id": "border_color",
"label": "Form Border Color",
"default": "#000000"
},
{
"type": "color",
"id": "button_color",
"label": "Button Background Color",
"default": "#000000"
},
{
"type": "color",
"id": "button_text_color",
"label": "Button Text Color",
"default": "#ffffff"
}
]
}
{% endschema %}

 

 

Let me know if that works for you.

 

Thanks

Sheesh B

We're here to simplify website creation for those looking to establish a strong online presence. Book a meeting slot if you want to discuss. It's FREE. BOOK NOW | Try Shopify for $1 for 3 Months: Shopify Trial | Shopify Web Store Developer |
LIKE or mark as ACCEPTED SOLUTION
omgbeauty
Tourist
7 0 2

Hi Sheesh,

 

I honestly can't thank you enough for helping me get this sorted.  The format isn't great, but the text is now showing, which is all I really need.  Many, many thanks again.

Sheesh_b
Shopify Partner
523 116 120

This is an accepted solution.

Hi @omgbeauty 

Glad that it helps.

If you wanted to format it in a better way just put <br> after last word of line which after you want a line break.

 

Also, kindly mark as accepted answer to help other members as an accepted answer.

 

Thanks

Sheesh B

We're here to simplify website creation for those looking to establish a strong online presence. Book a meeting slot if you want to discuss. It's FREE. BOOK NOW | Try Shopify for $1 for 3 Months: Shopify Trial | Shopify Web Store Developer |
LIKE or mark as ACCEPTED SOLUTION
omgbeauty
Tourist
7 0 2

Thanks again, so incredibly helpful.