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
Add marketplace theme discover section #40389
Add marketplace theme discover section #40389
Conversation
…hub.com/woocommerce/woocommerce into add/marketplace-theme-discover-section
|
Hi @Dan-Q, @andfinally, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
1 similar comment
|
Hi @Dan-Q, @andfinally, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
|
Hm, I'm getting Index: plugins/woocommerce/includes/admin/class-wc-admin-addons.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/plugins/woocommerce/includes/admin/class-wc-admin-addons.php b/plugins/woocommerce/includes/admin/class-wc-admin-addons.php
--- a/plugins/woocommerce/includes/admin/class-wc-admin-addons.php (revision 48e9566c2de2db0be72d175758aeceeb4e352add)
+++ b/plugins/woocommerce/includes/admin/class-wc-admin-addons.php (date 1695815757702)
@@ -80,7 +80,7 @@
*/
public static function fetch_featured() {
$locale = get_user_locale();
- $featured = self::get_locale_data_from_transient( 'wc_addons_featured', $locale );
+ $featured = false; // self::get_locale_data_from_transient( 'wc_addons_featured', $locale );
if ( false === $featured ) {
$headers = array();
@@ -97,8 +97,8 @@
}
// Important: WCCOM Extensions API v2.0 is used.
- $raw_featured = wp_safe_remote_get(
- 'https://woocommerce.com/wp-json/wccom-extensions/2.0/featured' . $parameter_string,
+ $raw_featured = wp_remote_get(
+ 'https://woocommerce.test/wp-json/wccom-extensions/2.0/featured' . $parameter_string . '&no_cache=true',
array(
'headers' => $headers,
'user-agent' => 'WooCommerce/' . WC()->version . '; ' . get_bloginfo( 'url' ),The URL should be as shown, because |
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.
I haven't been able to test against my local API, but the code looks good to me.
|
@andfinally could this be a networking issue? |
|
Thanks Bero, that didn't help.
LATER Eureka! I just needed this filter as well. Adding to the test steps. add_filter( 'http_request_args', function ( $r ) {
$r['reject_unsafe_urls'] = false;
$r['sslverify'] = false;
$r['timeout'] = 60;
return $r;
} ); |
…x-start` – items were looking weird centred when there weren't enough to fill a row.
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.
Woooh this has been a marathon! Finally worked out that I needed both the filters and the Docker network connection for this to work. Also that you need some featured themes set up in the ad system. I've updated the test steps. I'm now seeing the new themes group as expected.
I made a tiny CSS change in 3d4841a to address this funny-looking centering when there aren't enough items to fill a row:
Test Results SummaryCommit SHA: 486706a
Please address the following issues prior to merging this pull request: |
Thanks for taking the time @andfinally and sorry about the instructions. I probably configured some of these things over time and forgot about it. |
…ommerce/product-editor, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/data, @woocommerce/components, @woocommerce/block-templates, woocommerce-beta-tester, woocommerce
…tplace-theme-discover-section
|
Sorry I didn't see your comment earlier @andfinally: as soon as I saw it, I thought "that's a certificate problem"! Glad you sussed it! |
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 using local WCCOM; looks good!
* Support for themes in in-app marketplace. Contains the changes from: #40247 #40272 #40302 #40303 #40333 #40368 #40375 #40375 #40389 * `.woocommerce-marketplace__discover`: changed `align-items` `flex-start` to `stretch` to properly display products on large and very large viewports. * Delete plugins/woocommerce/changelog/add-18026-marketplace-theme-cards Removing from feature branch before final review * Delete plugins/woocommerce/changelog/add-18027-themes-to-in-app-search Removing from feature branch before final review * Delete plugins/woocommerce/changelog/add-marketplace-theme-discover-section Removing from feature branch before final review * Delete plugins/woocommerce/changelog/update-in-app-multiple-category-filters Removing from feature branch before final review * Delete plugins/woocommerce/changelog/update-theme-no-result-style Removing from feature branch before final review * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: And Finally <andfinally@users.noreply.github.com> Co-authored-by: Dan Q <dan@danq.me> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Dan Q <danq@automattic.com>
Changes proposed in this Pull Request:
This PR is part of #40159
This PR adds support for theme sections on the Discover tab.
It also displays the new section on no-results for search theme.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Prep
To test the request from your local WooCommerce core wp-env environment to your local WCCOM environment, you first need a running instance of WCCOM.
Make sure you have the latest version of trunk in your WCCOM environment. Set up a group of three or four theme products in the Featured Products ad admin. (See the test steps in 18244-gh-Automattic/woocommerce.com for more details.) Check that the group is being returned from the featured endpoint https://woocommerce.test/wp-json/wccom-extensions/2.0/featured?country=US. (You'll probably need to flush the transient that caches this on your WCCOM with
wp cache flush.)Add a mu-plugin to wp-env (as suggested in p6JqRr-aWb), and put these two filters in it:
Get the ID of wp-env's WordPress container.
Link the container to woocommerce.test in the Docker network.
Test
Changelog entry
Significance
Type
Message
Comment
Add support for themes to marketplace discovery and use it in the theme no-result section.