Esempio n. 1
0
    /****************************************************************
     *
     * AddToCart()
     *
     ***************************************************************/
    protected void AddToCart(string sGUID, int nQty)
    {
        productGUID = new Guid(sGUID);
        try
        {
            product = ProductController.GetProductDeepByGUID(productGUID);
            //make sure we have a product
            TestCondition.IsTrue(product.IsLoaded, "Invalid url/product id");

            //set the page variables
            productID        = product.ProductID;
            productSku       = product.Sku;
            product.Quantity = nQty;

            OrderController.AddCallCenterItem(product);

            /********************
             * //* the following if stmt is to track orders from TheLoveDepot.com 2/10
             * string sID = "";
             * sID = HttpContext.Current.Request.Cookies["ID"].Value;
             * if (sID != null)
             * {
             *  Order currentOrder = OrderController.GetCurrentOrder();
             *  OrderController.AddNote(sID, currentOrder);
             * }
             **************/
        }
        catch (Exception ex)
        {
            LovRubLogger.LogException(ex);
            throw ex;
        }
    }
Esempio n. 2
0
    /****************************************************************
     *
     * AddToCart()
     *
     * *************************************************************/
    void AddToCart(string sGUID, int nQty)
    {
        //string sFemaleProductGUID = "f6d3b994-d5ca-491f-b55a-f22fa8974b25";
        productGUID = new Guid(sGUID);
        try
        {
            product = ProductController.GetProductDeepByGUID(productGUID);
            //make sure we have a product
            TestCondition.IsTrue(product.IsLoaded, "Invalid url/product id");

            //set the page variables
            productID        = product.ProductID;
            productSku       = product.Sku;
            product.Quantity = nQty;
            OrderController.AddCallCenterItem(product);

            //**********************************************************************************
            // Add keycode for OrderMotion
            // but only add one note, so check to see if the keycode note has already been added.
            //**********************************************************************************
            bool bIsCallCtrOrder = false;
            currentOrder = OrderController.GetCurrentOrder();
            OrderNoteCollection noteCollection = currentOrder.Notes;
            int nCount = noteCollection.Count;
            for (int nIndex = 0; nCount > nIndex; nIndex++)
            {
                OrderNote note = noteCollection[nIndex];
                //if (note.Equals("CALLCENTER"))
                if (true == note.Note.Equals("CALLCENTER"))
                {
                    bIsCallCtrOrder = true;
                    break;
                }
            }
            if (false == bIsCallCtrOrder)
            {
                OrderController.AddNote("CALLCENTER", currentOrder);
            }
        }
        catch (Exception ex)
        {
            LovRubLogger.LogException(ex);
            throw ex;
        }
    }
Esempio n. 3
0
    /****************************************************************
     *
     * AddToCart()
     *
     * *************************************************************/
    void AddToCart(string sGUID, int nQty)
    {
        productGUID = new Guid(sGUID);
        try
        {
            product = ProductController.GetProductDeepByGUID(productGUID);
            //make sure we have a product
            TestCondition.IsTrue(product.IsLoaded, "Invalid url/product id");

            //set the page variables
            productID        = product.ProductID;
            productSku       = product.Sku;
            product.Quantity = nQty;
            OrderController.AddCallCenterItem(product);
        }
        catch (Exception ex)
        {
            LovRubLogger.LogException(ex);
            throw ex;
        }
    }
Esempio n. 4
0
    protected void AddFreeItemToCart()
    {
        int nCartItems = OrderController.GetCartItemCount();

        bool bAddFreeItem = false;

        int nTotalQty          = 0;
        int nMaleFullQty       = 0;
        int nMaleDiscountQty   = 0;
        int nFemaleFullQty     = 0;
        int nFemaleDiscountQty = 0;
        int nRL6FullQty        = 0;
        int nRLG6DiscountQty   = 0;
        int nRLFreeQty         = 0;
        int nSeasonalQty       = 0;
        int nSurvivalFullQty   = 0;
        int nChocBDFullQty     = 0;
        int nCherBDFullQty     = 0;

        int nLipLovFullQty     = 0;
        int nLipLovDiscountQty = 0;
        int nFullQty           = 0;
        int nFreeItemsToAdd    = 0;


        if (true == OrderController.IsFreeItemInCart())
        {
            return;
        }

        // Calculate total, male, female, RubLov qty

        /****** commented out 11/24/09 removed discounts
         * OrderController.DetermineBasketContents(
         *                                      out nTotalQty,
         *                                      out nMaleFullQty,
         *                                      out nMaleDiscountQty,
         *                                      out nFemaleFullQty,
         *                                      out nFemaleDiscountQty,
         *                                      out nRL6FullQty,
         *                                      out nRLG6DiscountQty,
         *                                      out nRLFreeQty,
         *                                      out nSeasonalQty,
         *                                      out nLipLovFullQty,
         *                                      out nLipLovDiscountQty,
         *                                      out nSurvivalFullQty);
         ****** commented out 11/24/09 removed discounts ************/

        OrderController.DetermineBasketContents(
            out nTotalQty,
            out nMaleFullQty,
            out nFemaleFullQty,
            out nRL6FullQty,
            out nRLFreeQty,
            out nLipLovFullQty,
            out nSurvivalFullQty,
            out nChocBDFullQty,
            out nCherBDFullQty);
        // should be 1 freebie per order.
        if ((nTotalQty > 0) && (0 == nRLFreeQty))
        {
            nFreeItemsToAdd = 1;
        }

        if (nFreeItemsToAdd > 0)
        {
            try
            {
                string sFreeMassageGelGUID      = "f7ada596-0385-4314-8b13-bd949d3856f0";
                Guid   productGUID              = new Guid(sFreeMassageGelGUID);
                Commerce.Common.Product product = ProductController.GetProductDeepByGUID(productGUID);
                product.Quantity = nFreeItemsToAdd;
                OrderController.AddCallCenterItem(product);
            }
            catch (Exception ex)
            {
                LovRubLogger.LogException(ex);
                throw ex;
            }
        }
    }