question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variants not rendering when defined in the product.json seed file

See original GitHub issue

If I add a variant to a product in product.json, it does not render the product in the UI anymore on the product list page http://localhost:3000/collection.

[
  {
    "product": {
      "name": "Arms Wax",
      "description": "Waxing treatment of an arm region include after wax treatment and hot towelling"
    },
    "categories": [
      {
        "id": "cat_31q0o3LD15DdjR",
        "slug": "treatments-body-waxing",
        "name": "Body Treatment (Waxing)"
      }
    ],
    "variant": [
      {
        "name": "Service",
        "options": [
          {
            "description": "Half Arm",
            "price": "30.00"
          },
          {
            "description": "Full Arm",
            "price": "40.00"
          },
          {
            "description": "Underarms",
            "price": "15.00"
          }
        ]
      }
    ]
  },
...
]

But if I remove the "variant" field again so it is as shown below instead, and run yarn seed again, then the UI successfully loads that product in the UI again.

[
  {
    "product": {
      "name": "Arms Wax",
      "description": "Waxing treatment of an arm region include after wax treatment and hot towelling",
      "price": "30.00"
    },
    "categories": [
      {
        "id": "cat_31q0o3LD15DdjR",
        "slug": "treatments-body-waxing",
        "name": "Body Treatment (Waxing)"
      }
    ]
  },
...
]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
robbieaverillcommented, Dec 14, 2020

@ltfschoen please explore the 422 error for further information on why your API call is being rejected. If you have any more questions feel free to raise them on Slack or on our seeder repository. As far as I can see this issue is not a bug in this repository, so I’m going to close it 🙂 thanks for raising it though!

1reaction
robbieaverillcommented, Dec 14, 2020

Did your initial seeding request fail?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Variants not rendering when defined in the product.json seed file
When I run yarn seed it successfully seeds the 1st product named "Eyebrow Wax" (because it doesn't use the "variant" property), but it...
Read more >
Rails: Render JSON after Controller action results in "missing ...
I moved the render out of the block and got a Rails error telling me that I needed to define respond_to at the...
Read more >
Problem with JSON-LD code for product variants - Shopify ...
Solved: Hey there, We have a problem with JSON-LD code, that's why we can't fix an issue on Google Merchant Center: Mismatched value...
Read more >
Add a JSON rendering and variant to your page
Navigate to sitecore/Content/Tenant/Site/Presentation/Rendering Variants/JSON List, right-click JSON List, click Insert, and click JSON Variant ...
Read more >
Facts About: Naming and Labeling Varieties of Seed ...
This does not mean that all varieties must be marketed under a single name. In fact, some old varieties may be marketed legally...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found