Update PR with new logic
This commit is contained in:
parent
85e3cee634
commit
5224eab917
|
@ -738,25 +738,12 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
return $this->get_items( 'shipping' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets shipping method title.
|
||||
*
|
||||
* @param array $shipping_method
|
||||
*/
|
||||
public function set_shipping_method( $shipping_method ) {
|
||||
$this->set_prop( 'shipping_method', $shipping_method );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets formatted shipping method title.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_shipping_method( $context = 'view' ) {
|
||||
if ( 'edit' === $context ) {
|
||||
return $this->get_prop( 'shipping_method' );
|
||||
}
|
||||
|
||||
public function get_shipping_method() {
|
||||
$names = array();
|
||||
foreach ( $this->get_shipping_methods() as $shipping_method ) {
|
||||
$names[] = $shipping_method->get_name();
|
||||
|
|
|
@ -299,7 +299,9 @@ class WC_Checkout {
|
|||
$order->{"set_{$key}"}( $value );
|
||||
|
||||
// Store custom fields prefixed with wither shipping_ or billing_. This is for backwards compatibility with 2.6.x.
|
||||
} elseif ( 0 === stripos( $key, 'billing_' ) || 0 === stripos( $key, 'shipping_' ) ) {
|
||||
// TODO: Fix conditional to only include shipping/billing address fields in a smarter way without str(i)pos.
|
||||
} elseif ( ( 0 === stripos( $key, 'billing_' ) || 0 === stripos( $key, 'shipping_' ) )
|
||||
&& ! in_array( $key, array( 'shipping_method', 'shipping_total', 'shipping_tax' ) ) ) {
|
||||
$order->update_meta_data( '_' . $key, $value );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@ class WC_Order extends WC_Abstract_Order {
|
|||
'date_modified' => null,
|
||||
'discount_total' => 0,
|
||||
'discount_tax' => 0,
|
||||
'shipping_method' => '',
|
||||
'shipping_total' => 0,
|
||||
'shipping_tax' => 0,
|
||||
'cart_tax' => 0,
|
||||
|
|
|
@ -66,7 +66,6 @@ class WC_Order_Data_Store_CPT extends Abstract_WC_Order_Data_Store_CPT implement
|
|||
'_shipping_address_index',
|
||||
'_recorded_sales',
|
||||
'_recorded_coupon_usage_counts',
|
||||
'_shipping_method',
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -173,7 +172,6 @@ class WC_Order_Data_Store_CPT extends Abstract_WC_Order_Data_Store_CPT implement
|
|||
'_date_completed' => 'date_completed',
|
||||
'_date_paid' => 'date_paid',
|
||||
'_cart_hash' => 'cart_hash',
|
||||
'_shipping_method' => 'shipping_method',
|
||||
);
|
||||
|
||||
$props_to_update = $this->get_props_to_update( $order, $meta_key_to_props );
|
||||
|
|
Loading…
Reference in New Issue