This members-only tutorial shows how we can create a custom function that returns a count of the number of linked upsell products for a WooCommerce product and use this via the Dynamic Data condition to have an element be output only if there is at least 1 upsell (or conversely if there is no upsells if that is what you want) on single product pages.
Note: This is where/how we can specify upsells for products:
Install and activate Code Snippets plugin.
Go to Snippets > Add New.
Title: [WooCommerce] Get the number of upsells
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $499 one-time).
Already a member? Log in below or here.