I use Umbraco 7.2.6 (also 7.2.5) and uWebShop 2.6.1
I have a problem during updating Product via Umbraco Web API.
After updating product with Umbraco Management API, content is visible in Umbraco back-office, updated and published. But this product is not available via uWebShop API (for example method Catalog.GetAllProducts()) and also this product is not available via url http://{host}/{category}/{product}, but I can rich it via normal Umbraco url http://{host}/catalog/categories/{category}/{product}.
if after updating product via ContentService API, I click "Save and Publish" in back office for this product, it become available via url and uWbShop API.
Please look at litle bit simplified code for updating content in UmbracoWebApiControiller:
If i understand you correctly. You want to update a product. but you are using the IContent. Shouldent you be using the IProduct instead or is that just me ? Otherwise everything looks good, can ou explain what the problem is ?
Thanks for your answer. I use IContent because IProduct interface can be used only for read product properties, IProduct has properties with "get" only.
So my problem is that uWebshop know nothing about product which updated with IContent. I can't use uWebShop API and Url which uWebShop generates for this product.
Please advice proper solution how to update uWebshop Product properties (predefined and my custom) via code, not in CMS back-office.
I was creating an update script the other day, and found out the SetValue is not permitted when updating values, so what you are doing is correct, but the code is a bit wrong. Try and do these changes
Updating uWebShop product via Umbraco Web Api
Hello,
I use Umbraco 7.2.6 (also 7.2.5) and uWebShop 2.6.1 I have a problem during updating Product via Umbraco Web API.
After updating product with Umbraco Management API, content is visible in Umbraco back-office, updated and published. But this product is not available via uWebShop API (for example method Catalog.GetAllProducts()) and also this product is not available via url http://{host}/{category}/{product}, but I can rich it via normal Umbraco url http://{host}/catalog/categories/{category}/{product}. if after updating product via ContentService API, I click "Save and Publish" in back office for this product, it become available via url and uWbShop API.
Please look at litle bit simplified code for updating content in UmbracoWebApiControiller:
I would be happy to get any advice how to fix it. I also published this qurestion here: https://github.com/uWebshop/uWebshop-Releases/issues/52
Thanks in advance, Andriy
HI Andriy
If i understand you correctly. You want to update a product. but you are using the IContent. Shouldent you be using the IProduct instead or is that just me ? Otherwise everything looks good, can ou explain what the problem is ?
Hi Casper.
Thanks for your answer. I use IContent because IProduct interface can be used only for read product properties, IProduct has properties with "get" only.
So my problem is that uWebshop know nothing about product which updated with IContent. I can't use uWebShop API and Url which uWebShop generates for this product.
Please advice proper solution how to update uWebshop Product properties (predefined and my custom) via code, not in CMS back-office.
Best regards, Andriy.
Ok. What i think you might want is this.
Hope this helps and answers your question.
Hi Casper. No. It is not what I want. I need to change product info, like change picture, title, description, price.
Hi andriye, i have an idea that might work.
I was creating an update script the other day, and found out the SetValue is not permitted when updating values, so what you are doing is correct, but the code is a bit wrong. Try and do these changes
change
product.SetValue("url" , model.Url);
into
product.Properties["url"].Value = model.Url
Hope this does the trick.
Hi Casper.
thanks for good news. I will check this in next couple of days. and let you know about results.
thanks Andriy
Did you ever resolve this issue ?
is working on a reply...