Snippet runs in functions.php but not in the Snippet plugin
-
Hi,
I have a code snippet provided by a plugin support to impeach their commission system to create commissions over Sub-orders in Woocommerce.
Here is the code
if ( class_exists( 'YITH_Stripe_Connect' ) ) { if ( ! function_exists( 'yith_wcsc_process_order_commissions_custom' ) ) { function yith_wcsc_process_order_commissions_custom( $value, $order_id ) { $is_suborder = wp_get_post_parent_id( absint( $order_id ) ); if ( $is_suborder ) { $value = false; } return $value; } add_filter( 'yith_wcsc_process_order_commissions', 'yith_wcsc_process_order_commissions_custom', 10, 2 ); } }It works fine if I set it in functions.php but does not run in the snippet plugin. I guess this is because the snippet runs before the theme loading or something. Any clue?
Thanks a lot for your help and your time.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Snippet runs in functions.php but not in the Snippet plugin’ is closed to new replies.