Links
Comment on page

Customising Locksmith’s "Access denied content" messages, and redirecting customers

Locksmith access denied content is presented to customers who are signed in, but don’t meet the access requirements of the lock (e.g. the customer doesn’t have the specific customer tag that is required for access). Or when the lock has no keys.

Key conditions that use the “Access denied content" filed:

  • is tagged with…
  • has one of many email addresses
  • has an email address from an input list…
  • the customer's email contains…
  • has placed at least x orders
  • has purchased…
  • (custom Liquid) in some cases

1. Modifying the default message

The "Access denied content" message field can be modified in the same way as Locksmith’s other access messages, including using code to modify the appearance and functionality of the message.

The following code can be used in this field:

  • HTML
  • CSS (via the <style> tag)
  • Javascript (via the <script> tag)
  • Liquid (Shopify's template language for themes)

2. Adding the registration form to this page

Simply add the following Liquid to the "Access denied content" message field:
{{ locksmith_customer_register_form }}
This will render the theme’s default registration form.

3. Adding a custom registration form or content

Liquid code can be used to render a snippet or section from your theme that contains a custom form or message.
  1. 1.
    render - Renders a snippet
{% render 'filename' %}
  1. 2.
    section - Renders a section.
{% section 'name' %}

4. Automatically redirecting customers to another part of your store

A JavaScript redirect can can be added to the “"Access denied content" message field if you would like to automatically send customers who are denied access to your lock, to some other part of your store.
This might be useful for a few different reasons:
  • To take customers to a specific product they can purchase for access. For example, to buy a product, or membership, or subscription for access.
  • To take customers to an information page.
  • To take customers to a custom registration form
  • To direct customers to an alternative resource
Simply add the following code to the "Access denied content" message field and modify the URL to your desired location.
<script>
window.location.replace("http://www.example.com");
</script>

Something else not covered here?

Let us know by emailing us at: [email protected]