Skip to content

Instantly share code, notes, and snippets.

@vendidero
Last active Jan 11, 2022
Embed
What would you like to do?
Disable checkout adjustments by Germanized
<?php
// Re-switch order review and payment (Germanized switches priorities to show the order review table last)
add_action( 'after_setup_theme', 'my_child_adjust_checkout', 20 );
function my_child_adjust_checkout() {
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 20 );
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 10 );
add_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );
add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
}
// Disable inserting a fallback submit button
add_filter( 'woocommerce_gzd_insert_order_submit_fallback', '__return_false' );
// Prevent inserting a custom submit button by Germanized
remove_action( 'woocommerce_review_order_before_submit', 'woocommerce_gzd_template_set_order_button_remove_filter', 1500 );
remove_action( 'woocommerce_review_order_after_submit', 'woocommerce_gzd_template_set_order_button_show_filter', 1500 );
remove_action( 'woocommerce_gzd_review_order_before_submit', 'woocommerce_gzd_template_set_order_button_show_filter', 1500 );
// Init hooks
add_action( 'init', 'my_child_remove_gzd_init_hooks', 50 );
function my_child_remove_gzd_init_hooks() {
// Remove additional submit button
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_gzd_template_order_submit', 21 );
// Remove checkboxes
remove_action( 'woocommerce_review_order_after_payment', 'woocommerce_gzd_template_render_checkout_checkboxes', 10 );
// Readd before submit button
add_action( 'woocommerce_review_order_before_submit', 'woocommerce_gzd_template_render_checkout_checkboxes', 10 );
// Remove additional choose payment gateway title
remove_action( 'woocommerce_review_order_before_payment', 'woocommerce_gzd_template_checkout_payment_title' );
}
// Disable adjusting payment and order review heading
add_filter( 'wc_gzd_checkout_params', 'my_child_prevent_gzd_checkout_heading_switch', 10 );
function my_child_prevent_gzd_checkout_heading_switch( $params ) {
$params['adjust_heading'] = false;
return $params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment