Product ID Confidence Check

This commit is contained in:
Christopher Allford 2024-09-16 13:49:58 -07:00
parent fbebfa7616
commit faccbbdb30
No known key found for this signature in database
GPG Key ID: 80E44C778F08A88E
1 changed files with 6 additions and 7 deletions

View File

@ -1881,15 +1881,14 @@ class ProductCollection extends AbstractBlock {
}
$product = wc_get_product( $collection_args['upsellsProductReference'] );
$upsells = array_map(
function ( $id ) {
return strval( $id );
},
$product->get_upsell_ids()
);
if ( ! $product ) {
return array(
'post__in' => array( -1 ),
);
}
return array(
'post__in' => $upsells,
'post__in' => $product->get_upsell_ids(),
);
},
function ( $collection_args, $query ) {