AI-Powered Virtual Try-On for Shopify Stores
Boost engagement. Increase conversions.
This guide explains how to integrate the TryonAi Virtual Try-On Plugin into your Shopify store in just a few steps.
Use the working sample to integrate faster:
Login to https://yourstore.myshopify.com/admin → Online Store → Themes → Edit Code
<link rel="stylesheet" href="https://plugin.dam3d.in/tryon/v1/ui.css">
<link rel="stylesheet" href="https://plugin.dam3d.in/tryon/v1/tryonv2_shopify.css">
<script src="https://plugin.dam3d.in/tryon/v1/tdsInit.js"></script>
This initializes authentication and loads the Tryon UI.
Purpose: The tryongender metafield identifies which gender model should be used for Try-On.
How to Add the Meta Field:
Tip: After creating the tryongender metafield definition, you will see this field on each product page.
Fill it with men or women so the TryOnAi button shows up for that product.
Only products with the tryongender metafield filled will display the TryOnAi button.
Set value as: women for women’s clothing, men for men’s clothing.
Tip: After adding the tryongender metafield definition, you will see this field on each product page.
Fill it to ensure the TryOnAi button appears for that product.
Add the Try-On button wherever products are displayed (product page, collection, or featured section).
The tryOnFromGarmentImage() function is available after initialization.
Demo Example (Hardcoded):
<button class="tryon-btn"
onclick="tryOnFromGarmentImage(
'https://fab3d.in/cdn/shop/files/shirt_women2_1080x1920.webp?v=1762860967',
'women'
)">TryOnAi</button>
Shopify Dynamic Example (Recommended):
<button class="tryon-btn initTryon"
onclick="tryOnFromGarmentImage(
'{{ preview_image | img_url: '1080x1920' }}',
'{{ product.metafields.custom.tryongender }}'
)">
Try On
</button>
💡 Note: The Shopify version automatically passes each product’s image and tryongender metafield.
No need to hardcode values for every product.
Include the following container **once** in your Shopify page or theme (for example in theme.liquid or product template).
This is where the Try-On plugin will render the virtual try-on UI.
<div class="tryon-frame" id="tryonModal"></div>
Customers can upload photos via scan or browse and instantly experience AI-powered virtual try-on.