I am trying to create a new product by nothing happens, I don't get any exception or nothing - am i missing something??
code:
Dynamicweb.eCommerce.Products.Product newProduct = new Dynamicweb.eCommerce.Products.Product();
// newProduct.ID = "prod5";
newProduct.Number = "fkjjkhf";
newProduct.LanguageID = "LANG1";
newProduct.Name = "name1";
newProduct.DefaultPrice = 103.5d; // netpris...
newProduct.LongDescription = "long desc";
newProduct.Save("prod5", string.Empty);
Best regards
Ole
Developer forum
E-mail notifications
Problem creating a product
Posted on 29/11/2010 13:45:28
Replies
Nicolai Høeg Pedersen
Posted on 29/11/2010 14:43:03
Does it not show up in database or in backend?
You probably need to put the product to a group before it shows up in the backend:
Dim pgr As New ProductGroupRelation(prodId, groupId)
pgr.ProductID = prodId
pgr.GroupID = groupId
pgr.Save(prodId, groupId)
You probably need to put the product to a group before it shows up in the backend:
Dim pgr As New ProductGroupRelation(prodId, groupId)
pgr.ProductID = prodId
pgr.GroupID = groupId
pgr.Save(prodId, groupId)
Posted on 29/11/2010 14:55:21
It doesn't show up in the database...
I've tried your suggestion but it makes no difference - still nothing..
I've also tried it like this:
newProduct.Groups.Add(group);
but still no products
I've tried your suggestion but it makes no difference - still nothing..
I've also tried it like this:
newProduct.Groups.Add(group);
but still no products
Nicolai Høeg Pedersen
Posted on 29/11/2010 15:12:44
It might also be your save statement with the product id parameter.
Have a look at this example:
http://engage.dynamicweb-cms.com/api/ecommerce/?Dynamicweb~Dynamicweb.eCommerce.Products.Product~Save().html
Have a look at this example:
http://engage.dynamicweb-cms.com/api/ecommerce/?Dynamicweb~Dynamicweb.eCommerce.Products.Product~Save().html
Posted on 29/11/2010 17:20:42
Thanks, that helped!!
I did try the save function with no parameters before, so I guess it was some default properties on the product object I needed to set.
The sample link you gave me worked.
Thanks again...
Best regards
Ole
PS! You don't need to put the product on a group for it to work..
If you want to put it on a group, you have to use the ProductGroupRelation object like this:
ProductGroupRelation pgr = new ProductGroupRelation();
pgr.GroupID = "GROUP25";
pgr.Sorting = 1;
pgr.ProductID = "prod6";
pgr.Save("prod6", "GROUP25");
I did try the save function with no parameters before, so I guess it was some default properties on the product object I needed to set.
The sample link you gave me worked.
Thanks again...
Best regards
Ole
PS! You don't need to put the product on a group for it to work..
If you want to put it on a group, you have to use the ProductGroupRelation object like this:
ProductGroupRelation pgr = new ProductGroupRelation();
pgr.GroupID = "GROUP25";
pgr.Sorting = 1;
pgr.ProductID = "prod6";
pgr.Save("prod6", "GROUP25");
You must be logged in to post in the forum