-
-
Save tamarazuk/0bb754e26c1292e113ce to your computer and use it in GitHub Desktop.
<?php | |
// Reposition Checkout Addons to under Order Notes | |
function sv_wc_checkout_addons_change_position() { | |
return 'woocommerce_after_order_notes'; | |
} | |
add_filter( 'wc_checkout_add_ons_position', 'sv_wc_checkout_addons_change_position' ); |
Hi, you can make it work like this (in your child theme functions.php ):
// Move Checkout Addons to under Order Notes
function sv_wc_move_checkout_addons() {
global $wc_checkout_add_ons;
if ( isset( $wc_checkout_add_ons->frontend ) ) {
remove_action( 'woocommerce_checkout_after_customer_details', array( $wc_checkout_add_ons->frontend, 'render_add_ons' ) );
add_action( 'woocommerce_after_order_notes', array( $wc_checkout_add_ons->frontend, 'render_add_ons' ) );
}
}
add_action( 'init', 'sv_wc_move_checkout_addons', 100 );
@tamarazuk I'm having some trouble setting this up, the original code just removes the addons altogether
and while the code provided by @Viure works, it makes the addons appear twice - it seems the remove_action doesn't work properly.
Hi evryone
can someone help me,
if I want to move the checkout addons in to order details-shipping options table under shipping options
what code need to use?
thanks!
Hi all,
Unfortunately Gist comments don't produce notifications 😦. I've updated the gist to ensure it works with current version of both WordPress and Checkout Add-ons. I have also removed the
<?php
tag - this used to be required for syntax highlighting but it no longer is 💃