mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Initial Axo Blocks commit
This commit is contained in:
parent
796ded031e
commit
ebd87b70e9
27 changed files with 43827 additions and 1 deletions
16
modules/ppcp-axo-block/resources/js/hooks/useCustomerData.js
Normal file
16
modules/ppcp-axo-block/resources/js/hooks/useCustomerData.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { useDispatch, useSelect } from '@wordpress/data';
|
||||
|
||||
export const useCustomerData = () => {
|
||||
const customerData = useSelect( ( select ) =>
|
||||
select( 'wc/store/cart' ).getCustomerData()
|
||||
);
|
||||
const { setShippingAddress, setBillingAddress } =
|
||||
useDispatch( 'wc/store/cart' );
|
||||
|
||||
return {
|
||||
shippingAddress: customerData.shippingAddress,
|
||||
billingAddress: customerData.billingAddress,
|
||||
setShippingAddress,
|
||||
setBillingAddress,
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue