Fixed undefined $image_id in WC_Product_Variation::get_image_id()

This commit is contained in:
Claudio Sanches 2016-11-10 17:11:21 -02:00
parent 4dc32da477
commit da72a76089
1 changed files with 4 additions and 3 deletions

View File

@ -270,12 +270,13 @@ class WC_Product_Variation extends WC_Product_Simple {
* @return string
*/
public function get_image_id( $context = 'view' ) {
$value = $this->get_prop( 'image_id', $context );
$image_id = $this->get_prop( 'image_id', $context );
if ( 'view' === $context && ! $image_id ) {
$value = $this->parent_data['image_id'];
$image_id = $this->parent_data['image_id'];
}
return $value;
return $image_id;
}
/*