Error in function wc_get_product_purchase_price
-
PHP Fatal error: Uncaught Error: Call to a member function get_price() on
bool: wp-content/plugins/woocommerce-jetpack/includes/functions/wcj-functions-price-currency.php:616
Not its:function wc_get_product_purchase_price( $product_id = 0 ) { if ( 0 === $product_id ) { $product_id = get_the_ID(); } $product = wc_get_product( $product_id ); $product_price = ( isset( $product ) && $product->get_price() ) ? $product->get_price() : 0; if ( ! $product ) { return 0; } //... }
Must be
function wc_get_product_purchase_price( $product_id = 0 ) { if ( 0 === $product_id ) { $product_id = get_the_ID(); } $product = wc_get_product( $product_id ); if ( ! $product ) { return 0; } $product_price = $product->get_price(); //... }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Error in function wc_get_product_purchase_price’ is closed to new replies.