Exemple #1
0
        /// <summary>
        /// Removes all items from the shopping cart.
        /// </summary>
        public void RemoveAllItems()
        {
            OriginalCart.CartItems.ForEach(cartItem =>
            {
                mActivityLogger?.LogProductRemovedFromShoppingCartActivity(cartItem.SKU, cartItem.CartItemUnits);
            });

            ShoppingCartInfoProvider.EmptyShoppingCart(OriginalCart);
            mItems = null;
        }
Exemple #2
0
    protected void btnEmpty_Click(object sender, EventArgs e)
    {
        if (ShoppingCart != null)
        {
            // Do not empty cart if order is paid
            if (OrderIsPaid)
            {
                return;
            }

            ShoppingCartInfoProvider.EmptyShoppingCart(ShoppingCart);

            ReloadData();
        }
    }
    /// <summary>
    /// On btnEmpty click event.
    /// </summary>
    protected void btnEmpty_Click1(object sender, EventArgs e)
    {
        if (this.ShoppingCartInfoObj != null)
        {
            // Log activity "product removed" for all items in shopping cart
            string siteName = CMSContext.CurrentSiteName;
            if (!this.ShoppingCartControl.IsInternalOrder && (CMSContext.ViewMode == ViewModeEnum.LiveSite) && ActivitySettingsHelper.ActivitiesEnabledAndModuleLoaded(siteName) &&
                ActivitySettingsHelper.RemovingProductFromSCEnabled(siteName))
            {
                this.ShoppingCartControl.TrackActivityAllProductsRemovedFromShoppingCart(this.ShoppingCartInfoObj, siteName, this.ContactID);
            }

            ShoppingCartInfoProvider.EmptyShoppingCart(this.ShoppingCartInfoObj);
            ReloadData();
        }
    }
    protected void btnEmpty_Click1(object sender, EventArgs e)
    {
        if (ShoppingCart != null)
        {
            // Log activity "product removed" for all items in shopping cart
            string siteName = SiteContext.CurrentSiteName;
            if (!ShoppingCartControl.IsInternalOrder)
            {
                ShoppingCartControl.TrackActivityAllProductsRemovedFromShoppingCart(ShoppingCart, siteName, ContactID);
            }

            ShoppingCartInfoProvider.EmptyShoppingCart(ShoppingCart);

            ReloadData();
        }
    }