AbstractProductFormTemplate.php
2 years ago
DownloadableProductTrait.php
2 years ago
Group.php
1 year ago
ProductBlock.php
2 years ago
ProductVariationTemplate.php
1 month ago
Section.php
1 year ago
SimpleProductTemplate.php
1 month ago
Subsection.php
1 year ago
ProductBlock.php
28 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WooCommerce Product Block class. |
| 4 | */ |
| 5 | |
| 6 | namespace Automattic\WooCommerce\Internal\Features\ProductBlockEditor\ProductTemplates; |
| 7 | |
| 8 | use Automattic\WooCommerce\Admin\BlockTemplates\BlockInterface; |
| 9 | use Automattic\WooCommerce\Admin\BlockTemplates\ContainerInterface; |
| 10 | use Automattic\WooCommerce\Internal\Admin\BlockTemplates\AbstractBlock; |
| 11 | use Automattic\WooCommerce\Internal\Admin\BlockTemplates\BlockContainerTrait; |
| 12 | |
| 13 | /** |
| 14 | * Class for Product block. |
| 15 | */ |
| 16 | class ProductBlock extends AbstractBlock implements ContainerInterface { |
| 17 | use BlockContainerTrait; |
| 18 | /** |
| 19 | * Adds block to the section block. |
| 20 | * |
| 21 | * @param array $block_config The block data. |
| 22 | */ |
| 23 | public function &add_block( array $block_config ): BlockInterface { |
| 24 | $block = new ProductBlock( $block_config, $this->get_root_template(), $this ); |
| 25 | return $this->add_inner_block( $block ); |
| 26 | } |
| 27 | } |
| 28 |