Removed instances of WC_Order in favor to wc_get_order(), closes #8689

This commit is contained in:
Claudio Sanches 2015-07-30 15:07:34 -03:00
parent b28c6db7f5
commit 0361a10e26
3 changed files with 4 additions and 4 deletions

View File

@ -116,7 +116,7 @@ function wc_create_order( $args = array() ) {
update_post_meta( $order_id, '_order_version', WC_VERSION );
return new WC_Order( $order_id );
return wc_get_order( $order_id );
}
/**

View File

@ -765,7 +765,7 @@ function wc_get_payment_gateway_by_order( $order ) {
if ( ! is_object( $order ) ) {
$order_id = absint( $order );
$order = new WC_Order( $order_id );
$order = wc_get_order( $order_id );
}
return isset( $payment_gateways[ $order->payment_method ] ) ? $payment_gateways[ $order->payment_method ] : false;

View File

@ -14,7 +14,7 @@ class WC_Helper_Order {
*/
public static function delete_order( $order_id ) {
$order = new WC_Order( $order_id );
$order = wc_get_order( $order_id );
// Delete all products in the order
foreach ( $order->get_items() as $item ) :
@ -85,6 +85,6 @@ class WC_Helper_Order {
$order->set_total( 0, 'shipping_tax' );
$order->set_total( 40, 'total' ); // 4 x $10 simple helper product
return new WC_Order( $order->id );
return wc_get_order( $order->id );
}
}