How To Install Optizen

Installing the Optizen app requires some changes to your theme code. Please make sure you duplicate (backup) your store theme prior to installing. If you don’t know how to do this, you can see a tutorial here:

https://help.shopify.com/en/manual/online-store/os/using-themes/managing-themes/duplicating-themes

Note: Shopify is compatible with Shopify 2.0.

Done For You Installation:

We also offer an installation service if you are not comfortable with editing your theme files. If you would like to use this service, please send us a message here and one of our developers will get back to you.

Manual Installation

Files that need to be update:

– theme.liquid

– collection.json /All Collection Templates

– social-meta-tags.liquid

 

1. collection.json/ All collection templates

Add the below-mentioned code in every collection template at top of the code.

{% assign con_tent =” %}
{% if template contains ‘collection’ and current_tags %}
{% assign tag_page_key = current_tags[0] | handleize| prepend: ‘e_’ %}
{% assign show_page = collection.metafields.TagShowContent[tag_page_key] %}
{% assign tag_desc_key = current_tags[0] | handleize | prepend: ‘g_’ %}

{% if show_page == ‘all_pages’ %}
{% assign con_tent = collection.metafields.TagData[tag_desc_key] %}
{% else %}
{% if current_page == 1 %}
{% assign con_tent = collection.metafields.TagData[tag_desc_key] %}
{% endif %}
{% endif %}
{% else %}
{% if collection.metafields.collectionlower.show_content == ‘all_pages’ %}
{% assign con_tent = collection.metafields.collectionlower.lowerdata %}
{% else %}
{% if current_page == 1 %}
{% assign con_tent = collection.metafields.collectionlower.lowerdata %}
{% endif %}
{% endif %}
{% endif %}
<div class=’col_lower_main’ style=’width:100%’>
<div class=’inner_lower_main’ style=’max-width:1170px;margin:0 auto;’>
{{con_tent}}
</div>
</div>

 

2. collection-template.liquid/ Collection section

if your theme collection template contains any section for description.

find

{% if collection.description != blank %}

              <div class=”rte”>         

                  {{ collection.description }}

              </div>

{% endif %}

Replace

{% assign collectiopn_c = ” %}

         

    {% if collection.description != blank %}

     {% assign collectiopn_c = collection.description %}          

    {% endif %}

    {% if template contains ‘collection’ and current_tags %}

      {% assign tag_description_key = current_tags[0] | handleize | prepend: ‘b_’ %}

      {% assign tag_description = collection.metafields.TagDescTitle[tag_description_key] %}

      {% assign collectiopn_c = tag_description %}

    {% endif %}

    <div class=”rte collection-description page-width”>

      {{collectiopn_c}}

    </div>
find

{{ collection.title }}
Replace

{% if template contains ‘collection’ and current_tags %}

                  {% assign tag_desc_key = current_tags[0] | handleize | prepend: ‘d_’ %}

                      {{collection.metafields.TagTitleData[tag_desc_key]}}

 {% else %}

                  {{ collection.title }}

 {% endif %}

3. social-meta-tags.liquid /snippets

add this code in top of the file of social meta tags files means where og title and descriptions has been integrated.

{% if template contains ‘collection’ and current_tags %}

{% assign tag_seo_title_key = current_tags[0] | handleize | prepend: ‘a_’ %}

{% assign tag_seo_desc_key = current_tags[0] | handleize | prepend: ‘c_’ %} 

{% assign page_description = collection.metafields.TagSeoDesc[tag_seo_desc_key]  | strip_html  %}

{% assign page_title = collection.metafields.TagSeoTitleData[tag_seo_title_key] %}

{% endif %}

If your theme does not contain these templates, sections and snippets, please contact with app support.