Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix alignment of Add to Cart form block (#8578)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljullu authored and dinhtungdu committed Mar 1, 2023
1 parent fd781da commit 9c51ded
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/BlockTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -324,6 +325,14 @@ function( $template ) {
$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
Expand Down

0 comments on commit 9c51ded

Please sign in to comment.