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
Attach WooCommerce templates to the theme #46831
Draft
Aljullu
wants to merge
13
commits into
trunk
Choose a base branch
from
fix/42181-attach-woocommerce-templates-to-theme
base: trunk
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+50
−107
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
plugin: woocommerce
Issues related to the WooCommerce Core plugin.
label
Apr 23, 2024
Aljullu
force-pushed
the
fix/42181-attach-woocommerce-templates-to-theme
branch
3 times, most recently
from
April 25, 2024 09:41
4f2b40e
to
e9a4bd2
Compare
Aljullu
commented
Apr 25, 2024
// then we will load in the archive-product.html template from the theme to use for product taxonomies on the frontend. | ||
$template_is_from_theme = 'theme' === $template_file->source; | ||
$theme_name = wp_get_theme()->get( 'TextDomain' ); | ||
$theme_name = get_stylesheet(); |
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.
WordPress internally uses get_stylesheet()
for the theme name:
Aljullu
force-pushed
the
fix/42181-attach-woocommerce-templates-to-theme
branch
2 times, most recently
from
April 25, 2024 11:51
a42f5b2
to
91b1a7a
Compare
11 tasks
Aljullu
force-pushed
the
fix/42181-attach-woocommerce-templates-to-theme
branch
from
April 25, 2024 13:58
91b1a7a
to
74738d8
Compare
Aljullu
force-pushed
the
fix/42181-attach-woocommerce-templates-to-theme
branch
2 times, most recently
from
May 2, 2024 09:42
80e3db6
to
229e732
Compare
Aljullu
force-pushed
the
fix/42181-attach-woocommerce-templates-to-theme
branch
from
May 2, 2024 09:44
229e732
to
86df823
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
Closes #42181.
This PR changes some of the logic of the templates introduced by WooCommerce so instead of being plugin templates they are considered regular theme templates. This makes that when the user switches themes, the templates aren't carried over, fixing #42181.
At the same time, it brings the regression that the theme name is shown as the author of the templates, instead of WooCommerce. Fixing this will likely require changes upstream.
Todo list:
template-customization.block_theme_with_templates.spec.ts
tests.woocommerce/woocommerce
slug as well.How to test the changes in this Pull Request:
Changelog entry
Significance
Type
Message
Comment