mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-01 11:52:25 +08:00
7 lines
378 B
Text
7 lines
378 B
Text
add_action( 'woocommerce_after_cart_item_name', 'wc_stock_and_backorder_cart_item_title', 9999, 2 );
|
|
|
|
function wc_stock_and_backorder_cart_item_title( $cart_item, $cart_item_key ) {
|
|
$product = $cart_item['data'];
|
|
if ( $product->backorders_require_notification() && $product->is_on_backorder( $cart_item['quantity'] ) ) return;
|
|
echo wc_get_stock_html( $product );
|
|
}
|