Disabling Checkout Button

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
15 years ago
I am using Google Checkout as my payment gateway, and therefore would like to disable the "Checkout" button on the shopping cart page.  Any thoughts on how to do this?
15 years ago
I actually figured this out by adding a Page_Load event to ordersummary.cs which checks to see if googlecheckout is the only payment method selected, and if so, hides the checkout button.

protected void Page_Load(object sender, EventArgs e)
        {

            //Hide then checkout button if "GoogleCheckout" in the only payment method enabled
            PaymentMethod googleCheckoutPaymentMethod = PaymentMethodManager.GetPaymentMethodBySystemKeyword("GoogleCheckout");
            PaymentMethodCollection aPaymentMethods = PaymentMethodManager.GetAllPaymentMethods();

            if (!googleCheckoutPaymentMethod.IsActive)
            {
                return;
            }

            foreach(PaymentMethod p in aPaymentMethods)
            {
                if(p.IsActive && p.SystemKeyword != "GoogleCheckout")
                {      
                    //need to show checkout button
                    this.btnCheckout.Visible = true;
                    return;
                }
            }
            //if we get here, then no payment method other than google is enabled, so disable the checkout button
            this.btnCheckout.Visible = false;

        }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.