# Product Variant

You add variants to a product that comes in more than one option, such as size or color. Each combination of option values for a product can be a variant for that product. For more information, see [Variants](https://help.shopify.com/en/manual/products/variants).

![](https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2F4Hv43YGWsV5ENH7ZLYKR%2F139.jpg?alt=media\&token=c8c55c39-9e76-4eb9-b7ae-893d93f4bd2d)

{% hint style="info" %}
Ella offers 2 type for Product Variant: Dropdown and Square / Rectangle / Swatch. For more information, see [Swatch](https://halosoft.gitbook.io/ella-documentation/theme-settings/general/swatch).
{% endhint %}

## Setup Color Variant

{% hint style="info" %}
Ella offers 4 type for Color Variant: Default, Advanced Color, Metafields and Metaobject.
{% endhint %}

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FyFdS2gVrtsVb6C0gk3yV%2FSetup%20Color%20Variant.png?alt=media&#x26;token=dc541df2-cbb0-4963-8bcf-94d70a9e822b" alt=""><figcaption></figcaption></figure>

### <mark style="color:blue;">01: Advanced Color:</mark>

1. From your Shopify admin, go to **Online Store** -> **Themes**.
2. Find the theme that you want to edit, and then click **Customize**.
3. Click **Theme settings ->** **General.**
4. Scroll to **Swatch** and choose **Type** as **Advanced Color.**

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FFeHQsTU6u2NiVRnvgPqy%2Fimage.png?alt=media&#x26;token=d1a3f567-cc63-4c5a-b454-49803a6817e0" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
When selecting this option, there are 2 cases::

* If the color name is a basic color (<http://www.w3schools.com/tags/ref_colornames.asp>) then the color will be displayed automatically.
* If the color name is a special name (not a basic color), then you need to upload a PNG image with a certain naming convention.
  {% endhint %}

### ***The naming convention for PNG images:***

{% hint style="info" %}
Upload an image with the same name as the color name (Go to Content → Files -> Upload files).

**Naming convention**: Lower cap and use a hyphen "-" to replace white space if your color image name has the white space. For example: your special color will have this name: "Holo Rainbow", you will upload the png image is holo-rainbow\.png
{% endhint %}

![](https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FAPLlT3bmx6txbV93880i%2Fspecial_color_1.jpg?alt=media\&token=0a041d01-677b-495f-b942-4f98c24707c8)

### <mark style="color:blue;">02: Metafields:</mark>

1. From your Shopify admin, go to **Online Store** -> **Themes**.
2. Find the theme that you want to edit, and then click **Customize**.
3. Click **Theme settings ->** **General.**
4. Scroll to **Swatch** and choose **Type** as **Metafields.**

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2F4TvnX2iwWwpwj927eCvy%2Fimage.png?alt=media&#x26;token=35792825-3002-46ee-9c8c-aba541f173c7" alt=""><figcaption></figcaption></figure>

#### \*H**ow to add a new Metafields?**

1. From your Shopify admin, go to **Settings** **->** **Custom data**.
2. Click **Variants → Add Definition.**

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FBppJtk0GFHrFaMbmZo6e%2Fimage.png?alt=media&#x26;token=57b5317b-642a-4d41-ae1c-7ee36f640bdc" alt=""><figcaption></figcaption></figure>

3. Please enter the correct **Namespace and Key** as we noted below.

```
Name: Variant Color
Namespace and key: custom.variant_color
Select content type: Text
```

#### \*How to insert content for Product Metafields?

1. From your Shopify admin, go to **Products -> All products**.
2. Find and choose the product that you want to edit.
3. Find and choose the variant that you want to edit.
4. In the **Metafields,** you need to insert "**Color codes**" or "**Image with PNG format**" for "**Variant Color**".

* **Image with PNG format**

{% hint style="info" %}
After that, please upload an image with the same name as the color name (Go to Content → Files -> Upload files).

**Naming convention**: Lower cap and use a hyphen "-" to replace white space if your color image name has the white space. For example: your special color will have this name: "Dark Gray Custom", you will upload the png image is dark-gray-custom.png
{% endhint %}

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2F6wKq6J2qKoKBPt41s5di%2Fimage.png?alt=media&#x26;token=8003de5c-cc75-476b-8464-24cc0984af80" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2Fbkk0YAOWJCkuMELFniMp%2Fimage.png?alt=media&#x26;token=50fa732a-a06d-4fa4-af79-04405d70cd2e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FigNHdXczNxMSTnCUfURa%2Fimage.png?alt=media&#x26;token=5594c08c-15f9-45c1-aa4d-98737e737797" alt=""><figcaption></figcaption></figure>

* **Color codes**

{% hint style="info" %}

* You need to make sure your color codes are correct: <http://www.w3schools.com/tags/ref_colornames.asp>. If the color code does not exist on the w3schools site, it will not show up on your site.
* Allows use of 3 formats: HEX, RGB and HSL.
  {% endhint %}

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2Fu4vzBCrE9EgY9MrJO33y%2Fimage.png?alt=media&#x26;token=8648594e-1040-4251-837d-c80fec897075" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2F9UQ5LR2gH9DY0Meg0D5U%2Fimage.png?alt=media&#x26;token=52c74808-eef8-4297-bc58-4eff66664b9f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FkNRNt0EB3pXVLtoxZ80D%2Fimage.png?alt=media&#x26;token=ba3a5c9d-e504-4470-93d6-1bbd0a5476de" alt=""><figcaption></figcaption></figure>

### <mark style="color:blue;">03: Default:</mark>

1. From your Shopify admin, go to **Online Store** -> **Themes**.
2. Find the theme that you want to edit, and then click **Customize**.
3. Click **Theme settings ->** **General.**
4. Scroll to **Swatch** and choose **Type** as **Default**

{% hint style="info" %}
For more information, see [Adding images to product variants](https://help.shopify.com/en/manual/products/product-media/add-images-variants).
{% endhint %}

![](https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FAs7o84FDw8O4Vb3QtQC1%2Fvariant-3.gif?alt=media\&token=b8cff631-1642-4dad-a987-451b3c0c5f9f)

{% hint style="info" %}
When using languages other than English, color variations may not be displayed correctly because Shopify does not support them. To circumvent this limitation, consider utilizing images for product variants or metafields.
{% endhint %}

### <mark style="color:blue;">04: Metaobjects:</mark>

1. From your Shopify admin, go to **Online Store** -> **Themes**.
2. Find the theme that you want to edit, and then click **Customize**.
3. Click **Theme settings ->** **General.**
4. Scroll to **Swatch** and choose **Type** as **Metaobjects.**

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FUwPBDkvPVb9OCncXdu44%2Fimage.png?alt=media&#x26;token=9e44377d-ecc0-47dc-8604-edcd64215401" alt=""><figcaption></figcaption></figure>

#### \*Connect a variant to a product or category metafield

1. From your Shopify admin, go to [Products](https://admin.shopify.com/products).
2. Click the product that you want to edit.
3. In the **Category** section under media, select the category that matches your product.

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FOj7PuYiE0fw3gam54d4A%2Fimage.png?alt=media&#x26;token=0382ef31-9d90-44cd-b261-d5604fb4e4e1" alt=""><figcaption></figcaption></figure>

4. In the **Variants** section, click **+ Add options like size or color.**
5. If a compatible category or product metafield is available to connect to, then select it. The option values are automatically filled with any entries you have added to the metafield. You can select more option values or create new ones

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FkqR9dsbopuRPNICA6UIx%2Fimage.png?alt=media&#x26;token=e532d080-7e4b-4de6-a99c-83eb3fa5e1a8" alt=""><figcaption></figcaption></figure>

6. Optional: If you want to add custom option values, then click **Edit**, and then click **Add new entry**. Fill out the entry fields, and then click **Save.**

<figure><img src="https://3284033180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fag3h7ZduRGWlquTgGUHi%2Fuploads%2FZJABte7R9Fdsx5t74WDV%2Fimage.png?alt=media&#x26;token=65d92367-65a7-4423-ba37-614116da8de7" alt=""><figcaption></figcaption></figure>

7. Click **Save** to save the product.

{% hint style="info" %}

* Shopify only supports adding colors and images to the Metaobject Color.
* Not all Categories have Metaobject Color available.
  {% endhint %}

{% hint style="info" %}
For more information about Variant Metaobject, you can refer to this [link](https://help.shopify.com/en/manual/custom-data/metafields/add-variants-with-metafields) or contact Shopify directly.
{% endhint %}
