我有以下代码在控制器中返回 3 个选项之一(“请检查可用性”、“低库存”或“可用”)。如何更改视图(第二部分以显示“此处”链接,该链接将打开一个新窗口,指向“www.google.com”等外部网址?
第一部分是控制器,第二部分是视图。谢谢
if (model.ShowInventoryAvailability)
{
// Check to see if the system allows for webbackorder. If it does then we will say that we have 'available' inventory.
if (ApplicationSetting.GetByNameBoolean("Web_AllowBackOrder", true, "") && orderLine.Product.TrackInventory)
{
var inv = (Int32)(orderLine.Product.QtyOnHand - totalOrdered);
if (inv <= 0)
line.Availability = "Please check availability" ;
else if (inv < model.InventoryLowStockQuantity)
line.Availability = "Low Stock";
else
line.Availability = "Available";
}
else
{ }
}
@if (Model.ShowInventoryAvailability)
{
<td class="os-availability">
@cartLine.Availability
</td>
}