Skip to content

Instantly share code, notes, and snippets.

@hasinhayder
Created December 14, 2023 13:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hasinhayder/9d126593d748b9829adcb69849f7715a to your computer and use it in GitHub Desktop.
Save hasinhayder/9d126593d748b9829adcb69849f7715a to your computer and use it in GitHub Desktop.
QR Code Block
{% assign full_url = request.host | append: request.path %}
<div style="position: fixed; bottom: 0; right: 0">
{% comment %} {{ "thumbs-up.png" | asset_url | img_tag }} {% endcomment %}
<img width="150" height="150" src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl={{ full_url }}" alt=""/>
</div>
{% schema %}
{
"name": "App Embed",
"target": "body",
"settings": []
}
{% endschema %}
@hasinhayder
Copy link
Author

npm init @shopify/app@latest
npm run shopify app generate extension 

@hasinhayder
Copy link
Author

@hasinhayder
Copy link
Author

hasinhayder commented Dec 14, 2023

{% assign full_url = request.host | append: request.path %}
{% if block.settings.show_qr != false %}
<div style="position: fixed; bottom: 0; right: 0">
    {% comment %} {{ "thumbs-up.png" | asset_url | img_tag }} {% endcomment %}
    <img width="150" height="150" src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl={{ full_url }}" alt=""/>
</div>
{% endif %}

{% schema %}
  {
    "name": "App Embed",
    "target": "body",
    "javascript": "global.js",
    "settings": [
        {
            "type": "checkbox",
            "id": "show_qr",
            "label": "Show QR Code"
        }
    ]
  }
{% endschema %}

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