public void OnPickupPreferenceDeleted(object sender, EventArgs e)
        {
            var args = e as DeliveryOptionEventArgs;

            if (args != null)
            {
                _pickupRrefList =
                    (Page as ProductsBase).GetShippingProvider()
                    .GetPickupLocationsPreferences((Page as ProductsBase).DistributorID,
                                                   (Page as ProductsBase).CountryCode);
                if (_pickupRrefList.Count > 0)
                {
                    PickupLocationPreference_V01 pref = _pickupRrefList.First();
                    updateShippingInfo(ProductsBase.ShippingAddresssID, pref.PickupLocationID,
                                       DeliveryOptionType.PickupFromCourier);
                }
                else
                {
                    ProductsBase.ClearCart();
                }
                populateDropdown();
            }
            //   ucShippingInfoControl.Hide();
            reload();
            if (_pickupRrefList.Count == 0)
            {
                setAddressByNickName(null);
                ProductsBase.ClearCart();
            }
        }
Пример #2
0
 /// <summary>
 ///     The do cart empty.
 /// </summary>
 private void doCartEmpty()
 {
     if (ShoppingCart != null)
     {
         if (!ShoppingCart.CartItems.Count.Equals(0))
         {
             ProductsBase.ClearCart();
         }
     }
 }
Пример #3
0
 protected virtual void shippingAddressDeleted(ShippingAddress_V02 shippingAddress)
 {
     _shippingAddresses = ShippingProvider.GetShippingAddresses(DistributorID, Locale);
     // this is to get primary address, if previous one deleted
     //DeliveryOption deliveryOption = getSelectedAddress(args.ShippingAddress.ID, DeliveryOptionType.Shipping);
     if (_shippingAddresses != null)
     {
         //After delete pass the primary shipping ID to update shipping info..
         if (_shippingAddresses.Count > 0)
         {
             DeliveryOption primaryDeliveryOption = _shippingAddresses.Find(s => s.IsPrimary);
             if (primaryDeliveryOption != null)
             {
                 updateShippingInfo(primaryDeliveryOption.ID, ProductsBase.DeliveryOptionID,
                                    DeliveryOptionType.Shipping);
             }
         }
         else
         {
             ProductsBase.ClearCart();
         }
         reload();
     }
 }