Rename method

This commit is contained in:
Mike Jolley 2016-10-20 15:07:50 +01:00
parent b6deb23e5c
commit 9a8681a713
4 changed files with 5 additions and 5 deletions

View File

@ -606,7 +606,7 @@ class WC_Product_Variable extends WC_Product {
'image_srcset' => $image_srcset ? $image_srcset : '', 'image_srcset' => $image_srcset ? $image_srcset : '',
'image_sizes' => $image_sizes ? $image_sizes : '', '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 ) ? '<span class="price">' . $variation->get_price_html() . '</span>' : '', 'price_html' => apply_filters( 'woocommerce_show_variation_price', $variation->get_price() === "" || $this->get_variation_price( 'min' ) !== $this->get_variation_price( 'max' ), $this, $variation ) ? '<span class="price">' . $variation->get_price_html() . '</span>' : '',
'availability_html' => wc_get_product_stock_html( $variation ), 'availability_html' => wc_get_stock_html( $variation ),
'sku' => $variation->get_sku(), 'sku' => $variation->get_sku(),
'weight' => $variation->get_weight() ? $variation->get_weight() . ' ' . esc_attr( get_option( 'woocommerce_weight_unit' ) ) : '', 'weight' => $variation->get_weight() ? $variation->get_weight() . ' ' . esc_attr( get_option( 'woocommerce_weight_unit' ) ) : '',
'dimensions' => $variation->get_dimensions(), 'dimensions' => $variation->get_dimensions(),

View File

@ -2471,14 +2471,14 @@ function wc_display_product_attributes( $product ) {
* @param WC_Product $product * @param WC_Product $product
* @return string * @return string
*/ */
function wc_get_product_stock_html( $product ) { function wc_get_stock_html( $product ) {
ob_start(); ob_start();
wc_get_template( 'single-product/stock.php', array( wc_get_template( 'single-product/stock.php', array(
'product' => $product, '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
} }
/** /**

View File

@ -70,7 +70,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
<td class="price"> <td class="price">
<?php <?php
echo $product->get_price_html(); echo $product->get_price_html();
echo wc_get_product_stock_html( $product ); echo wc_get_stock_html( $product );
?> ?>
</td> </td>
</tr> </tr>

View File

@ -26,7 +26,7 @@ if ( ! $product->is_purchasable() ) {
return; return;
} }
echo wc_get_product_stock_html( $product ); echo wc_get_stock_html( $product );
if ( $product->is_in_stock() ) : ?> if ( $product->is_in_stock() ) : ?>