Skip to content

Commit

Permalink
chore: remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoo committed Jan 30, 2024
1 parent 3701068 commit 42e145b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions includes/class-modal-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 42e145b

Please sign in to comment.