Solves Cross-Sells display variable product (#37616)
Solved cross-sells display issue on cart
This commit is contained in:
parent
4145b6e0f7
commit
0ae9ec0844
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fixed Cross-Sells display variable product
|
|
@ -822,6 +822,11 @@ class WC_Cart extends WC_Legacy_Cart {
|
|||
if ( $values['quantity'] > 0 ) {
|
||||
$cross_sells = array_merge( $values['data']->get_cross_sell_ids(), $cross_sells );
|
||||
$in_cart[] = $values['product_id'];
|
||||
|
||||
// Add variations to the in cart array.
|
||||
if ( $values['data']->is_type( 'variation' ) ) {
|
||||
$in_cart[] = $values['variation_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue