コード例 #1
0
        public Collection <ShippingRateDisplay> GetRates(List <ShippingGroup> groups)
        {
            Accounts.Store currentStore = RequestContext.GetCurrentRequestContext().CurrentStore;

            Collection <ShippingRateDisplay> result = new Collection <ShippingRateDisplay>();

            MerchantTribe.Shipping.IShippingService p = Shipping.AvailableServices.FindById(this.ShippingProviderId, currentStore);
            if (p != null)
            {
                p.BaseSettings.Clear();
                p.BaseSettings.Merge(this.Settings);

                List <IShippingRate> tempRates = p.RateShipment(ConvertGroupsToShipments(groups));
                if (tempRates != null)
                {
                    for (int i = 0; i <= tempRates.Count - 1; i++)
                    {
                        ShippingRateDisplay r = new ShippingRateDisplay(tempRates[i]);
                        r.ShippingMethodId = this.Bvin;
                        if (r.DisplayName == string.Empty)
                        {
                            r.DisplayName = this.Name;
                        }
                        AdjustRate(r);
                        result.Add(r);
                    }
                }
            }

            return(result);
        }
コード例 #2
0
 private void LoadServiceCodes()
 {
     MerchantTribe.Shipping.IShippingService uspostal = AvailableServices.FindById(ShippingMethod.ShippingProviderId, CurrentStore);
     this.ShippingTypesCheckBoxList.DataSource     = uspostal.ListAllServiceCodes();
     this.ShippingTypesCheckBoxList.DataTextField  = "DisplayName";
     this.ShippingTypesCheckBoxList.DataValueField = "Code";
     this.ShippingTypesCheckBoxList.DataBind();
 }
コード例 #3
0
        private void LoadEditor()
        {
            System.Web.UI.Control tempControl = null;

            MerchantTribe.Shipping.IShippingService p = MerchantTribe.Commerce.Shipping.AvailableServices.FindById(m.ShippingProviderId, MTApp.CurrentStore);

            tempControl = ModuleController.LoadShippingEditor(p.Name, this);

            if (tempControl is BVShippingModule)
            {
                editor = (BVShippingModule)tempControl;
                if (editor != null)
                {
                    editor.BlockId        = m.Bvin;
                    editor.ShippingMethod = m;
                    this.phEditor.Controls.Add(editor);
                    this.editor.EditingComplete += this.editor_EditingComplete;
                }
            }
            else
            {
                this.phEditor.Controls.Add(new System.Web.UI.LiteralControl("Error, editor is not based on Content.BVShippingModule class"));
            }
        }