Last active
          January 13, 2024 16:31 
        
      - 
      
- 
        Save hasinhayder/ebdc967976a130d479c06874b48ce866 to your computer and use it in GitHub Desktop. 
    Shopify App Extension with Local Script
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "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" | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | {% 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 %} | |
Metafield in Liquid - https://shopify.dev/docs/api/liquid/objects/metafield
Merchant Onboarding (App Block) https://shopify.dev/docs/apps/online-store/theme-app-extensions/ux-guidelines#onboarding-for-app-blocks
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
npm command =
npm run scaffold