Skip to content

Instantly share code, notes, and snippets.

@hasinhayder
Last active January 13, 2024 16:31
Show Gist options
  • Save hasinhayder/ebdc967976a130d479c06874b48ce866 to your computer and use it in GitHub Desktop.
Save hasinhayder/ebdc967976a130d479c06874b48ce866 to your computer and use it in GitHub Desktop.

Revisions

  1. hasinhayder revised this gist Dec 11, 2023. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    {
    "name": "faq-laravel",
    "private": true,
    "license": "UNLICENSED",
    "scripts": {
    "shopify": "shopify",
    "build": "shopify app build",
    "dev": "shopify app dev",
    "info": "shopify app info",
    "scaffold": "shopify app generate extension",
    "deploy": "shopify app deploy"
    },
    "dependencies": {
    "@shopify/app": "^3.52",
    "@shopify/cli": "^3.52"
    }
    }
  2. hasinhayder created this gist Dec 11, 2023.
    26 changes: 26 additions & 0 deletions star_rating.liquid
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    {% comment %} {% assign avg_rating = block.settings.product.metafields.demo.avg_rating.value | round %} {% endcomment %}
    Group ID = {{ block.settings.groupid }}
    {% assign avg_rating = 5 %}
    <span style="color:{{ block.settings.colour }}">
    {% render 'stars', rating: avg_rating %}
    </span>
    {% if avg_rating >= 4 %}
    <br>
    <img src="{{ "thumbs-up.png" | asset_img_url: '15x' }}" height="15" width="15" loading="lazy">
    {{ 'ratings.home.recommendationText' | t }}
    {% endif %}
    <div id="ostad-general-faq" data-group="{{ block.settings.groupid }}">
    <script src="{{ 'scripts.js' | asset_url }}#shop={{ shop.permanent_domain }}" defer></script>

    {% schema %}
    {
    "name": "Star Rating",
    "target": "section",
    "settings": [
    { "type": "product", "id": "product", "label": "product", "autofill": true },
    { "type": "color", "id": "colour", "label": "Star Colour", "default": "#ff0000" },
    { "type": "text", "id": "groupid", "label": "Group ID", "default": "1" }
    ]
    }
    {% endschema %}