Merge pull request #7925 from dominic-p/order-meta-undefined-key

Prevent notices if variation_id isn't set
This commit is contained in:
Mike Jolley 2015-04-13 10:53:49 +01:00
commit b82339a4cb
1 changed files with 2 additions and 2 deletions

View File

@ -18,9 +18,9 @@ if ( ! defined( 'ABSPATH' ) ) {
echo '<strong>' . __( 'Product ID:', 'woocommerce' ) . '</strong> ' . absint( $item['product_id'] );
if ( $item['variation_id'] && 'product_variation' === get_post_type( $item['variation_id'] ) ) {
if ( ! empty( $item['variation_id'] ) && 'product_variation' === get_post_type( $item['variation_id'] ) ) {
echo '<br/><strong>' . __( 'Variation ID:', 'woocommerce' ) . '</strong> ' . absint( $item['variation_id'] );
} elseif ( $item['variation_id'] ) {
} elseif ( ! empty( $item['variation_id'] ) ) {
echo '<br/><strong>' . __( 'Variation ID:', 'woocommerce' ) . '</strong> ' . absint( $item['variation_id'] ) . ' (' . __( 'No longer exists', 'woocommerce' ) . ')';
}