Fix alignment of Add to Cart form block (https://github.com/woocommerce/woocommerce-blocks/pull/8578)
This commit is contained in:
parent
a57ab52702
commit
29d4f6f07a
|
@ -2,6 +2,7 @@
|
|||
namespace Automattic\WooCommerce\Blocks;
|
||||
|
||||
use Automattic\WooCommerce\Blocks\Domain\Package;
|
||||
use Automattic\WooCommerce\Blocks\Templates\BlockTemplatesCompatibility;
|
||||
use Automattic\WooCommerce\Blocks\Templates\ProductAttributeTemplate;
|
||||
use Automattic\WooCommerce\Blocks\Utils\BlockTemplateUtils;
|
||||
|
||||
|
@ -324,6 +325,14 @@ class BlockTemplatesController {
|
|||
$template->description = BlockTemplateUtils::get_block_template_description( $template->slug );
|
||||
}
|
||||
|
||||
if ( 'single-product' === $template->slug ) {
|
||||
if ( ! is_admin() ) {
|
||||
$new_content = BlockTemplatesCompatibility::wrap_single_product_template( $template->content );
|
||||
$template->content = $new_content;
|
||||
}
|
||||
return $template;
|
||||
}
|
||||
|
||||
return $template;
|
||||
},
|
||||
$query_result
|
||||
|
|
Loading…
Reference in New Issue