Skip to content

Commit 69d27f5

Browse files
authored
Hide PRB box in checkout block when PRBs disabled (#2337)
* Hide PRB box in checkout block when PRBs disabled, it checks the parent PRB enable/disable setting first
1 parent 4c1cd8e commit 69d27f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

includes/class-wc-stripe-blocks-support.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ private function should_show_payment_request_button() {
185185
// TODO: Remove the `function_exists()` check once the minimum WP version has been bumped
186186
// to version 5.0.
187187
if ( function_exists( 'has_block' ) ) {
188+
// Don't show if PRBs are turned off entirely.
189+
if ( ! isset( $this->settings['payment_request'] ) || 'yes' !== $this->settings['payment_request'] ) {
190+
return false;
191+
}
192+
188193
// Don't show if PRBs are supposed to be hidden on the cart page.
189194
if (
190195
has_block( 'woocommerce/cart' )

0 commit comments

Comments
 (0)