diff --git a/includes/class-modal-checkout.php b/includes/class-modal-checkout.php index 6d795ea27..b04296e56 100644 --- a/includes/class-modal-checkout.php +++ b/includes/class-modal-checkout.php @@ -219,9 +219,8 @@ function ( $item ) { } /** Apply NYP custom price */ - $is_product_nyp = \Newspack_Blocks::can_use_name_your_price() ? \WC_Name_Your_Price_Helpers::is_nyp( $product_id ) : false; - $price = filter_input( INPUT_GET, 'price', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); - if ( $is_product_nyp ) { + $price = filter_input( INPUT_GET, 'price', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); + if ( \Newspack_Blocks::can_use_name_your_price() ? \WC_Name_Your_Price_Helpers::is_nyp( $product_id ) : false ) { if ( empty( $price ) ) { $price = \WC_Name_Your_Price_Helpers::get_suggested_price( $product_id ); } diff --git a/src/blocks/donate/frontend/class-newspack-blocks-donate-renderer-base.php b/src/blocks/donate/frontend/class-newspack-blocks-donate-renderer-base.php index 78972b8aa..2063591fb 100644 --- a/src/blocks/donate/frontend/class-newspack-blocks-donate-renderer-base.php +++ b/src/blocks/donate/frontend/class-newspack-blocks-donate-renderer-base.php @@ -81,10 +81,8 @@ public static function get_configuration( $attributes ) { $configuration['defaultFrequency'] = $attributes['defaultFrequency']; - $is_manual = Newspack_Blocks::can_use_name_your_price() && ! empty( $attributes['manual'] ); - /* If block is in "manual" mode, override certain state properties with values stored in attributes */ - if ( $is_manual ) { + if ( Newspack_Blocks::can_use_name_your_price() && ! empty( $attributes['manual'] ) ) { // Migrate old attributes. if ( empty( $attributes['amounts'] ) && isset( $attributes['suggestedAmounts'] ) ) { $other_amount = $configuration['amounts']['month'][3];