Skip to content

Commit

Permalink
Themes - fix issue with false upgrade CTA for some free themes. (#94634)
Browse files Browse the repository at this point in the history
* use themeTier instead of Wporg check for upgrade cta for community themes

* add comment
  • Loading branch information
Addison-Stavlo authored Sep 17, 2024
1 parent 2cf3125 commit d41b06a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions client/my-sites/theme/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,6 @@ const ThemeSheetWithOptions = ( props ) => {
isPremium,
isThemePurchased,
isStandaloneJetpack,
isWporg,
demoUrl,
showTryAndCustomize,
isThemeInstalled,
Expand All @@ -1514,7 +1513,7 @@ const ThemeSheetWithOptions = ( props ) => {
isThemeBundleWooCommerce,
} = props;
const isThemeAllowed = useIsThemeAllowedOnSite( siteId, props.themeId );

const themeTier = useThemeTierForTheme( props.themeId );
let defaultOption;
let secondaryOption = 'tryandcustomize';
const needsJetpackPlanUpgrade = isStandaloneJetpack && isPremium && ! isThemePurchased;
Expand Down Expand Up @@ -1547,14 +1546,14 @@ const ThemeSheetWithOptions = ( props ) => {
! ( isSiteWooExpressFreeTrial && isThemeBundleWooCommerce )
) {
defaultOption = 'upgradePlanForBundledThemes';
} else if ( isWporg && ! canInstallThemes ) {
}
// isWporgTheme is true for some free themes we offer, so we need to check the tier instead.
else if ( themeTier === 'community' && ! canInstallThemes ) {
defaultOption = 'upgradePlanForDotOrgThemes';
} else {
defaultOption = 'activate';
}

const themeTier = useThemeTierForTheme( props.themeId );

return (
<ConnectedThemeSheet
{ ...props }
Expand Down

0 comments on commit d41b06a

Please sign in to comment.