-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable the "Preview & Customize" button for Premium and WooCommerce themes (on horizon) #85182
Conversation
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested:
- Go to the Theme Showcase page.
- Click the three-dot menu on a Premium (e.g., Hevor) or WooCommerce (e.g., Amulet) theme.
- Click the Preview & Customize button.
- ✅ Verify it redirects to the Site Editor and you're live-previewing the theme.
Regression testing for Simple sites;
- Click the three-dots menu on a Free (e.g., Epi) theme.
- Click the Preview & Customize button.
- ✅ Verify it redirects to the Site Editor and you're live-previewing the theme.
- Click the three-dots menu on a Partner (e.g., Eben) / wporg (e.g., Classified Listings) theme.
- ✅ Verify you don't see the Preview & Customize button.
…hemes (on horizon) (#85182)
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~67 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
*/ | ||
if ( | ||
config.isEnabled( 'themes/block-theme-previews-premium-and-woo' ) && | ||
( isThemePremium( state, themeId ) || isThemeWooCommerce( state, themeId ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @okmttdhr!
Me again. While working on the Sensei bundle themes, I'm comparing it with WooCommerce themes. So I just noticed this difference and I'd like to ask you if it should really be specific for WooCommerce, or for any bundle.
If for any bundle, I could change it as part of #84886. Probably using doesThemeBundleSoftwareSet
instead of isThemeWooCommerce
. Or if it's really only for WooCommerce, I'll leave it as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reaching out, @renatho!
This feature should be compatible with all Bundle themes in the future (CC: @Automattic/lego). However, several changes are needed to transition it from being Woo themes-specific to being applicable to Bundle themes. For example;
- The logic to decide if the site has the feature to use the theme:
Lines 30 to 34 in c228880
const canUseWooCommerceTheme = previewingThemeType === WOOCOMMERCE_THEME && [ WPCOM_FEATURES_PREMIUM_THEMES, FEATURE_WOOP, WPCOM_FEATURES_ATOMIC ].every( ( feature ) => activeFeatures.includes( feature ) ); - Is this condition the same for all Bundle themes?
- The plan they need:
Lines 119 to 126 in c228880
previewingTheme.type === WOOCOMMERCE_THEME ? /** * For a WooCommerce theme, the users should have the Business plan or higher, * AND the WooCommerce plugin has to be installed. */ generateCheckoutUrl( PLAN_BUSINESS ) : // For a Premium theme, the users should have the Premium plan or higher. generateCheckoutUrl( PLAN_PREMIUM ); - Is this condition the same for all Bundle themes?
- The display name of a theme type:
wp-calypso/apps/wpcom-block-editor/src/wpcom/features/live-preview/hooks/use-previewing-theme.ts
Line 47 in c228880
previewingThemeType === WOOCOMMERCE_THEME ? 'WooCommerce' : 'Premium'; - Can this be retrieved by
useBundleSettings
?
I would greatly appreciate it if you could implement all the changes simultaneously. But, if this isn't feasible, please leave it as it is, and I will file an issue to address it later. 🙂
For functionality testing: pekYwv-3xz-p2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @okmttdhr! 👋
please leave it as it is, and I will file an issue to address it later
After checking this a little, I think it would be the best approach. And if you want to reference me in the issue, I can help with what is needed regarding the bundle feature.
I think the conclusion (not concluded yet) of the thread #84886 (comment) will be a good reference for the needs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to #79223
#84483
Proposed Changes
This PR enables the "Preview & Customize" button for Premium and WooCommerce themes on the Horizon environment.
Note that the whole "Live Preview in Premium and Woo themes" feature is under development. See #79223.
Testing Instructions
Preview & Customize
button.Regression testing for Simple sites;
Preview & Customize
button.Preview & Customize
button.Pre-merge Checklist