From d695a141edcc8f20905cc11d7d2c421d6f285dc6 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 14 Apr 2017 13:32:14 +0100 Subject: [PATCH] Variations were not correctly inheriting the parent image or shipping class id --- includes/class-wc-product-variation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-product-variation.php b/includes/class-wc-product-variation.php index 846c9d8836d..9019e6e7c11 100644 --- a/includes/class-wc-product-variation.php +++ b/includes/class-wc-product-variation.php @@ -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;