只要检查一下,如果你有任何可用的应用程序,如果有,就回显它们。以下是一个示例:
add_action( \'woocommerce_after_shop_loop_item_title\', \'display_applications_attribute\', 5 );
function display_applications_attribute() {
global $product;
$applications = $product->get_attribute(\'pa_applications\');
if ( $applications ) {
printf(\'<span class="attribute-applications">Applications: %1$s</span>\', $applications );
}
}