I've found this great solution to display related products based on a product attribute, but additionally we would like to do the same with our upsells . What I've tried so far doesn't work yet because I believe we have to add some additonal information as the related_products function is not the same as upsells. add_filter( 'woocommerce_upsell_products', 'upsell_products_by_attribute', 10, 3 ); function upsell_products_by_attribute( $upsells,...
Originally asked by Jonas on Stack Exchange (stackoverflow) (CC BY-SA 4.0).