mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-30 11:42:22 +08:00
8 lines
382 B
Text
8 lines
382 B
Text
add_action( 'woocommerce_after_cart_item_name', 'wc_sku_below_cart_item_name', 11, 2 );
|
|
|
|
function wc_sku_below_cart_item_name( $cart_item, $cart_item_key ) {
|
|
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
|
|
$sku = $_product->get_sku();
|
|
if ( ! $sku ) return;
|
|
echo '<p><small>SKU: ' . $sku . '</small></p>';
|
|
}
|