Created
September 14, 2023 15:37
-
-
Save PluginRepublicSupport/fa62a853d7a2f72d0decabf04a533ef1 to your computer and use it in GitHub Desktop.
Show product-addon fields before WooCommerce product variations
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 | |
function tester_remove_fields_from_before_button() { | |
global $product; | |
if ( $product->get_type() == 'variable' ) { | |
remove_action( 'woocommerce_before_add_to_cart_button', 'pewc_product_extra_fields' ); | |
add_action( 'woocommerce_before_variations_form', 'pewc_product_extra_fields' ); | |
} | |
} | |
add_action( 'woocommerce_before_add_to_cart_form', 'tester_remove_fields_from_before_button' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment