Setup variable to prevent a notice if no variable data is set.

This commit is contained in:
Barry Kooij 2014-09-16 13:21:09 +02:00
parent d6c1643a12
commit b1daae5d0d
1 changed files with 3 additions and 0 deletions

View File

@ -138,6 +138,9 @@ class WC_Product_Variation extends WC_Product {
} elseif ( 'variation_data' === $key ) { } elseif ( 'variation_data' === $key ) {
$all_meta = get_post_meta( $this->variation_id ); $all_meta = get_post_meta( $this->variation_id );
// The variation data array
$this->variation_data = array();
// Get the variation attributes from meta // Get the variation attributes from meta
foreach ( $all_meta as $name => $value ) { foreach ( $all_meta as $name => $value ) {
if ( ! strstr( $name, 'attribute_' ) ) { if ( ! strstr( $name, 'attribute_' ) ) {