2022-04-01 13:45:18 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { lazy } from '@wordpress/element';
|
|
|
|
import { WC_BLOCKS_BUILD_URL } from '@woocommerce/block-settings';
|
|
|
|
import { registerCheckoutBlock } from '@woocommerce/blocks-checkout';
|
|
|
|
|
2022-04-05 10:14:32 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import metadata from './component-metadata';
|
|
|
|
|
2022-04-01 13:45:18 +00:00
|
|
|
// Modify webpack publicPath at runtime based on location of WordPress Plugin.
|
|
|
|
// eslint-disable-next-line no-undef,camelcase
|
|
|
|
__webpack_public_path__ = WC_BLOCKS_BUILD_URL;
|
|
|
|
|
2022-04-05 10:14:32 +00:00
|
|
|
registerCheckoutBlock( {
|
|
|
|
metadata: metadata.FILLED_CART,
|
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "cart-blocks/filled-cart" */
|
|
|
|
'./filled-cart-block/frontend'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
|
|
|
metadata: metadata.EMPTY_CART,
|
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "cart-blocks/empty-cart" */
|
|
|
|
'./empty-cart-block/frontend'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
|
|
|
metadata: metadata.CART_ITEMS,
|
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "cart-blocks/cart-items" */
|
|
|
|
'./cart-items-block/frontend'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
|
|
|
metadata: metadata.CART_LINE_ITEMS,
|
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "cart-blocks/cart-line-items" */
|
|
|
|
'./cart-line-items-block/frontend'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
|
|
|
metadata: metadata.CART_TOTALS,
|
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "cart-blocks/cart-totals" */
|
|
|
|
'./cart-totals-block/frontend'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
2022-04-01 13:45:18 +00:00
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-05 10:14:32 +00:00
|
|
|
metadata: metadata.CART_EXPRESS_PAYMENT,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-05 10:14:32 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/cart-express-payment" */
|
|
|
|
'./cart-express-payment-block/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-05 10:14:32 +00:00
|
|
|
metadata: metadata.PROCEED_TO_CHECKOUT,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-05 10:14:32 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/proceed-to-checkout" */
|
|
|
|
'./proceed-to-checkout-block/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-05 10:14:32 +00:00
|
|
|
metadata: metadata.CART_ACCEPTED_PAYMENT_METHODS,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-05 10:14:32 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/cart-accepted-payment-methods" */
|
|
|
|
'./cart-accepted-payment-methods-block/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-05 10:14:32 +00:00
|
|
|
metadata: metadata.CART_ORDER_SUMMARY,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-05 10:14:32 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/cart-order-summary" */
|
|
|
|
'./cart-order-summary-block/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
2022-04-12 11:20:22 +00:00
|
|
|
registerCheckoutBlock( {
|
|
|
|
metadata: metadata.CART_ORDER_SUMMARY_HEADING,
|
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "cart-blocks/order-summary-heading" */
|
|
|
|
'./cart-order-summary-heading/frontend'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
2022-04-01 13:45:18 +00:00
|
|
|
registerCheckoutBlock( {
|
2022-04-05 10:14:32 +00:00
|
|
|
metadata: metadata.CART_ORDER_SUMMARY_SUBTOTAL,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-05 10:14:32 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/order-summary-subtotal" */
|
|
|
|
'./cart-order-summary-subtotal/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-05 10:14:32 +00:00
|
|
|
metadata: metadata.CART_ORDER_SUMMARY_FEE,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-05 10:14:32 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/order-summary-fee" */
|
|
|
|
'./cart-order-summary-fee/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-05 10:14:32 +00:00
|
|
|
metadata: metadata.CART_ORDER_SUMMARY_DISCOUNT,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-05 10:14:32 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/order-summary-discount" */
|
|
|
|
'./cart-order-summary-discount/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-12 11:20:22 +00:00
|
|
|
metadata: metadata.CART_ORDER_SUMMARY_COUPON_FORM,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-12 11:20:22 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/order-summary-coupon-form" */
|
|
|
|
'./cart-order-summary-coupon-form/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-12 11:20:22 +00:00
|
|
|
metadata: metadata.CART_ORDER_SUMMARY_SHIPPING,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-12 11:20:22 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/order-summary-shipping" */
|
|
|
|
'./cart-order-summary-shipping/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-05 10:14:32 +00:00
|
|
|
metadata: metadata.CART_ORDER_SUMMARY_TAXES,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-05 10:14:32 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/order-summary-taxes" */
|
|
|
|
'./cart-order-summary-taxes/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|
|
|
|
|
|
|
|
registerCheckoutBlock( {
|
2022-04-05 10:14:32 +00:00
|
|
|
metadata: metadata.CART_ORDER_SUMMARY_HEADING,
|
2022-04-01 13:45:18 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-04-05 10:14:32 +00:00
|
|
|
/* webpackChunkName: "cart-blocks/order-summary-heading" */
|
|
|
|
'./cart-order-summary-heading/frontend'
|
2022-04-01 13:45:18 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
} );
|