I’m attempting to add products to my store via code. The following code works (mostly) and my product successfully appears in the store and in the collection (which I can view from the collections manager).
But, the additionalInfoSections is not being put into the store product database and doesn’t appear in the store listing.
I note that the API doc for createProduct() doesn’t actually mention the additionalInfoSections property. But I figured this was just a documentation oversight (like the fact that the doc says that the “productType” is optional but if I leave it out it rejects with a message ‘productType is not optional’).
Also, the additionalInfoSections property is mentioned in the documentation in the return value section. So I figure if it’s there, you must be able to set it somehow, right?
Maybe I’ve just got a syntax error in the additionalInfoSections part of my NewProduct declaration (see below)? But, the product does get created, just with a an empty additionalInfoSections property.
Here’s the Wix doc:
(https://www.wix.com/velo/reference/wix-stores-backend/createproduct)
Any ideas?
NewProduct = {
"name": "myName",
"description": "Produce Description goes here"",
"price": 1.00,
"sku":toStringX(Now.getTime()),
"productType" : "physical", //doc says optional but fails if missing
"additionalInfoSections" : [{"title" : "THIS IS SECTION TITLE", "description" : "This is the product description"}, {"title" : "THIS IS A DIFFERENT SECTION", "description" : "This is the description in a different section"}]
}
createProduct(NewProduct)
.then((CreateProductBEResult)=>{