Created
March 29, 2022 07:43
-
-
Save sergiu-radu/46d3971076169f71894d42e45dfdca5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp', function () { | |
if (! get_theme_mod('blocksy_has_checkout_coupon', false)) { | |
remove_action('woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10); | |
} | |
}); | |
if (! class_exists('FluidCheckout')) { | |
add_action('woocommerce_checkout_before_customer_details', function () { | |
echo '<div class="ct-customer-details">'; | |
}, PHP_INT_MIN); | |
add_action('woocommerce_checkout_after_customer_details', function () { | |
echo '</div>'; | |
}, PHP_INT_MAX); | |
add_action('woocommerce_checkout_before_order_review_heading', function () { | |
echo '<div class="ct-order-review">'; | |
}, PHP_INT_MIN); | |
add_action('woocommerce_checkout_after_order_review', function () { | |
echo '</div>'; | |
}, PHP_INT_MAX); | |
} | |
add_action( | |
'woocommerce_before_template_part', | |
function ($template_name, $template_path, $located, $args) { | |
if (! class_exists('Woocommerce_German_Market')) { | |
return; | |
} | |
if ($template_name !== 'checkout/form-checkout.php') { | |
return; | |
} | |
ob_start(); | |
}, | |
1, | |
4 | |
); | |
add_action( | |
'woocommerce_after_template_part', | |
function ($template_name, $template_path, $located, $args) { | |
if (! class_exists('Woocommerce_German_Market')) { | |
return; | |
} | |
if ($template_name !== 'checkout/form-checkout.php') { | |
return; | |
} | |
$result = ob_get_clean(); | |
echo str_replace( | |
'<h3 id="order_review_heading">', | |
'<div class="ct-order-review"><h3 id="order_review_heading">', | |
$result | |
); | |
}, | |
1, | |
4 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment