/**
  * Get the fields to display for the selected action, in the format required by woocommerce_admin_fields()
  *
  * @since 1.0
  * @param string $section the current section to get fields for
  * @return array
  */
 private function get_action_fields($section)
 {
     $products = array(' ' => '');
     foreach (WC_Pre_Orders_Manager::get_all_pre_order_enabled_products() as $product) {
         $products[$product->id] = woocommerce_get_formatted_product_name($product);
     }
     $fields = array('email' => array(array('name' => __('Email Pre-Order Customers', WC_Pre_Orders::TEXT_DOMAIN), 'desc' => sprintf(__('You may send an email message to all customers who have pre-ordered a specific product. This will use the default template specified for the %sCustomer Note%s Email.', WC_Pre_Orders::TEXT_DOMAIN), '<a href="' . admin_url('admin.php?page=woocommerce_settings&tab=email&section=WC_Email_Customer_Note') . '">', '</a>'), 'type' => 'title'), array('id' => 'wc_pre_orders_action_product', 'name' => __('Product', WC_Pre_Orders::TEXT_DOMAIN), 'desc_tip' => __('Select which product to email all pre-ordered customers.'), 'default' => ' ', 'options' => $products, 'type' => 'select'), array('id' => 'wc_pre_orders_action_email_message', 'name' => __('Message', WC_Pre_Orders::TEXT_DOMAIN), 'desc_tip' => __('Enter a message to include in the email notification to customer. Limited HTML allowed.', WC_Pre_Orders::TEXT_DOMAIN), 'css' => 'min-width: 300px;', 'default' => '', 'type' => 'textarea'), array('type' => 'sectionend'), array('name' => __('Send Emails', WC_Pre_Orders::TEXT_DOMAIN), 'type' => 'submit_button')), 'change-date' => array(array('name' => __('Change the Pre-Order Release Date', WC_Pre_Orders::TEXT_DOMAIN), 'desc' => __('You may change the release date for all pre-orders of a specific product. This will send an email notification to each customer informing them that the pre-order release date was changed, along with the new release date.', WC_Pre_Orders::TEXT_DOMAIN), 'type' => 'title'), array('id' => 'wc_pre_orders_action_product', 'name' => __('Product', WC_Pre_Orders::TEXT_DOMAIN), 'desc_tip' => __('Select which product to change the release date for.'), 'default' => ' ', 'options' => $products, 'type' => 'select'), array('id' => 'wc_pre_orders_action_new_availability_date', 'name' => __('New Availability Date', WC_Pre_Orders::TEXT_DOMAIN), 'desc_tip' => __('The new availability date for the product. This must be later than the current availability date.', WC_Pre_Orders::TEXT_DOMAIN), 'default' => '', 'type' => 'text'), array('id' => 'wc_pre_orders_action_enable_email_notification', 'name' => __('Send Email Notification', WC_Pre_Orders::TEXT_DOMAIN), 'desc' => __('Uncheck this to prevent email notifications from being sent to customers.', WC_Pre_Orders::TEXT_DOMAIN), 'default' => 'yes', 'type' => 'checkbox'), array('id' => 'wc_pre_orders_action_email_message', 'name' => __('Message', WC_Pre_Orders::TEXT_DOMAIN), 'desc_tip' => __('Enter a message to include in the email notification to customer.', WC_Pre_Orders::TEXT_DOMAIN), 'default' => '', 'css' => 'min-width: 300px;', 'type' => 'textarea'), array('type' => 'sectionend'), array('name' => __('Change Release Date', WC_Pre_Orders::TEXT_DOMAIN), 'type' => 'submit_button')), 'complete' => array(array('name' => __('Complete Pre-Orders', WC_Pre_Orders::TEXT_DOMAIN), 'desc' => __('You may complete all pre-orders for a specific product. This will charge the customer\'s card the pre-ordered amount, change their order status to completed, and send them an email notification.', WC_Pre_Orders::TEXT_DOMAIN), 'type' => 'title'), array('id' => 'wc_pre_orders_action_product', 'name' => __('Product', WC_Pre_Orders::TEXT_DOMAIN), 'desc_tip' => __('Select which product to complete all pre-orders for.'), 'default' => ' ', 'options' => $products, 'type' => 'select'), array('id' => 'wc_pre_orders_action_enable_email_notification', 'name' => __('Send Email Notification', WC_Pre_Orders::TEXT_DOMAIN), 'desc' => __('Uncheck this to prevent email notifications from being sent to customers.', WC_Pre_Orders::TEXT_DOMAIN), 'default' => 'yes', 'type' => 'checkbox'), array('id' => 'wc_pre_orders_action_email_message', 'name' => __('Message', WC_Pre_Orders::TEXT_DOMAIN), 'desc_tip' => __('Enter a message to include in the email notification to customer.', WC_Pre_Orders::TEXT_DOMAIN), 'default' => '', 'css' => 'min-width: 300px;', 'type' => 'textarea'), array('type' => 'sectionend'), array('name' => __('Complete Pre-Orders', WC_Pre_Orders::TEXT_DOMAIN), 'type' => 'submit_button')), 'cancel' => array(array('name' => __('Cancel Pre-Orders', WC_Pre_Orders::TEXT_DOMAIN), 'desc' => __('You may cancel all pre-orders for a specific product. This will mark the order as cancelled and send the customer an email notification. If pre-orders were charged upfront, you must manually refund the orders.', WC_Pre_Orders::TEXT_DOMAIN), 'type' => 'title'), array('id' => 'wc_pre_orders_action_product', 'name' => __('Product', WC_Pre_Orders::TEXT_DOMAIN), 'desc_tip' => __('Select which product to cancel all pre-orders for.'), 'default' => ' ', 'options' => $products, 'type' => 'select'), array('id' => 'wc_pre_orders_action_enable_email_notification', 'name' => __('Send Email Notification', WC_Pre_Orders::TEXT_DOMAIN), 'desc' => __('Uncheck this to prevent email notifications from being sent to customers.', WC_Pre_Orders::TEXT_DOMAIN), 'default' => 'yes', 'type' => 'checkbox'), array('id' => 'wc_pre_orders_action_email_message', 'name' => __('Message', WC_Pre_Orders::TEXT_DOMAIN), 'desc_tip' => __('Enter a message to include in the email notification to customer.', WC_Pre_Orders::TEXT_DOMAIN), 'default' => '', 'css' => 'min-width: 300px;', 'type' => 'textarea'), array('type' => 'sectionend'), array('name' => __('Cancel Pre-Orders', WC_Pre_Orders::TEXT_DOMAIN), 'type' => 'submit_button')));
     return isset($fields[$section]) ? $fields[$section] : array();
 }