Dynamicweb 8 Documentation
ProductVariantExists Method
Example 

The product.
The variant ID.
If variant exists return true.
Syntax
'Declaration
 
Public Shared Function ProductVariantExists( _ 
   ByVal prod As Product, _ 
   ByVal varId As String _ 
) As Boolean
public static bool ProductVariantExists( 
   Product prod,
   string varId 
)

Parameters

prod
The product.
varId
The variant ID.
Example
class MyPage : System.Web.UI.Page
{
   private void UpdateStock(Dynamicweb.eCommerce.Orders.Order order)
   {
       foreach (Dynamicweb.eCommerce.Orders.OrderLine orderLine in order.OrderLines)
       {
           if (Product.ProductVariantExists(orderLine.Product, orderLine.ProductVariantID))
           {
               //TODO: insert your code here
           }
       }
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Product Class
Product Members

Send Feedback