Add Reviews Section by Editing Code

If merchants are inconvenient to upgrade the current theme for some specific reason, they can add a new reviews display area in the theme editor by editing the theme code.

1. Start here: SHOPLAZZA admin > Store > Themes > Action > Edit code

mceclip0.png

2. Click on Sections > Add a new section to add an empty apps.liquid file (no other name is allowed).

mceclip1.png

mceclip2.png

3. Copy the following code, paste it into apps.liquid file, and save.

<div class="{% if section.settings.page_width %}tw-container{% endif %}">

  {%- for block in section.blocks -%}

    {% render block %}

  {%- endfor -%}

</div>




{% schema %}

{

  "name": "apps",

  "max_blocks": 16,

  "settings": [

    {

      "type": "checkbox",

      "id": "page_width",

      "label": {

        "en-US": "Make section margins the same as theme",

        "zh-CN": "使分区页边距与模板相同"

      },

      "default": false

    }

  ],

  "blocks": [

    {

      "type": "@app"

    }

  ],

  "presets": [

    {

      "name": "apps",

      "cname": {

        "en-US": "Apps",

        "zh-CN": "应用"

      },

      "category": {

        "en-US": "Apps",

        "zh-CN": "应用"

      },

      "ccategory": {

        "en-US": "Apps",

        "zh-CN": "应用"

      },

      "display": true,

      "blocks": []

    }

  ]

}

{% endschema %}

mceclip3.png

4. Go to the theme editor and add a Review Flow section

mceclip4.png

mceclip5.png

5. Preview the effect and edit related settings. 

mceclip5.png

6. Click Publish and go to the store homepage to view the effect.

mceclip6.pngmceclip7.png 

📘 Tips:

When the reviews switch is off in the admin, the review display area will not display any information.

Related Topics

Product Detail Reviews Section

How to Create a Review Page for My Store

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.