diff --git a/includes/class-wc-product-variable.php b/includes/class-wc-product-variable.php index ec5e23d6f16..44dfa72a5ed 100644 --- a/includes/class-wc-product-variable.php +++ b/includes/class-wc-product-variable.php @@ -606,7 +606,7 @@ class WC_Product_Variable extends WC_Product { 'image_srcset' => $image_srcset ? $image_srcset : '', 'image_sizes' => $image_sizes ? $image_sizes : '', 'price_html' => apply_filters( 'woocommerce_show_variation_price', $variation->get_price() === "" || $this->get_variation_price( 'min' ) !== $this->get_variation_price( 'max' ), $this, $variation ) ? '' . $variation->get_price_html() . '' : '', - 'availability_html' => wc_get_product_stock_html( $variation ), + 'availability_html' => wc_get_stock_html( $variation ), 'sku' => $variation->get_sku(), 'weight' => $variation->get_weight() ? $variation->get_weight() . ' ' . esc_attr( get_option( 'woocommerce_weight_unit' ) ) : '', 'dimensions' => $variation->get_dimensions(), diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index e22da3a06b3..1908030238f 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -2471,14 +2471,14 @@ function wc_display_product_attributes( $product ) { * @param WC_Product $product * @return string */ -function wc_get_product_stock_html( $product ) { +function wc_get_stock_html( $product ) { ob_start(); wc_get_template( 'single-product/stock.php', array( 'product' => $product, ) ); - return apply_filters( 'woocommerce_get_product_stock_html', ob_get_clean(), $product ); // @todo map old woocommerce_stock_html filter to this + return apply_filters( 'woocommerce_get_stock_html', ob_get_clean(), $product ); // @todo map old woocommerce_stock_html filter to this } /** diff --git a/templates/single-product/add-to-cart/grouped.php b/templates/single-product/add-to-cart/grouped.php index 0e8d988a70b..c4eae1ef513 100644 --- a/templates/single-product/add-to-cart/grouped.php +++ b/templates/single-product/add-to-cart/grouped.php @@ -70,7 +70,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?> get_price_html(); - echo wc_get_product_stock_html( $product ); + echo wc_get_stock_html( $product ); ?> diff --git a/templates/single-product/add-to-cart/simple.php b/templates/single-product/add-to-cart/simple.php index 0015392fa6a..592bbeeff11 100644 --- a/templates/single-product/add-to-cart/simple.php +++ b/templates/single-product/add-to-cart/simple.php @@ -26,7 +26,7 @@ if ( ! $product->is_purchasable() ) { return; } -echo wc_get_product_stock_html( $product ); +echo wc_get_stock_html( $product ); if ( $product->is_in_stock() ) : ?>