Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Telerik.Sitefinity.Ecommerce.Catalog.Model;
- using Telerik.Sitefinity.Model;
- using Telerik.Sitefinity.Modules.Ecommerce.Catalog;
- namespace SitefinityWebApp
- {
- public class SetCustomFieldValueOfProduct
- {
- public static void SetCustomFieldValue(Guid productId, string customFieldName, string customFieldValue)
- {
- CatalogManager catalogManager = CatalogManager.GetManager();
- Product product = catalogManager.GetProduct(productId);
- if (product == null)
- {
- return; // Product does not exist
- }
- product.SetValue(customFieldName, customFieldValue);
- catalogManager.SaveChanges();
- }
- }
- }
Add Comment
Please, Sign In to add comment