#Seed products with categories

12 messages · Page 1 of 1 (latest)

turbid plank
#

Hello. Is there any natural way to specify product categories in seed.json?

native belfry
#

can you elaborate what you're looking for @turbid plank?

If you mean can you seed categories, currently you can add this in your seed.json to seed categories

{
  "store": {},
  "users": [],
  "regions": [],
  "shipping_options": [],
  "products": [],
  "categories":[
    {
      "name":"Men",
      "rank":0,
      "category_children":[
        {
          "name":"Clothing",
          "rank":0,
          "category_children":[],
          "handle":"men/clothing"
        }
      ],
      "handle":"men"
    },
  ]
}

turbid plank
#

@Riqwan, I am looking for a way to link these specified categories to the product

Like the screenshot

native belfry
#

try this and see if it works -

"categories": [{ id: "category1" }]
turbid plank
native belfry
#

which version are you using?

turbid plank
#

I will try to use the new version

#

Same behavior

#

I have not found in the documentation that such a scenario has been considered

native belfry
#

Try with the latest version, we had made some changes regarding this one.

turbid plank