Woocommerce - Retrieve shipping class
问题 I use following code on external script to retrieve all products (simple and variable): $args = array( 'post_type' => array('product', 'product_variation'), 'numberposts' => -1, 'post_status' => 'publish', ); $shop_products = get_posts( $args ); foreach ($shop_products as $item) { echo $item->ID.": shipping class is -> ".$item->get_shipping_class()."<br>"; } I need to create a list of product with their own shipping class, but it doesn't works. It shows me the error " Call to undefined method