Importing Commerce Products

This guide will serve as a real-world example of importing Commerce Products into Craft Commerce. We'll be importing two T-Shirt products into Commerce. This guide specifically deals with single-variant products.

Looking to import products with multiple Variants? Have a look at the Importing Commerce Variants guide.

Example Feed Data #

The below data is what we'll use for this guide:

<?xml version="1.0" encoding="UTF-8"?>
        <title>Printed T-Shirt</title>

        <title>Plain T-Shirt</title>
    "product": [
            "title": "Printed T-Shirt",
            "sku": "SHIRT-101",
            "price": "15",
            "stock": "500",
            "length": "10",
            "width": "25",
            "height": "32",
            "weight": "500"
            "title": "Plain T-Shirt",
            "sku": "SHIRT-102",
            "price": "19",
            "unlimitedStock": "1",
            "length": "9",
            "width": "28",
            "height": "30",
            "weight": "480"

Things to note

  • sku is compulsory for each product for any import
  • length, width, height and weight should all be units according to your Commerce settings
  • The first product has limited stock, the second unlimited

Choose either the XML or JSON (depending on your preference), and save as a file in the root of your public directory. We'll assume its http://craft.local/products-feed.xml.

Let's continue and Setup your Feed →

Get started with Feed Me

Available for Craft 2 & Craft 3, with Free and Pro versions.