diff --git a/assets/js/atomic/blocks/product-elements/add-to-cart-form/index.tsx b/assets/js/atomic/blocks/product-elements/add-to-cart-form/index.tsx index a6db044b4b1..d2002f337e1 100644 --- a/assets/js/atomic/blocks/product-elements/add-to-cart-form/index.tsx +++ b/assets/js/atomic/blocks/product-elements/add-to-cart-form/index.tsx @@ -9,6 +9,8 @@ import { Icon, button } from '@wordpress/icons'; */ import metadata from './block.json'; import edit from './edit'; +import './style.scss'; +import './editor.scss'; const blockSettings = { edit, diff --git a/bin/webpack-entries.js b/bin/webpack-entries.js index 704a82671d2..7863aeaf925 100644 --- a/bin/webpack-entries.js +++ b/bin/webpack-entries.js @@ -133,6 +133,8 @@ const entries = { './assets/js/atomic/blocks/product-elements/product-reviews/index.tsx', 'product-details': './assets/js/atomic/blocks/product-elements/product-details/index.tsx', + 'add-to-cart-form': + './assets/js/atomic/blocks/product-elements/add-to-cart-form/index.tsx', ...getBlockEntries( '{index,block,frontend}.{t,j}s{,x}' ), }, core: { diff --git a/src/BlockTypes/AddToCartForm.php b/src/BlockTypes/AddToCartForm.php index 0ec14752e72..1bee6d8444e 100644 --- a/src/BlockTypes/AddToCartForm.php +++ b/src/BlockTypes/AddToCartForm.php @@ -96,11 +96,13 @@ protected function render( $attributes, $content, $block ) { $classname = $attributes['className'] ?? ''; $classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes ); + $product_classname = $is_descendent_of_single_product_block ? 'product': ''; $form = sprintf( - '