In the Woocommerce documentation, the woocommerce_get_price_html
filter hook located in get_price_html()
method is supposed to take a callback that accepts up to two parameters, a price and a product.
But when I try to access the product, I get a NULL
instead of the WC_Product Object.
Here is my testing code:
add_filter( 'woocommerce_get_price_html', function( $price, $item ) {
echo var_dump ($item); // NULL
return $price;
});
Am I missing something?