Merge pull request #7925 from dominic-p/order-meta-undefined-key
Prevent notices if variation_id isn't set
This commit is contained in:
commit
b82339a4cb
|
@ -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' ) . ')';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue