diff --git a/src/BlockTemplatesController.php b/src/BlockTemplatesController.php index be1fa2ea7da..054a9577310 100644 --- a/src/BlockTemplatesController.php +++ b/src/BlockTemplatesController.php @@ -25,18 +25,11 @@ class BlockTemplatesController { private $template_parts_directory; /** - * Directory name of the block template directory. + * Directory which contains all templates * * @var string */ - const TEMPLATES_DIR_NAME = 'block-templates'; - - /** - * Directory name of the block template parts directory. - * - * @var string - */ - const TEMPLATE_PARTS_DIR_NAME = 'block-template-parts'; + const TEMPLATES_ROOT_DIR = 'templates'; /** * Constructor. @@ -44,8 +37,10 @@ class BlockTemplatesController { public function __construct() { // This feature is gated for WooCommerce versions 6.0.0 and above. if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '6.0.0', '>=' ) ) { - $this->templates_directory = plugin_dir_path( __DIR__ ) . 'templates/' . self::TEMPLATES_DIR_NAME; - $this->template_parts_directory = plugin_dir_path( __DIR__ ) . 'templates/' . self::TEMPLATE_PARTS_DIR_NAME; + $root_path = plugin_dir_path( __DIR__ ) . self::TEMPLATES_ROOT_DIR . DIRECTORY_SEPARATOR; + + $this->templates_directory = $root_path . BlockTemplateUtils::TEMPLATES_DIR_NAME; + $this->template_parts_directory = $root_path . BlockTemplateUtils::TEMPLATE_PARTS_DIR_NAME; $this->init(); } } diff --git a/templates/parts/mini-cart.html b/templates/parts/mini-cart.html new file mode 100644 index 00000000000..c2400ba76ed --- /dev/null +++ b/templates/parts/mini-cart.html @@ -0,0 +1,31 @@ + +
+ +
+ + + +
+ + + +
+ +

+ Your cart is currently empty! +

+ + + +
+ + + +
+ +
+ +
+ diff --git a/templates/templates/archive-product.html b/templates/templates/archive-product.html new file mode 100644 index 00000000000..4cf01077d40 --- /dev/null +++ b/templates/templates/archive-product.html @@ -0,0 +1,5 @@ + + +
+ + diff --git a/templates/templates/single-product.html b/templates/templates/single-product.html new file mode 100644 index 00000000000..1e4177d96e3 --- /dev/null +++ b/templates/templates/single-product.html @@ -0,0 +1,5 @@ + + +
+ + diff --git a/templates/templates/taxonomy-product_cat.html b/templates/templates/taxonomy-product_cat.html new file mode 100644 index 00000000000..4a300405a67 --- /dev/null +++ b/templates/templates/taxonomy-product_cat.html @@ -0,0 +1,5 @@ + + +
+ + diff --git a/templates/templates/taxonomy-product_tag.html b/templates/templates/taxonomy-product_tag.html new file mode 100644 index 00000000000..071b616f7d5 --- /dev/null +++ b/templates/templates/taxonomy-product_tag.html @@ -0,0 +1,5 @@ + + +
+ +