Payment options not showing up on custom page

Hi guys. I’ve setup a custom landing page, custom shop archive, custom cart page, and custom checkout page for a specific client. The users are shown these pages if they add a category that matches. So far everything works perfect, except the checkout page. Square doesn’t show the credit card input fields.

Square does show the input fields on the cart page selected in Woocommerce settings, but I need to have 2 custom cart pages. One for regular users, and one for this specific client. How can I make the input fields show up on my custom cart page?
I tried adding some JS without any luck. Here is what I have:

  • Display Square plugin on default and custom WooCommerce checkout pages
    */
    function display_square_plugin_on_checkout_pages() {
    // Check if WooCommerce is active
    if ( ! class_exists( ‘WooCommerce’ ) ) {
    return;
    }

    // Check if Square plugin is active
    if ( ! class_exists( ‘WC_Square’ ) ) {
    return;
    }

    // Get the current page URL
    $current_url = esc_url( add_query_arg( array() ) );

    // Define the default WooCommerce checkout page URL
    $default_checkout_url = wc_get_checkout_url();

    // Define your custom WooCommerce checkout page URL
    $custom_checkout_url = ‘https://apparelup.us/checkout-eoh/’; // Replace with your custom checkout page URL

    // Check if the current page is the default WooCommerce checkout page or the custom checkout page
    if ( $current_url === $default_checkout_url || $current_url === $custom_checkout_url ) {
    // Display the Square plugin on the checkout page
    WC_Square::display_square_embedded_payment_form();
    }
    }

// Hook the function to the ‘woocommerce_before_checkout_form’ action
add_action( ‘woocommerce_before_checkout_form’, ‘display_square_plugin_on_checkout_pages’ );

can anyone provide any input on how to get the credit card inpout fields to show on both the default woocommerce page and my custom page?

1 Like

Is this a custom integration or are you using the WooCommerce integration. If your using the WooCommerce integration that isn’t really customizable outside of what WooCommerce offers. :slightly_smiling_face:

Hi, I’m using the Sqaure Woocommerce plugin. I’m able to use other payment gateway plugins, and they show on any checkout page, whether it’s custom or not.

Square Woocommerce plugin is the only one I’ve tried so far which won’t show up. I can see it load, just not the fields needed to input card details. Taking a look at the Firefox’s inspector, I can see that an iframe doesn’t load on the custom page. I guess I was trying to find a way to initialize it

1 Like

The WooCommerce plugin isn’t designed to be customized outside of what WooCommerce offers. If you want a customer checkout page you’ll need to build it with our Web Payments SDK and use our APIs to process payments. :slightly_smiling_face: