Setup variable to prevent a notice if no variable data is set.
This commit is contained in:
parent
d6c1643a12
commit
b1daae5d0d
|
@ -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_' ) ) {
|
||||||
|
|
Loading…
Reference in New Issue