[solved] Woocommerce Upsells Condition

Hi

I would like to place a heading above the cross/upsell products on single-product page.
But this heading should only show up if there are cross/upsell products present.

Can someone help me with the condition I have to setup? (If this is even possible)

Thank you

I found out that there is a heading option in the Bricks element for up/cross-sells
So this is solved for me :slight_smile:

This is how I did it…

function related_upsell_products()
{   
    if (is_product()) {
        $product_id = get_the_ID();
	    $product = wc_get_product( $product_id );
        $upsell_ids = $product->get_upsell_ids();
        return $upsell_ids;
    }
}

and using Condition on the element:
Dynamic Data
{echo:related_upsell_products}
is not empty

1 Like