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?