Hi,
i’m trying to use the new wixStoresBackend API
but i can update some of my product parameters
i think its a BUG but i hope i’m wrong
i tried lots of variation of this without fully success
i seceded to update the product name , price and SKU
bat not inStock and not additionalInfoSections (there are the most impotent to me)
this is my backend test code:
import wixStoresBackend from 'wix-stores-backend';
export function updateProductFieldsBackend() {
productId = "1d4452cb-d8d6-ffe0-a29e-d2a38d991aff" // one of my products
wixStoresBackend.updateProductFields(productId, {
"name": "change product name test",
"price": 150,
"sku": "SKU test",
"inStock": true,
"additionalInfoSections": [{ "title": "title test", "description": "discription test" }]
})
}
thanks for the helpers
1 Like
Are you sure you can use an array?
Yes, should be array
But the inStock also not working
The function updateProductFields() uses the object ProductInfo to define what fields are to be updated. The options inStock and additionalInfoSections are not listed in the possible options that can be updated.
There is other way to update them?
When i use the create product i can add them to the new product?
there is a way to add to product custom metaData that can use without the customer to see it?
@Yisrael: Yes that is true it only uses the ProductInfo object which does not include additionalInfoSection.
But that does not make any sense to define it like that. Why should I be allowed to change a products description but not to change the additionalInfoSection?
And why are invisible Products exluded from the database? There is no way to access a invisible Product by code.
@mschukraft as a work aorund you cna create another colleciton with reference to the products collection. Its tedious works, as you have to add, remove references whenever theres a cahnge, but at least you can keep going on with ur project. When and if WiX gives the option to code more fields by code that would be a bliss. As well as been able to add fields by code to the products collection