Dynamicweb 8 Documentation
RemoveNoneActiveProducts Method
Example 

Removes all orderlines that is of type Product and that no longer exist in the database. Also removes products according to the control panel settings: Active, on stock, price is zero.
Syntax
'Declaration
 
Public Sub RemoveNoneActiveProducts() 
public void RemoveNoneActiveProducts()
Example
class MyPage : System.Web.UI.Page
{
   public void SaveToSession(Dynamicweb.eCommerce.Orders.Order EcomCart)
   {
       //Process the cart and save it to session
       {
           if (EcomCart != null)
           {
               //Save the cart
               //Note: Cart must be saved in a session variable BEFORE the call to RemoveNoneActiveProducts below.
               //Otherwise an infinite loop could be made!
               Dynamicweb.eCommerce.Common.Context.SetCart(EcomCart);

               //Remove cached prices
               EcomCart._CachedPrice = null;
               EcomCart._CachedPriceBeforeFees = null;

               //Check if all the products are still available
               EcomCart.RemoveNoneActiveProducts();
           }
       }
   }
}
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

Order Class
Order Members

Send Feedback