x

Remove Digital Wallet from one Page Only

I'm using the Square Payment Gateway on my wordpresss/woocommerce site. I have an issue with the Digital Wallet option with one of my products that is a composite. When a user selects the "Buy Now" option on the composite product, none of the fields that are required i.e. Items selected to make up the composite product, stops the "Buy Now" function from working unlike the "Add To Cart" function which will prompt the user to select the composite components. 

 

I would like to prevent the Digital Wallet from showing up on the composite product page. I found the snippet that will exclude the Digital Wallet snippet from showing on all product, cart or checkout page (see below) but I just want the snippet to run on one page (the composite product page)

 

add_filter( 'wc_square_display_digital_wallet_on_pages', function( $pages ) {
return array(
/* 'product', // Don't show Apple Pay and Google Pay on product pages */
'cart',
'checkout',
);
}, 10, 1 );

 

Anyone knows how to exclude just one page? I found the following on the web but don't know how to add it to the above with out creating errors.

 

if ( ! is_page( 'Page Name' ) ) return;
263 Views
Message 1 of 1
Report
0 REPLIES 0