WooCommerce报错 Uncaught Error: Call to a member function get_type() on null

我们需要把$product->get_type(); 修改为: $product->product_type; https://docs.woocommerce.com/wc-apidocs/class-WC_Product.html#_get_type