1
votes

Warning: Missing argument 2 for action_woocommerce_before_single_product(), called in /home/crskin/domains/cre8skin.lt/public_html/wp-includes/class-wp-hook.php on line 298 and defined in /home/crskin/domains/cre8skin.lt/public_html/wp-content/themes/purelyshopping-child/functions.php on line 43 test

How do I interpret this?

The code I have is:

<?php
do_action( 'woocommerce_before_single_product' );

function action_woocommerce_before_single_product($wc_print_notices, $int) { 
echo ("test");
}; 
add_action ('woocommerce_before_single_product', 'action_woocommerce_before_single_product', 10, 2);
?>
1

1 Answers

1
votes

Your error message is saying that this function: action_woocommerce_before_single_product() is missing the second argument. In this case, from what I see in the function you have; it would be the $int parameter.

To fix this problem you need to call that function you have and add both parameters, $wc_print_notices and $int in the call.

Specifically to this case you need to look at how you are calling it in your add_action() function.