Initial display of add order item buttons Fixes #5991

Also Closes #5994
This commit is contained in:
Mike Jolley 2014-08-12 12:54:41 +01:00
parent e4d0a6daef
commit 5bc293a69c
2 changed files with 4 additions and 2 deletions

View File

@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
</td>
<?php
if ( ! $legacy_order && 'yes' == get_option( 'woocommerce_calc_taxes' ) ) :
if ( isset( $legacy_order ) && ! $legacy_order && 'yes' == get_option( 'woocommerce_calc_taxes' ) ) :
$line_tax_data = isset( $item['line_tax_data'] ) ? $item['line_tax_data'] : '';
$tax_data = maybe_unserialize( $line_tax_data );

View File

@ -3,6 +3,8 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
global $wpdb;
// Get the payment gateway
$payment_gateway = wc_get_payment_gateway_by_order( $order );
@ -10,7 +12,7 @@ $payment_gateway = wc_get_payment_gateway_by_order( $order );
$line_items = $order->get_items( apply_filters( 'woocommerce_admin_order_item_types', 'line_item' ) );
// Check if order can be edited
$can_be_edited = in_array( $order->get_status(), apply_filters( 'wc_order_can_be_edited', array( 'pending', 'on-hold' ) ) );
$can_be_edited = in_array( $order->get_status(), apply_filters( 'wc_order_can_be_edited', array( 'pending', 'on-hold', 'auto-draft' ) ) );
if ( 'yes' == get_option( 'woocommerce_calc_taxes' ) ) {
$order_taxes = $order->get_taxes();