Page 1 of 1

Accessing Billing Country from OnePageCheckout

Posted: Wed Nov 18, 2009 12:59 pm
by jsmits
I am trying to show a custom payment method based on whether the billing address is in the US or not. So I thought I could just check if BillToCountry.SelectedValue != "US", but this isn't always available as once the edit billing panel is closed then the the SelectedValue becomes "" .

So how can I tell if the BillToCountry is != "US" once the edit panel is closed?

Re: Accessing Billing Country from OnePageCheckout

Posted: Thu Nov 19, 2009 3:21 am
by mazhar
In ConLIb/OnePageCheckout.ascx.cs file locate BindPaymentForms method locate following code

Code: Select all

        if (phPaymentForms.Controls.Count > 0)
and then you can put following code just about it

Code: Select all

        if (basket.User.PrimaryAddress.Country == "US")
        { 
            //show your cutom payment 
        }
finally put your code in braces to handle your requirement.