Solved

How to add variants in custom catalog?

  • 15 March 2023
  • 7 replies
  • 669 views

Badge +4
  • Contributor I
  • 3 replies

I have a custom catalog and want to add variants but don’t understand how/where I can do that. 

icon

Best answer by Tonio 18 March 2023, 08:45

View original

7 replies

Badge

@Tonio I am facing the same problem, but with a JSON custom catalog feed. Is this possible as well? I cant find anything in the docs about this.

 

Can you provide som insight into how it is done :)? How are the products “linked” together?

 

Badge +4

@smd Yes, it is possible to add different attributes to variants, including product_url and description, as long as those attributes are defined in the schema of your custom catalog. In your example, you added the 'link' attribute to the variants, which should work as long as the schema of your catalog includes this attribute for the 'variant' object. Similarly, you can add a 'description' attribute to the variants, but you should make sure that this attribute is defined in the schema of your custom catalog.

To ensure that your custom catalog is properly formatted, you can use an XML validator tool to check for any errors or warnings. Once your custom catalog is properly formatted and the schema includes the desired attributes for the variants, you may be able to upload it to Klaviyo if the platform supports it and use it to create personalized campaigns.

Great, thank you @Tonio for your support and answers!

Userlevel 3
Badge +9

@smd Yes, it is possible to add different attributes to variants, including product_url and description, as long as those attributes are defined in the schema of your custom catalog. In your example, you added the 'link' attribute to the variants, which should work as long as the schema of your catalog includes this attribute for the 'variant' object. Similarly, you can add a 'description' attribute to the variants, but you should make sure that this attribute is defined in the schema of your custom catalog.

To ensure that your custom catalog is properly formatted, you can use an XML validator tool to check for any errors or warnings. Once your custom catalog is properly formatted and the schema includes the desired attributes for the variants, you may be able to upload it to Klaviyo if the platform supports it and use it to create personalized campaigns.

Badge +4
  1. Find the product you want to add variants to and locate its <variants> tag. If the <variants> tag doesn't exist, create it as a child of the <product> tag.
  2. Within the <variants> tag, create a new <variant> tag for each variant you want to add. For example:

<variants>
  <variant name="Color" value="Red"/>
  <variant name="Color" value="Blue"/>
  <variant name="Size" value="Small"/>
  <variant name="Size" value="Medium"/>
</variants>

Verify that the variants were imported correctly and make any necessary adjustments.

 

Thank you @Tonio - do you know which attributes are available for variants? For example I would need the product_url for my variants since it differs from the parents url. Is this possible, e.g. like this? 

<product>
        <id><![CDATA[test-id]]></id>
        <title><![CDATA[test-title]]></title>
        <link><![CDATA[test-link]]></link>
        <description><![CDATA[test-description.]]></description>
        <price><![CDATA[10.00]]></price>
        <image_link><![CDATA[test-link]]></image_link>
        <categories><![CDATA[test-category]]></categories>
<variants>
  <variant name="variant-1" link="https://www.test-link.com”/>
  <variant name="variant-2" link="https://www.test-link.de”/>
  <variant name="variant-3" link="https://www.test-link.fr”/>
</variants>
</product>
 

I wanted to try it like that and upload this within Klaviyo, however a direct upload is unfortunately not possible and I currently can’t have it uploaded on a server for me to pull from there. 

 

And next question:

Assuming this is working, could I then also add different descriptions to the variants? e.g. like this: 

<product>
        <id><![CDATA[test-id]]></id>
        <title><![CDATA[test-title]]></title>
        <link><![CDATA[test-link]]></link>
        <description><![CDATA[test-description.]]></description>
        <price><![CDATA[10.00]]></price>
        <image_link><![CDATA[test-link]]></image_link>
        <categories><![CDATA[test-category]]></categories>
<variants>
  <variant name="variant-1" link="https://www.test-link.com” description=”description-1”/>
  <variant name="variant-2" link="https://www.test-link.de” description=”description-2”/>
  <variant name="variant-3" link="https://www.test-link.fr” description=”description-3”/>
</variants>
</product>

 

Thank you very much for your support!

 

Userlevel 3
Badge +9

Hi Stephen 

thanks for getting back to me. I am not using the API but an .xml file to generate my custom catalog. How do I add variants this way? 
 

 

  1. Find the product you want to add variants to and locate its <variants> tag. If the <variants> tag doesn't exist, create it as a child of the <product> tag.
  2. Within the <variants> tag, create a new <variant> tag for each variant you want to add. For example:

<variants>
  <variant name="Color" value="Red"/>
  <variant name="Color" value="Blue"/>
  <variant name="Size" value="Small"/>
  <variant name="Size" value="Medium"/>
</variants>

Verify that the variants were imported correctly and make any necessary adjustments.

Badge +4

Hi Stephen 

thanks for getting back to me. I am not using the API but an .xml file to generate my custom catalog. How do I add variants this way? 
 

 

Userlevel 7
Badge +60

Hey @smd 

Welcome to the community and congrats on your first post!

With our V3 APIs we actually have new catalog endpoints you can use to create and manage variants: https://developers.klaviyo.com/en/reference/create_catalog_variant

If you are unsure how to implement this API, work with your developer to make sure it’s set up correctly. If you don’t have a developer and need help, you can reach out to one of our Agency Partners to get the help you are looking for!

Thanks again for being part of the community. Looking forward to seeing you again!
 

Reply