• dreamwalker22

    (@dreamwalker22)


    Hi everyone,

    I’m having trouble with aligning the Express Checkout button on my WooCommerce checkout page for tablet and mobile views. I moved the Express Checkout button to display above all payment methods using this PHP code from this thread 8 month ago:

    add_action('init', function() {
    remove_action('woocommerce_checkout_before_customer_details', ['WC_Stripe_Field_Manager', 'output_banner_checkout_fields']);
    add_action('woocommerce_review_order_before_payment', ['WC_Stripe_Field_Manager', 'output_banner_checkout_fields']);
    });

    While this works well on desktop, I’m facing alignment issues on tablet and mobile screens. The button doesn’t stay centered with the other elements in these views.

    Computer: https://imgur.com/Bd9kpC9

    Tablet: https://imgur.com/TE7cks3

    Mobile: https://imgur.com/SVx11qa

    I’ve also tried using the following CSS to center-align it specifically for smaller screens, but it doesn’t seem to work as expected:

    /* For tablets (up to 768px width) */
    @media (max-width: 768px) {
    .wc-stripe-banner-checkout.active {
    width: 100%;
    max-width: 450px; /* Adjust this width if needed */
    margin: 0 auto;
    display: flex;
    justify-content: center;
    }
    }

    /* For mobile devices (up to 480px width) */
    @media (max-width: 480px) {
    .wc-stripe-banner-checkout.active {
    width: 100%;
    max-width: 400px; /* Adjust this width if needed for mobile */
    margin: 0 auto;
    display: flex;
    justify-content: center;
    }
    }

    Unfortunately, this CSS does not resolve the issue, and the button remains misaligned on mobile and tablet.

    Could anyone advise on why this might be happening or suggest an alternative solution to center-align the Express Checkout button on tablet and mobile devices?

    PS. I’m using Elementor Pro for the checkout page and Astra theme for my site.

    Any help would be greatly appreciated!

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @dreamwalker22

    Can you share a product page url to your site so your checkout page can be reviewed? It will be easier to suggest what CSS changes you need if your checkout page can be reviewed.

    Kind Regards

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @dreamwalker22

    I was able to review your checkout page based on another support thread you had created. The following CSS should resolve your mobile view styling.

    .wc-stripe-banner-checkout.active{
    max-width: 100% !important;
    }

    The key part is the !important statement which gives that CSS priority.

    Kind Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.