Variations were not correctly inheriting the parent image or shipping class id

This commit is contained in:
Mike Jolley 2017-04-14 13:32:14 +01:00
parent 124f41a2b7
commit d695a141ed
1 changed files with 2 additions and 2 deletions

View File

@ -314,7 +314,7 @@ class WC_Product_Variation extends WC_Product_Simple {
$image_id = $this->get_prop( 'image_id', $context );
if ( 'view' === $context && ! $image_id ) {
$value = apply_filters( $this->get_hook_prefix() . 'image_id', $this->parent_data['image_id'], $this );
$image_id = apply_filters( $this->get_hook_prefix() . 'image_id', $this->parent_data['image_id'], $this );
}
return $image_id;
@ -331,7 +331,7 @@ class WC_Product_Variation extends WC_Product_Simple {
$shipping_class_id = $this->get_prop( 'shipping_class_id', $context );
if ( 'view' === $context && ! $shipping_class_id ) {
$value = apply_filters( $this->get_hook_prefix() . 'shipping_class_id', $this->parent_data['shipping_class_id'], $this );
$shipping_class_id = apply_filters( $this->get_hook_prefix() . 'shipping_class_id', $this->parent_data['shipping_class_id'], $this );
}
return $shipping_class_id;