Skip to content

Instantly share code, notes, and snippets.

@hasinhayder
Last active January 13, 2024 16:31
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save hasinhayder/ebdc967976a130d479c06874b48ce866 to your computer and use it in GitHub Desktop.
Save hasinhayder/ebdc967976a130d479c06874b48ce866 to your computer and use it in GitHub Desktop.
Shopify App Extension with Local Script
{
"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"
}
}
{% 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 %}
@hasinhayder
Copy link
Author

npm command = npm run scaffold

@hasinhayder
Copy link
Author

@hasinhayder
Copy link
Author

hasinhayder commented Dec 11, 2023

@hasinhayder
Copy link
Author

@hasinhayder
Copy link
Author

hasinhayder commented Dec 11, 2023

@hasinhayder
Copy link
Author

Emmet setting : emmet.includeLanguages

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment