• Resolved daniel217

    (@daniel217)


    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();
    	//...
    }

    • This topic was modified 8 months, 3 weeks ago by daniel217.
    • This topic was modified 8 months, 3 weeks ago by daniel217.
Viewing 1 replies (of 1 total)
  • Plugin Support David G

    (@gravid7)

    Hi @daniel217,

    Thanks for your suggestion.

    We have added it to our to-do list, and we will try to address this in our upcoming updates.

Viewing 1 replies (of 1 total)
  • The topic ‘Error in function wc_get_product_purchase_price’ is closed to new replies.