Skip to content

Commit

Permalink
fix(modal-checkout): force checkout registration option
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenn00dle committed Dec 17, 2024
1 parent fef66e1 commit e6fe3d8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion includes/class-modal-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public static function init() {
add_filter( 'googlesitekit_adsense_tag_blocked', [ __CLASS__, 'is_modal_checkout' ] );
add_filter( 'jetpack_active_modules', [ __CLASS__, 'jetpack_active_modules' ] );
add_filter( 'woocommerce_checkout_update_order_review_expired', [ __CLASS__, 'is_not_modal_checkout_filter' ] );
add_filter( 'woocommerce_checkout_registration_enabled', [ __CLASS__, 'is_modal_checkout_filter' ] );

// Make the current cart price available to the JavaScript.
add_action( 'wp_ajax_get_cart_total', [ __CLASS__, 'get_cart_total_js' ] );
Expand Down Expand Up @@ -1782,7 +1783,19 @@ public static function subscriptions_gifting_label() {
}

/**
* Filter the a value dependent on the page not being modal checkout.
* Filter a value to true dependent on the page not being modal checkout.
*
* @param bool $value The value.
*/
public static function is_modal_checkout_filter( $value ) {
if ( self::is_modal_checkout() ) {
return true;
}
return $value;
}

/**
* Filter a value to false dependent on the page not being modal checkout.
*
* @param bool $value The value.
*/
Expand Down

0 comments on commit e6fe3d8

Please sign in to comment.