Fix: Mini Cart block: Edit template part link doesn't work for themes don't have mini cart template part. (https://github.com/woocommerce/woocommerce-blocks/pull/5347)

This commit is contained in:
Tung Du 2021-12-09 20:58:03 +07:00 committed by GitHub
parent 6cbff66977
commit b3ba90e7e9
1 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;
use Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry;
use Automattic\WooCommerce\Blocks\Utils\StyleAttributesUtils;
use Automattic\WooCommerce\Blocks\Utils\BlockTemplateUtils;
/**
* Mini Cart class.
@ -172,7 +173,7 @@ class MiniCart extends AbstractBlock {
$this->asset_data_registry->add(
'themeSlug',
wp_get_theme()->get_stylesheet(),
BlockTemplateUtils::theme_has_template_part( 'mini-cart' ) ? wp_get_theme()->get_stylesheet() : 'woocommerce',
''
);