AVADA logo
Published on

How to modify your theme.liquid file in Shopify

377 words2 min read
  • Name

Filter is an indispensable tool for any website to improve its customer journey. One of the easiest ways to let clients filter your collection is by editing your theme code. After checking your theme, the next thing you should do is to modify your theme.liquid.file. The tutorial will show you steps to change theme on desktop and iPhone/Android.

Table of content

What is Shopify product tags?

Product tags are searchable keywords related to our products. An ecommerce store with huge inventories and a lot of variations of a product type may take advantage of using a filter system. Many Shopify themes include the option to enable a drop-down menu to filter collection based on product tags.

Now, let’s move the main parts of this tutorial to see how to modify theme.liquid.file.

How to modify your theme.liquid file on desktop

Step 1:

Access to Shopify admin, click Online Store > Themes.

Step 2:

Choose the layout you want to edit, then click Actions > Edit Codes.

How to delete the authors name in Shopify

Step 3:

Click theme.liquid in layout directory.

Step 4:

Find the closing body tag near the bottom of the file. Copy and paste the code below before the bottom line.

  /* Product Tag Filters - Good for any number of filters on any type of collection pages */
  var collFilters = jQuery('.coll-filter');
  collFilters.change(function() {
    var newTags = [];
    collFilters.each(function() {
      if (jQuery(this).val()) {
    if (newTags.length) {
      var query = newTags.join('+');
      window.location.href = jQuery('{{ 'tag' | link_to_tag: 'tag' }}').attr('href').replace('/' + 'tag', '/' + query);
    else {
      {% if collection.handle %}
      window.location.href = '/collections/{{ collection.handle }}';
      {% elsif collection.products.first.type == collection.title %}
      window.location.href = '{{ collection.title | url_for_type }}';
      {% elsif collection.products.first.vendor == collection.title %}
      window.location.href = '{{ collection.title | url_for_vendor }}';
      {% endif %}

Step 5: Save


To sum up, using theme.file is supposed to be the easiest way to filter your collection. Your website will be more friendly with users if you equipes your webs with theme files. We hope that you will find a better solution when installing theme file liquid.

Exclusive Offer: Shopify Deal for PageFly Audience

Start Your Online Business with Shopify 12 Day Free Trial + Pay Only 1$ For Your First Month