1

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 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.