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?
Accessing Billing Country from OnePageCheckout
Re: Accessing Billing Country from OnePageCheckout
In ConLIb/OnePageCheckout.ascx.cs file locate BindPaymentForms method locate following code
and then you can put following code just about it
finally put your code in braces to handle your requirement.
Code: Select all
if (phPaymentForms.Controls.Count > 0)
Code: Select all
if (basket.User.PrimaryAddress.Country == "US")
{
//show your cutom payment
}