@@ -35,7 +35,7 @@ import { getAffiliateCouponLabel } from '../../utils';
35
35
import { AkismetProQuantityDropDown } from './akismet-pro-quantity-dropdown' ;
36
36
import { ItemVariationPicker } from './item-variation-picker' ;
37
37
import type { OnChangeAkProQuantity } from './akismet-pro-quantity-dropdown' ;
38
- import type { OnChangeItemVariant } from './item-variation-picker' ;
38
+ import type { OnChangeItemVariant , WPCOMProductVariant } from './item-variation-picker' ;
39
39
import type {
40
40
ResponseCart ,
41
41
RemoveProductFromCart ,
@@ -387,8 +387,7 @@ function LineItemWrapper( {
387
387
const isJetpack = responseCart . products . some ( ( product ) =>
388
388
isJetpackPurchasableItem ( product . product_slug )
389
389
) ;
390
-
391
- const variants = useGetProductVariants ( product , ( variant ) => {
390
+ const variantsFilterCallback = ( variant : WPCOMProductVariant ) => {
392
391
// Only show term variants which are equal to or longer than the variant that
393
392
// was in the cart when checkout finished loading (not necessarily the
394
393
// current variant). For WordPress.com only, not Jetpack, Akismet or Marketplace.
@@ -403,12 +402,12 @@ function LineItemWrapper( {
403
402
return true ;
404
403
}
405
404
406
- if ( isStreamlinedPrice ) {
407
- return true ;
408
- }
409
-
410
405
return variant . termIntervalInMonths >= initialVariantTerm ;
411
- } ) ;
406
+ } ;
407
+ const variants = useGetProductVariants (
408
+ product ,
409
+ ! isStreamlinedPrice ? variantsFilterCallback : undefined
410
+ ) ;
412
411
413
412
const areThereVariants = variants . length > 1 ;
414
413
0 commit comments