Skip to content
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

Fix block templates not being rendered in extension taxonomies #44850

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
imanish003 marked this conversation as resolved.
Show resolved Hide resolved
imanish003 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix block templates not being rendered in extension taxonomies
3 changes: 1 addition & 2 deletions plugins/woocommerce/src/Blocks/Templates/CartTemplate.php
WunderBart marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ public function get_template_description() {
*/
public function render_block_template() {
if (
! is_embed() && is_cart() &&
! BlockTemplateUtils::theme_has_template( self::SLUG )
! is_embed() && is_cart()
) {
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
Expand Down
WunderBart marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public function get_template_description() {
*/
public function render_block_template() {
if (
! is_embed() && is_checkout() &&
! BlockTemplateUtils::theme_has_template( self::SLUG )
! is_embed() && is_checkout()
) {
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ public function render_block_template() {
add_filter( 'woocommerce_disable_compatibility_layer', '__return_true' );
}

if ( ! BlockTemplateUtils::theme_has_template( self::SLUG ) ) {
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ public function render_block_template() {
add_filter( 'woocommerce_disable_compatibility_layer', '__return_true' );
}

if ( ! BlockTemplateUtils::theme_has_template( self::SLUG ) ) {
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public function render_block_template() {
add_filter( 'woocommerce_disable_compatibility_layer', '__return_true' );
}

if ( ! BlockTemplateUtils::theme_has_template( self::SLUG ) ) {
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public function render_block_template() {
add_filter( 'woocommerce_disable_compatibility_layer', '__return_true' );
}

if ( ! BlockTemplateUtils::theme_has_template( self::SLUG ) ) {
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public function render_block_template() {
add_filter( 'woocommerce_disable_compatibility_layer', '__return_true' );
}

if ( ! BlockTemplateUtils::theme_has_template( self::SLUG ) ) {
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
}
}
WunderBart marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public function render_block_template() {
add_filter( 'woocommerce_disable_compatibility_layer', '__return_true' );
}

if ( ! BlockTemplateUtils::theme_has_template( self::SLUG ) ) {
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
}
}

Expand Down