Skip to content

Instantly share code, notes, and snippets.

@hamidrezayazdani
Created September 20, 2021 20:38
Show Gist options
  • Save hamidrezayazdani/bd21960d72b656ee8f46ccb6ee050e1a to your computer and use it in GitHub Desktop.
Save hamidrezayazdani/bd21960d72b656ee8f46ccb6ee050e1a to your computer and use it in GitHub Desktop.
دریافت اطلاعات «روش‌های ارسال» سفارش خاص
<?php
$order = wc_get_order( $order_id );
$order_shipping_methods = $order->get_items( 'shipping' );
foreach ( order_shipping_methods as $item_id => $item ) {
$shipping_method_instance_id = $item->get_instance_id();
$shipping_method_id = $item->get_method_id();
$shipping_method_title = $item->get_method_title();
$order_item_name = $item->get_name();
$order_item_type = $item->get_type();
$shipping_method_total = $item->get_total();
$shipping_method_taxes = $item->get_taxes();
$shipping_method_total_tax = $item->get_total_tax();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment