Server IP : 172.67.158.161 / Your IP : 18.118.141.201 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/thietke365.net/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/data/checkout/ |
Upload File : |
/** * External dependencies */ import { isSameAddress } from '@woocommerce/base-utils'; /** * Internal dependencies */ import { STATUS, checkoutData } from './constants'; export type CheckoutState = { // Status of the checkout status: STATUS; // If any of the totals, taxes, shipping, etc need to be calculated, the count will be increased here calculatingCount: number; // True when the checkout is in an error state. Whatever caused the error (validation/payment method) will likely have triggered a notice. hasError: boolean; // This is the url that checkout will redirect to when it's ready. redirectUrl: string; // This is the ID for the draft order if one exists. orderId: number; // Order notes introduced by the user in the checkout form. orderNotes: string; // This is the ID of the customer the draft order belongs to. customerId: number; // Should the billing form be hidden and inherit the shipping address? useShippingAsBilling: boolean; // Should a user account be created? shouldCreateAccount: boolean; // If customer wants to checkout with a local pickup option. prefersCollection?: boolean | undefined; // Custom checkout data passed to the store API on processing. extensionData: Record< string, Record< string, unknown > >; }; export const defaultState: CheckoutState = { redirectUrl: '', status: STATUS.PRISTINE, hasError: false, orderId: checkoutData.order_id, customerId: checkoutData.customer_id, calculatingCount: 0, orderNotes: '', useShippingAsBilling: isSameAddress( checkoutData.billing_address, checkoutData.shipping_address ), shouldCreateAccount: false, prefersCollection: undefined, extensionData: {}, };