Created
April 30, 2024 15:51
-
-
Save webdados/26d4ca53852078e140bb925b72968f4f to your computer and use it in GitHub Desktop.
Helper functions for the Simple Custom Fields for WooCommerce Blocks Checkout plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Usage example for the "Simple Custom Fields for WooCommerce Blocks Checkout" plugin helper functions | |
* Get it at https://ptwooplugins.com/product/simple-custom-fields-for-woocommerce-blocks-checkout/ | |
*/ | |
// Get "fiscal-number" field from the "Contact information" section, on orders and users | |
$value = swcbcf_get_order_field( $order_id, 'other', 'fiscal-number' ); | |
$value = swcbcf_get_user_field( $user_id, 'other', 'fiscal-number' ); | |
// Get "type-of-address" field from the "Addreses billing and shipping" section, on orders and users | |
$value = swcbcf_get_order_field( $order_id, 'billing', 'type-of-address' ); | |
$value = swcbcf_get_order_field( $order_id, 'shipping', 'type-of-address' ); | |
$value = swcbcf_get_user_field( 1, 'billing', 'type-of-address' ); | |
$value = swcbcf_get_user_field( 1, 'shipping', 'type-of-address' ); | |
// Get "register-for-the-newslet" field from the "Additional order information" section, on orders (these are not stored on users) | |
$value = swcbcf_get_order_field( $order_id, 'other', 'register-for-the-newslet' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment