id = 'bacs'; $this->icon = apply_filters('woocommerce_bacs_icon', ''); $this->has_fields = false; // Load the form fields. $this->init_form_fields(); // Load the settings. $this->init_settings(); // Define user set variables $this->title = $this->settings['title']; $this->description = $this->settings['description']; $this->account_name = $this->settings['account_name']; $this->account_number = $this->settings['account_number']; $this->sort_code = $this->settings['sort_code']; $this->bank_name = $this->settings['bank_name']; $this->iban = $this->settings['iban']; $this->bic = $this->settings['bic']; // Actions add_action('woocommerce_update_options_payment_gateways', array(&$this, 'process_admin_options')); add_action('woocommerce_thankyou_bacs', array(&$this, 'thankyou_page')); // Customer Emails add_action('woocommerce_email_before_order_table', array(&$this, 'email_instructions'), 10, 2); } /** * Initialise Gateway Settings Form Fields */ function init_form_fields() { $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woothemes' ), 'type' => 'checkbox', 'label' => __( 'Enable Bank Transfer', 'woothemes' ), 'default' => 'yes' ), 'title' => array( 'title' => __( 'Title', 'woothemes' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woothemes' ), 'default' => __( 'Direct Bank Transfer', 'woothemes' ) ), 'description' => array( 'title' => __( 'Customer Message', 'woothemes' ), 'type' => 'textarea', 'description' => __( 'Give the customer instructions for paying via BACS, and let them know that their order won\'t be shipping until the money is received.', 'woothemes' ), 'default' => __('Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order wont be shipped until the funds have cleared in our account.', 'woothemes') ), 'account_name' => array( 'title' => __( 'Account Name', 'woothemes' ), 'type' => 'text', 'description' => '', 'default' => '' ), 'account_number' => array( 'title' => __( 'Account Number', 'woothemes' ), 'type' => 'text', 'description' => '', 'default' => '' ), 'sort_code' => array( 'title' => __( 'Sort Code', 'woothemes' ), 'type' => 'text', 'description' => '', 'default' => '' ), 'bank_name' => array( 'title' => __( 'Bank Name', 'woothemes' ), 'type' => 'text', 'description' => '', 'default' => '' ), 'iban' => array( 'title' => __( 'IBAN', 'woothemes' ), 'type' => 'text', 'description' => __('Your bank may require this for international payments','woothemes'), 'default' => '' ), 'bic' => array( 'title' => __( 'BIC (formerly Swift)', 'woothemes' ), 'type' => 'text', 'description' => __('Your bank may require this for international payments','woothemes'), 'default' => '' ), ); } // End init_form_fields() /** * Admin Panel Options * - Options for bits like 'title' and availability on a country-by-country basis * * @since 1.0.0 */ public function admin_options() { ?>