bleh... nullref fix
This commit is contained in:
parent
50e9c7316f
commit
bf3456e534
|
|
@ -595,7 +595,7 @@ Output: [{""product"":""szőlő"",""quantity"":50}]";
|
|||
var products = await _productService.SearchProductsAsync(
|
||||
keywords: parsed.Product,
|
||||
pageIndex: 0,
|
||||
pageSize: 20); // Get up to 20 matches
|
||||
pageSize: 50); // Get up to 20 matches
|
||||
|
||||
if (!products.Any())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -366,10 +366,16 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Controllers
|
|||
|
||||
await ctx.ShippingDocuments.InsertAsync(shippingDocument);
|
||||
|
||||
foreach (var item in shippingDocument.ShippingItems)
|
||||
if(shippingDocument.ShippingItems != null)
|
||||
{
|
||||
var product = await ctx.Products.GetByIdAsync(item.ProductId);
|
||||
product.ProductCost = Convert.ToDecimal(item.UnitPriceOnDocument);
|
||||
foreach (var item in shippingDocument.ShippingItems)
|
||||
{
|
||||
var product = await ctx.Products.GetByIdAsync(item.ProductId);
|
||||
if(product != null)
|
||||
{
|
||||
product.ProductCost = Convert.ToDecimal(item.UnitPriceOnDocument);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return await ctx.ShippingDocuments.GetByIdAsync(shippingDocument.Id, shippingDocument.Shipping != null || shippingDocument.Partner != null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue