/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { withFeedbackPrompt } from '@woocommerce/block-hocs'; import { previewShippingRates } from '@woocommerce/resource-previews'; import { SHIPPING_METHODS_EXIST } from '@woocommerce/block-settings'; import { InspectorControls } from '@wordpress/block-editor'; import { PanelBody, ToggleControl, CheckboxControl, } from '@wordpress/components'; import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary'; /** * Internal dependencies */ import Block from './block.js'; import './editor.scss'; const CheckoutEditor = ( { attributes, setAttributes } ) => { const { className, useShippingAsBilling, showCompanyField, showAddress2Field, showPhoneField, requireCompanyField, requirePhoneField, } = attributes; return (

{ __( 'Choose whether your checkout form requires extra information from customers.', 'woo-gutenberg-products-block' ) }

setAttributes( { showCompanyField: ! showCompanyField, } ) } /> { showCompanyField && ( setAttributes( { requireCompanyField: ! requireCompanyField, } ) } className="components-base-control--nested" /> ) } setAttributes( { showAddress2Field: ! showAddress2Field, } ) } /> setAttributes( { showPhoneField: ! showPhoneField, } ) } /> { showPhoneField && ( setAttributes( { requirePhoneField: ! requirePhoneField, } ) } className="components-base-control--nested" /> ) }

{ __( 'Reduce the number of fields required to checkout.', 'woo-gutenberg-products-block' ) }

setAttributes( { useShippingAsBilling: ! useShippingAsBilling, } ) } />
); }; export default withFeedbackPrompt( __( 'We are currently working on improving our checkout and providing merchants with tools and options to customize their checkout to their stores needs.', 'woo-gutenberg-products-block' ) )( CheckoutEditor );