We all love our customers, but occasionally we all run into one or two who might not be adhering to your store policies. If you have certain customers who you would like to block from retrieving files, you may implement the following code on your order email and order page templates.


Start by creating a list of customers at the very top of the template. You'll do this by setting a variable equal to a comma or space-separated string of emails.


{% assign blocked_customers = ' examplecustomer1@example.com examplecustomer2@example.com ' %}


Next, find where you are rendering the products you're delivering (keep in mind you'll also want to address license keys if you're sending them out). This code typically starts with:


{% for product in order.products %}


And ends with:

{% endfor %}

Once you've located this code, you wrap it in an unless statement like so:


{% unless blocked_customers contains order.email %}

    {% for product in order.products %}

        // ORDER CONTENTS

    {% endfor %}

{% else %}

    We're sorry, this order is unavailable at this time. If you have questions, please contact {{ company.email }}

{% endif %}

This will show a message to the customer instead of the contents of their order.