woocommerce address on custom page
-
I want show WooCommerce addresses on a custom page. But when I save the address form it is sent to the “myaccount” page. I want to save on the my custom page I created. Also show errors on the same page.
Codes:$userMeta = get_user_meta(get_current_user_id()); $countries = new WC_Countries(); if (isset($_GET['edit']) && $_GET['edit'] == 'billing') { $add_fields = $countries->get_address_fields('', 'billing_'); } elseif (isset($_GET['edit']) && $_GET['edit'] == 'shipping') { $add_fields = $countries->get_address_fields('', 'shipping_'); }
<?php wc_print_notices(); ?> <div class="page-content"> <form method="post"> <?php do_action("woocommerce_before_edit_address_form_billing_address"); foreach ($add_fields as $key => $field) : woocommerce_form_field($key, $field, $userMeta[$key][0]); endforeach; do_action("woocommerce_after_edit_address_form_billing_address"); ?> <div class="container"> <input type="submit" class="button" name="save_address" value="<?php esc_attr_e('Save', VUD_DW); ?>"/> <?php wp_nonce_field('woocommerce-edit_address'); ?> <input type="hidden" name="action" value="edit_address"/> </div> </form> </div> </div> <?php do_action('woocommerce_after_edit_account_address_form'); ?>
M
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘woocommerce address on custom page’ is closed to new replies.