# Add A2Reviews snippet code manually in Shopify theme

### Shopify theme basic standards

Some reasons that **A2Reviews** cannot add snippet code to your Shopify theme, you can do it manually.

\* Display total reviews widget on the product page:

In your theme, open this file **sections/product-template.liquid.** Add snippet code below to anywhere want to display total reviews.

```liquid
{% include 'a2reviews-total' %}
Or
{% render 'a2reviews-total' product:product %}
```

\* Display total reviews widget on the collection page:

Each Shopify theme can have different file names to display the product list on the collection page. Find a suitable position to display total reviews. Snippet code below you can add.

```liquid
{% include 'a2reviews-total' type:'collection' %} (new version)

Or (commonly used with product loops using ajax)
{% render 'a2reviews-total' type:'collection' product:product %} (new version)

In old version
{% render 'a2reviews-collection-total' product:product %} (Removed)
```

**\*** Main reviews / QA widget snippet code, (Mostly added in the file **templates/product.liquid**)

```liquid
{% include 'a2reviews-widget' %}
Or
{% render 'a2reviews-widget' product:product %}
```

\
**QA Widget Snippet Code**

```liquid
{% include 'a2reviews-widget' type:'QA' %} (new version)
{% include 'a2reviews-qa-widget' %} (Removed)
```

or

```liquid
{% render 'a2reviews-widget' type:'QA' product:product %} (new version)
{% render 'a2reviews-qa-widget' product:product  %} (Removed)
```

### Shopify theme ONLINE STORE 2.0

Online Store 2.0 is a set of features and feature improvements that make themes and theme apps easier to build, more flexible, and easier to maintain.

Many Online Store 2.0 features rely on JSON templates. You can migrate a theme's templates to add support for these features by converting a Liquid template into a JSON template, and moving any required Liquid code or HTML into sections that you can include in the new JSON template.

[Read More](https://shopify.dev/themes/os20)

For Online Store 2.0 theme, setting widget display on product page will be added in **templates/product.json** file. With the general A2Reviews application will be added with the reference example below.

Example **templates/product.json** file

```json
{
  "sections": {
    "main": {
      "type": "main-product",
      "blocks": {
        "vendor": {
          "type": "text",
          "settings": {
            "text": "{{ product.vendor }}",
            "text_style": "uppercase"
          }
        },
        "title": {
          "type": "title",
          "settings": {
          }
        },
        "a2reviews-total-widget": {
          "type": "custom_liquid",
          "settings": {
            "custom_liquid": "{% render 'a2reviews-total' product:product %}"
          }
        },
        "subtitle": {
          "type": "text",
          "settings": {
            "text": "Free Shipping over 99$",
            "text_style": "subtitle"
          }
        },
        ....
      },
      "block_order": [
        "vendor",
        "title",
        "a2reviews-total-widget",
        "subtitle",
        .........
      ],
      "settings": {
        "enable_sticky_info": true,
        "hide_variants": false,
        "enable_video_looping": false
      }
    },
    "product-recommendations": {
      "type": "product-recommendations",
      "settings": {
      }
    },
    "a2reviews-main-widget": {
      "type": "a2reviews-main-widget",
      "settings": {
      }
    },
  },
  "order": [
    "main",
    "product-recommendations",
    "a2reviews-main-widget"
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.a2rev.com/installation-guides/add-a2reviews-snippet-code-manually-in-shopify-theme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
