如何在nopcommerce中添加产品?

时间:2012-09-13 23:30:02

标签: c# asp.net-mvc nopcommerce

我正在使用非商业V2.6。 所以我尝试在管理面板中添加新产品。 我输入所有数据,然后单击保存按钮或保存并继续编辑按钮。

我有这样的错误。

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:



Line 546:                //default product variant
Line 547:                var variant = model.FirstProductVariantModel.ToEntity();             
Line 548:                variant.ProductId = product.Id;
Line 549:                variant.Published = true;
Line 550:                variant.DisplayOrder = 1;

我的代码低于哪个有错误..

var variant = model.FirstProductVariantModel.ToEntity();             
                variant.ProductId = product.Id;
                variant.Published = true;
                variant.DisplayOrder = 1;
                variant.CreatedOnUtc = DateTime.UtcNow;
                variant.UpdatedOnUtc = DateTime.UtcNow;
                _productService.InsertProductVariant(variant);
                FirstVariant_UpdateLocales(variant, model.FirstProductVariantModel);

我该如何解决它..

Plz帮助...... Thankx

1 个答案:

答案 0 :(得分:1)

对于该产品,您必须在默认产品变体信息标签

下添加一个产品变体