Support » Plugin: WooCommerce » fatal error uncaught error call to a member function get_price() on null

  • Resolved Tanmoy Biswas

    (@biswas87)


    HI,
    please help me….
    When I import, WooCommerce product, showing the following errors.

    fatal error uncaught error call to a member function get_price() on null in home/xxx/public_html/wp-content/plugins/woocommerce/inc/wc-products-functions.php 1046.

    I have added these codes in the fucntions.php file.

    add_filter( 'woocommerce_get_price_html', 'sv_change_product_price_display' );
    function sv_change_product_price_display( $price, $product  ) {
      global $product;
      if ( $product->is_type('variable') ) return $price;
      $price_excl_tax = wc_get_price_excluding_tax( $product ); 
      $price_incl_tax = wc_get_price_including_tax( $product ); 
      $price = '<p class="price">' . __("Ex. VAT:") . wc_price( $price_excl_tax ) . '</p>';
      $price .= '<p class="price-incl">' . __("Incl. VAT:") . wc_price( $price_incl_tax ) . '</p>';
    
       return $price;
     }

    Someone, please help me

    Thanks

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘fatal error uncaught error call to a member function get_price() on null’ is closed to new replies.