Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Displaying product attributes hook (exclude certain category)

$
0
0

Replies: 0

Hello

I’m using following hook to display product attribute in invoice:

add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_show_product_attributes', 10, 3 );
function wpo_wcpdf_show_product_attributes ( $template_type, $item, $order ) {
    if(empty($item['product'])) return;
    $document = wcpdf_get_document( $template_type, $order );
    printf('<div class="product-attribute">Attribute name: %s</div>', $document->get_product_attribute('Attribute name', $item['product']));
}

But is it possible to exclude certain category products? I need to display product attribute with all products in all categories except one specific category.

Is it possible somehow to modify this hook to exclude certain category products?

Thanks in advance!


Viewing all articles
Browse latest Browse all 59525

Trending Articles