Historical Orders imported via REST do not show the product name

Highlighted
New Member
6 0 0

This is something that only happens on the production site. The dev site works as expected.

I am importing historical orders via the API, when I import via Dev, the product name shows in the right place. When I import into product it replaces the product name with "Fullfilled on Feb 14" (or whatever the date was).

Not sure why this would happen and why there would be a difference between dev and prod.

0 Likes
Highlighted
Shopify Partner
531 38 109

What's your REST API request look like? Here was a test query I ran using the GraphQL API, and the order-->lineitems-->title conveyed the display name just fine.

query ($numOrders: Int!, $cursor: String) {
  orders(first: $numOrders, after: $cursor) {
    pageInfo {
      hasNextPage
      hasPreviousPage
    }
    edges {
      cursor
      node {
        id
        name
        lineItems(first: 5) {
          edges {
            node {
              id
              title
            }
          }
        }
      }
    }
  }
}

 

0 Likes
Highlighted
New Member
6 0 0

I don't think it's a payload problem, as this works just fine in dev. But here it is

{
  "processed_at": "2019-06-28T14:06:00+00:00",
  "line_items": [
    {
      "variant_id": "32608528040033",
      "quantity": "1",
      "price": "54.44"
    }
  ],
  "note": "80000263855",
  "email": "tryerson@icperfumes.com",
  "send_receipt": false,
  "shipping_address": {
    "address1": "45 West 25th Street",
    "address2": " ",
    "city": "New York",
    "state": "NY",
    "country": "US",
    "zip": "10010"
  },
  "fulfillment_status": "fulfilled"
}

 

0 Likes
Highlighted
Shopify Partner
531 38 109

Sorry, as I didn't read your initial post carefully enough. If you are importing in the orders, then there might be a possible issue with the source data or field mapping. If you see the funky variant titles for some of these, what do the variants look like if you pull them up directly in the Shopify admin? If the order import is just referencing the variant id for the order line items then it might be something related to how the variants themselves are already defined in the shop...

0 Likes
Highlighted
New Member
6 0 0

The variants all look fine in the admin and these variants I created specifically for these orders as they are all out of stock and discontinued. The name isn't "messed up" so much as getting replaced by the fullfillment date.creed-order.png

0 Likes
Highlighted
Shopify Partner
531 38 109

So you had a multi-step process for importing in these historical orders from the sounds of it. Any historical order associated with a non-existent line item at first created the new product variant, and then that new product variant was linked to the order line item.

Kind of after the fact, but if it was me, I would've just created a custom "quick sale" order line item for something that wasn't defined in the current shop's inventory. The new order line item could just have the quantity, the price, and the title passed into it. That way you'd have control and skip the step of adding a new product variant. Unless you need to analyze inventory turnover for these old orders against real SKU's, just creating a quick sale order line item would've been simpler.

And another question. There is a product title, and then under that there are variant titles. For example, Product #123456 has a title of Men's Polo Shirt. Under that is Product Variant #2345678, with a title of Size Small. Perhaps your newly-created product was the title you were looking for in your order line item. But the product variant title is the one that just says Fulfilled on Aug-XXXX. And that's what the order line item is linked to, since it's only dealing with product variants. 

0 Likes
Highlighted
New Member
6 0 0

That would have been a good way to do but I've already imported all the "missing" products. Otherwise your assumption of my process is as you described. 

 

And again, in dev this worked as expected.

0 Likes
Highlighted
Shopify Partner
531 38 109

In your production shop, if you pull up one of the products in the web admin look at the product title. I assume these look okay. I'd bet if you scroll down to the product variants then there's where the titles reflect the "Fulfilled on..." title. 

It would be like the results of this GraphQL API query example.

{
  product(id: "gid://shopify/Product/4423804059700") {
    id
    title					# This is the product title.
    variants(first: 10) {
      edges {
        node {
          id
          title		# This is the variant title, linked to the order line item.
        }
      }
    }
  }
}

 

0 Likes