> For the complete documentation index, see [llms.txt](https://guide.swiftxr.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.swiftxr.io/how-to/how-to-add-the-swiftxr-custom-block-to-any-section-on-your-product-media-page.md).

# How to Add the SwiftXR Custom Block to any section on your Product Media Page

This guide will show you how to embed your SwiftXR 3D/AR/VR viewer to any section of your Media on your Shopify store

## Step 1 — Open Your Theme Editor

1. In your Shopify admin, go to Online Store → Themes.
2. Click Customize on the theme you want to edit.

<figure><img src="https://564713456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKNcXDcNRYHUBsVw12Dii%2Fuploads%2F6PaV1LNLC53mHoauyhvI%2Fimage.png?alt=media&amp;token=a762b0ed-43f7-4836-ae96-76952f280749" alt=""><figcaption></figcaption></figure>

## Step 2 — Open Your Product Page Template

1. In the top bar of the theme editor, use the dropdown to select a Product Page.
2. Choose the Default product template (or your preferred product template)

<figure><img src="https://564713456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKNcXDcNRYHUBsVw12Dii%2Fuploads%2FMJuQFlmddNdFoa2PXaqc%2FScreenshot%202025-09-01%20100725.png?alt=media&amp;token=684bf800-8da3-49cc-8afc-9af764324bd5" alt=""><figcaption></figcaption></figure>

### Step 3 **—** Click and Edit the your code on the Product Page

1. On the **Product page**, click the 3 dots beside **Live**
2. Choose Edit Code

<figure><img src="https://564713456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKNcXDcNRYHUBsVw12Dii%2Fuploads%2FwWfQCC2fhUc1S7AZzd0m%2FScreenshot%202025-09-01%20100134.png?alt=media&amp;token=e0f735fb-88bd-4364-9f71-e5a2a6a26f79" alt=""><figcaption></figcaption></figure>

### **Step 4 — Paste the SwiftXR Embed Code**

Paste the following code into your **Custom Liquid** block:

```
// Some code
{% liquid 
  assign swiftxr_product_url = product.metafields.swiftxr.product_url_api
%}

{% if swiftxr_product_url %}

  <div style="width: 100%; height: 450px; margin: 0;"> 
    <iframe title="3D Product" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" allow="fullscreen; autoplay; camera; midi; encrypted-media; gyroscope; accelerometer; magnetometer; xr-spatial-tracking; microphone;" execution-while-out-of-viewport execution-while-not-rendered web-share width="100%" height="100%" src="{{ swiftxr_product_url }}"> 
    </iframe>
  </div>

{% endif %}

```

<figure><img src="https://564713456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKNcXDcNRYHUBsVw12Dii%2Fuploads%2Fi5Ru9JZytNoPW9RkXvkv%2FScreenshot%202025-09-01%20095747.png?alt=media&amp;token=b052a900-198e-495f-9e7f-6d1dcb6e6273" alt=""><figcaption></figcaption></figure>

### **Step 5 — Save and Test**

1. Click **Save** in the top right.
2. You should now see the 3D viewer in the media section.

<figure><img src="https://564713456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKNcXDcNRYHUBsVw12Dii%2Fuploads%2Fhk3LvaZIfSbn8oGGAFZP%2FScreenshot%202025-09-01%20100443.png?alt=media&amp;token=ba42df7a-58b5-4945-a816-27b8d4e78b50" alt=""><figcaption></figcaption></figure>
