Developer Resources for AbleCommerce eCommerce platform
CommerceBuilder.Orders Namespace / Basket Class / ContainsProduct Method
Id of the product to check for
In This Topic
    ContainsProduct Method
    In This Topic
    Indicates whether a product with given product id exists in this basket
    Syntax
    [Obsolete("Use LINQ instead: basket.Items.Count(item => item.ProductId == productId) > 0")]
    public virtual bool ContainsProduct( 
       int productId
    )

    Parameters

    productId
    Id of the product to check for

    Return Value

    true if product exists, false otherwise
    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