2021-11-02 14:42:07 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
2022-06-29 07:42:02 +00:00
|
|
|
|
2022-09-06 09:52:33 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { TemplateDetails } from './types';
|
|
|
|
|
2023-02-27 14:34:18 +00:00
|
|
|
export const BLOCK_SLUG = 'woocommerce/legacy-template';
|
|
|
|
export const TYPES = {
|
|
|
|
singleProduct: 'single-product',
|
|
|
|
productCatalog: 'product-catalog',
|
|
|
|
productTaxonomy: 'product-taxonomy',
|
|
|
|
productSearchResults: 'product-search-results',
|
2023-06-29 13:41:22 +00:00
|
|
|
orderConfirmation: 'order-confirmation',
|
|
|
|
checkoutHeader: 'checkout-header',
|
2023-02-27 14:34:18 +00:00
|
|
|
};
|
|
|
|
export const PLACEHOLDERS = {
|
|
|
|
singleProduct: 'single-product',
|
|
|
|
archiveProduct: 'archive-product',
|
2023-06-29 13:41:22 +00:00
|
|
|
orderConfirmation: 'fallback',
|
|
|
|
checkoutHeader: 'checkout-header',
|
2023-02-27 14:34:18 +00:00
|
|
|
};
|
|
|
|
|
2022-09-06 09:52:33 +00:00
|
|
|
export const TEMPLATES: TemplateDetails = {
|
2021-11-03 16:55:52 +00:00
|
|
|
'single-product': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.singleProduct,
|
2024-05-22 08:53:43 +00:00
|
|
|
title: __( 'Product (Classic)', 'woocommerce' ),
|
|
|
|
description: __( 'Displays the PHP product page.', 'woocommerce' ),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.singleProduct,
|
2021-11-03 16:55:52 +00:00
|
|
|
},
|
|
|
|
'archive-product': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productCatalog,
|
2024-05-22 08:53:43 +00:00
|
|
|
title: __( 'Product Grid (Classic)', 'woocommerce' ),
|
|
|
|
description: __(
|
|
|
|
'Displays the PHP product grid page. ',
|
|
|
|
'woocommerce'
|
|
|
|
),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2021-11-03 16:55:52 +00:00
|
|
|
},
|
|
|
|
'taxonomy-product_cat': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productTaxonomy,
|
2024-05-22 08:53:43 +00:00
|
|
|
title: __( 'Product Category (Classic)', 'woocommerce' ),
|
|
|
|
description: __(
|
|
|
|
'Displays the PHP product category page.',
|
|
|
|
'woocommerce'
|
|
|
|
),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2021-11-03 16:55:52 +00:00
|
|
|
},
|
|
|
|
'taxonomy-product_tag': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productTaxonomy,
|
2024-05-22 08:53:43 +00:00
|
|
|
title: __( 'Product Tag (Classic)', 'woocommerce' ),
|
|
|
|
description: __( 'Displays the PHP product tag page.', 'woocommerce' ),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2021-11-03 16:55:52 +00:00
|
|
|
},
|
2022-11-16 13:37:41 +00:00
|
|
|
'taxonomy-product_attribute': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productTaxonomy,
|
2024-05-22 08:53:43 +00:00
|
|
|
title: __( 'Product Attribute (Classic)', 'woocommerce' ),
|
|
|
|
description: __(
|
|
|
|
'Displays the PHP product attribute page.',
|
|
|
|
'woocommerce'
|
|
|
|
),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2022-11-16 13:37:41 +00:00
|
|
|
},
|
2023-07-31 10:23:49 +00:00
|
|
|
// Since that it is a fallback value, it has to be the last one.
|
|
|
|
'taxonomy-product': {
|
|
|
|
type: TYPES.productTaxonomy,
|
2024-05-22 08:53:43 +00:00
|
|
|
title: __( "Product's Custom Taxonomy (Classic)", 'woocommerce' ),
|
|
|
|
description: __(
|
|
|
|
"Displays the PHP product's custom taxonomy page.",
|
2023-12-12 22:12:36 +00:00
|
|
|
'woocommerce'
|
2023-07-31 10:23:49 +00:00
|
|
|
),
|
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
|
|
|
},
|
2022-06-29 07:42:02 +00:00
|
|
|
'product-search-results': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productSearchResults,
|
2024-05-22 08:53:43 +00:00
|
|
|
title: __( 'Product Search Results (Classic)', 'woocommerce' ),
|
|
|
|
description: __(
|
|
|
|
'Displays the PHP product search results.',
|
|
|
|
'woocommerce'
|
|
|
|
),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2022-06-29 07:42:02 +00:00
|
|
|
},
|
2023-06-29 13:41:22 +00:00
|
|
|
'checkout-header': {
|
|
|
|
type: TYPES.checkoutHeader,
|
2023-12-12 22:12:36 +00:00
|
|
|
title: __( 'Checkout Header', 'woocommerce' ),
|
2023-06-29 13:41:22 +00:00
|
|
|
placeholder: 'checkout-header',
|
|
|
|
},
|
|
|
|
'order-confirmation': {
|
|
|
|
type: TYPES.orderConfirmation,
|
2023-12-12 22:12:36 +00:00
|
|
|
title: __( 'Order Confirmation Block', 'woocommerce' ),
|
2023-06-29 13:41:22 +00:00
|
|
|
placeholder: PLACEHOLDERS.orderConfirmation,
|
|
|
|
},
|
2021-11-02 14:42:07 +00:00
|
|
|
};
|