heres the method in my service in my plugin.
private void InsertSyncProd(List<MWProduct> inserted)
{
var model = inserted.Select(x =>
{
var row = new Product()
{
Sku = x.Sku.ToString(),
ShortDescription = x.ShortDescription,
Name = x.Name,
Height = x.Pd_height,
Width = x.Pd_width,
Length = x.Pd_depth,
ProductType = ProductType.SimpleProduct,
ParentGroupedProductId = 0,
VisibleIndividually = true,
FullDescription = x.ShortDescription,//this will change in future
ShowOnHomePage = false,
Published = false,
};
//should i call prod service insert here? do i need more data?
_productService.InsertProduct(row);
return row;
});
}
Now is this fine,will the service take care of the missing fields? is there certain requirments?
As far as i checked, it only appears product service class method InsertProduct, is just a normal insert statment. So im worried I'll end up putting in bad data.
So is this correct? or is this not, if so whats a better way?