/** * META-BOX CONTENT - Display Customer's account informations in administration panel */ function wps_customer_account_informations() { global $post; $wps_account = new wps_account_ctr(); $output = $wps_account->display_account_informations($post->post_author); echo $output; }
function ajax_get_login_form() { $wps_account_ctr = new wps_account_ctr(); echo $wps_account_ctr->get_login_form(); wp_die(); }
<div id="<?php echo $signup_field->code; ?> " class="wps-form"><?php echo $attribute_output_def['output']; echo $attribute_output_def['options']; ?> </div> </div> <?php } } } ?> <?php $wps_account_ctr = new wps_account_ctr(); echo $wps_account_ctr->display_commercial_newsletter_form(); ?> </form> <div class="wps-form-group"> <?php do_action('signup_extra_fields'); ?> </div> <div class="wps-form-group"> <button class="wps-bton-first-alignRight-rounded" id="wps_account_form_button"><?php _e('Save', 'wpshop'); ?> </button> </div> </div>
/** * AJAX - Refresh customer informations */ function wps_order_refresh_customer_informations() { $status = false; $account = $addresses = ''; $customer_id = !empty($_POST['customer_id']) ? intval($_POST['customer_id']) : null; $order_id = !empty($_POST['order_id']) ? intval($_POST['order_id']) : null; if (!empty($customer_id)) { $order_metadata = get_post_meta($order_id, '_order_postmeta', true); if (!empty($order_metadata)) { $order_metadata['customer_id'] = $customer_id; update_post_meta($order_id, '_order_postmeta', $order_metadata); } // Selected customer informations $wps_account = new wps_account_ctr(); $account = $wps_account->display_account_informations($customer_id); $wps_address = new wps_address(); $addresses = $wps_address->display_addresses_interface($customer_id, true, $order_id); $status = true; } echo json_encode(array('status' => $status, 'account' => $account, 'addresses' => $addresses)); wp_die(); }