0

I need the shipping class cost of products.

 $order = new WC_Order( $order_id );
 $items = $order->get_items();
 foreach ($items as $item) {
     $product = new WC_Product($item['product_id']);
     $shipping_class_id = $product->get_shipping_class_id();
 }

How can I fetch shipping class cost based on shipping class id?

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
user1994
  • 17
  • 1
  • 6

1 Answers1

0

WooCommerce: Shipping classes are independent from Shipping Zones and Methods. Shipping class cost depends on the customer location and on the selected shipping method.

So the answer is its not possible

mujuonly
  • 11,370
  • 5
  • 45
  • 75