an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > Shipping Auto Calculation in Order Checkout
Last Post 6/10/2009 1:51:41 PM By Bahram. 1 replies.
6/8/2009 12:08:56 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Shipping Auto Calculation in Order Checkout
Hi Luke,
 
We have a flat rate of Shipping based on Invoice total, and I need the Shipping Rate step on Order Confirmation
be automatically selected. without  the need of user select
 
 
Please guide me how  make shipment calculated automatically on order
There is the code on SelectShipmentMethod .
I have one option on Radio button and want to be autoselected .
 
 
Bahram
6/10/2009 1:51:41 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Shipping Auto Calculation in Order Checkout
 
Hi,This is my solution, please let me know if anything is missing from your point
 
1- I created a new method in SelectShippingMethod class :

    public void AutoSelect()
    {
        base.DataBind();
        pnlEmpty.Visible = false;
        SiteConfigurationSection section = SiteConfigurationSection.GetSection();
        methods = ShippingService.GetShippingMethods(ShippingPackage.GetShippingPackage(Cart.Get(),
            (Address)Session["ShippingAddress"], section.LocationCountry, section.LocationState, section.LocationCity, section.LocationZipcode));
        rptShippingMethods.DataSource = methods;
        rptShippingMethods.DataBind();
        Session["ShippingMethod"] = methods[0];
       
    }

2 - On OnepageCheckOut.ascx.cs on Page_Load, I added :

                if (CheckoutPaymentTypeEnum.PaypalExpress != paymentOption.CheckoutPaymentType) {
                    BindShippingAddress();
                    //Auto Select Shipping .... By Bahram
                    selectShippingMethod.AutoSelect();
                 
                }