本文整理汇总了PHP中WC_Payment_Gateways类的典型用法代码示例。如果您正苦于以下问题:PHP WC_Payment_Gateways类的具体用法?PHP WC_Payment_Gateways怎么用?PHP WC_Payment_Gateways使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WC_Payment_Gateways类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance
/**
* Main WC_Payment_Gateways Instance
*
* Ensures only one instance of WC_Payment_Gateways is loaded or can be loaded.
*
* @since 2.1
* @static
* @return WC_Payment_Gateways Main instance
*/
public static function instance()
{
if (is_null(self::$_instance)) {
self::$_instance = new self();
}
return self::$_instance;
}
示例2: load_gateways
public function load_gateways()
{
$gateways = WC_Payment_Gateways::instance()->payment_gateways;
$order = $this->get('gateway_order');
// some poorly written plugins will init WC_Payment_Gateways before WP init
// check to see if POS Cash Gateway is present, if not: re-init WC_Payment_Gateways
if (!in_array('WC_POS_Gateways_Cash', array_map('get_class', $gateways))) {
WC_Payment_Gateways::instance()->init();
$gateways = WC_Payment_Gateways::instance()->payment_gateways;
}
// reorder
$i = count($gateways);
foreach ($gateways as $gateway) {
if (isset($order[$gateway->id])) {
$ordered_gateways[$order[$gateway->id]] = $gateway;
} else {
$ordered_gateways[++$i] = $gateway;
}
$settings = new WC_POS_Admin_Settings_Gateways($gateway->id);
$settings->merge_settings($gateway);
apply_filters('woocommerce_pos_load_gateway', $gateway);
}
ksort($ordered_gateways, SORT_NUMERIC);
return $ordered_gateways;
}
示例3: getEnabledPaymentGateways
/**
* Get enabled payment gateways.
*
* @return array Array of enabled gateways
*/
public function getEnabledPaymentGateways()
{
$_enabledGateways = array();
$gateways = \WC_Payment_Gateways::instance();
if (sizeof($gateways->payment_gateways) > 0) {
foreach ($gateways->payment_gateways() as $gateway) {
if ($this->isEnabled($gateway)) {
$_enabledGateways[$gateway->id] = $gateway;
}
}
}
return $_enabledGateways;
}
示例4: load_gateways
public function load_gateways()
{
$gateways = WC_Payment_Gateways::instance()->payment_gateways;
$order = $this->get_data('gateway_order');
// reorder
$i = count($gateways);
foreach ($gateways as $gateway) {
if (isset($order[$gateway->id])) {
$ordered_gateways[$order[$gateway->id]] = $gateway;
} else {
$ordered_gateways[++$i] = $gateway;
}
$settings = new WC_POS_Admin_Settings_Gateways($gateway->id);
$settings->merge_settings($gateway);
apply_filters('woocommerce_pos_load_gateway', $gateway);
}
ksort($ordered_gateways, SORT_NUMERIC);
return $ordered_gateways;
}
示例5: __construct
public function __construct($options)
{
global $wpdb;
$this->wpdb = $wpdb;
$this->import = $options['import'];
$this->count = $options['count'];
$this->xml = $options['xml'];
$this->logger = $options['logger'];
$this->chunk = $options['chunk'];
$this->xpath = $options['xpath_prefix'];
$this->prices_include_tax = 'yes' === get_option('woocommerce_prices_include_tax', 'no');
$this->payment_gateways = WC_Payment_Gateways::instance()->get_available_payment_gateways();
$this->shipping_methods = WC()->shipping->get_shipping_methods();
if (class_exists('WC_Shipping_Zones')) {
$zones = WC_Shipping_Zones::get_zones();
if (!empty($zones)) {
foreach ($zones as $zone_id => $zone) {
if (!empty($zone['shipping_methods'])) {
foreach ($zone['shipping_methods'] as $method) {
$this->shipping_zone_methods[] = $method;
}
}
}
} else {
$zone = new WC_Shipping_Zone(0);
$this->shipping_zone_methods = $zone->get_shipping_methods();
}
}
$tax_classes = array_filter(array_map('trim', explode("\n", get_option('woocommerce_tax_classes'))));
if ($tax_classes) {
// Add Standard tax class
if (!in_array('', $tax_classes)) {
$tax_classes[] = '';
}
foreach ($tax_classes as $class) {
foreach (WC_Tax::get_rates_for_tax_class(sanitize_title($class)) as $rate_key => $rate) {
$this->tax_rates[$rate->tax_rate_id] = $rate;
}
}
}
add_filter('wp_all_import_is_post_to_skip', array(&$this, 'wp_all_import_is_post_to_skip'), 10, 5);
add_filter('wp_all_import_combine_article_data', array(&$this, 'wp_all_import_combine_article_data'), 10, 4);
}
示例6: get_tokens
/**
* Gets valid tokens from the database based on user defined criteria.
* @param array $args
* @return array
*/
public static function get_tokens($args)
{
global $wpdb;
$args = wp_parse_args($args, array('token_id' => '', 'user_id' => '', 'gateway_id' => '', 'type' => ''));
$sql = "SELECT * FROM {$wpdb->prefix}woocommerce_payment_tokens";
$where = array('1=1');
if ($args['token_id']) {
$token_ids = array_map('absint', is_array($args['token_id']) ? $args['token_id'] : array($args['token_id']));
$where[] = "token_id IN ('" . implode("','", array_map('esc_sql', $token_ids)) . "')";
}
if ($args['user_id']) {
$where[] = 'user_id = ' . absint($args['user_id']);
}
if ($args['gateway_id']) {
$gateway_ids = array($args['gateway_id']);
} else {
$gateways = WC_Payment_Gateways::instance();
$gateway_ids = $gateways->get_payment_gateway_ids();
}
$gateway_ids[] = '';
$where[] = "gateway_id IN ('" . implode("','", array_map('esc_sql', $gateway_ids)) . "')";
if ($args['type']) {
$where[] = 'type = ' . esc_sql($args['type']);
}
$token_results = $wpdb->get_results($sql . ' WHERE ' . implode(' AND ', $where));
$tokens = array();
if (!empty($token_results)) {
foreach ($token_results as $token_result) {
$_token = self::get($token_result->token_id, $token_result);
if (!empty($_token)) {
$tokens[$token_result->token_id] = $_token;
}
}
}
return $tokens;
}
示例7: translate_payment_instructions
function translate_payment_instructions($id)
{
$gateways = WC()->payment_gateways();
foreach ($gateways->payment_gateways as $key => $gateway) {
if ($gateway->id == $id && isset(WC_Payment_Gateways::instance()->payment_gateways[$key]->instructions)) {
do_action('wpml_register_single_string', 'woocommerce', $gateway->id . '_gateway_instructions', $gateway->instructions);
WC_Payment_Gateways::instance()->payment_gateways[$key]->instructions = apply_filters('wpml_translate_single_string', $gateway->instructions, 'woocommerce', $gateway->id . '_gateway_instructions');
break;
}
}
}
示例8: register_gateway_strings
function register_gateway_strings($fields)
{
$wc_payment_gateways = WC_Payment_Gateways::instance();
foreach ($wc_payment_gateways->payment_gateways() as $gateway) {
if (isset($_POST['woocommerce_' . $gateway->id . '_enabled'])) {
$gateway_id = $gateway->id;
break;
}
}
if (isset($gateway_id)) {
do_action('wpml_register_single_string', 'woocommerce', $gateway_id . '_gateway_title', $fields['title']);
if (isset($fields['description'])) {
do_action('wpml_register_single_string', 'woocommerce', $gateway_id . '_gateway_description', $fields['description']);
}
if (isset($fields['instructions'])) {
do_action('wpml_register_single_string', 'woocommerce', $gateway_id . '_gateway_instructions', $fields['instructions']);
}
}
return $fields;
}
示例9: _e
?>
</p>
</td>
</tr>
<tr>
<th scope="row">
<label for="wcw_transfer_only"><?php
_e('Credits Transfered When Order Status is in', WC_WALLET_TEXT);
?>
</label>
</th>
<td>
<?php
$sts = wc_get_order_statuses();
$array = new WC_Payment_Gateways();
$methods = $array->get_available_payment_gateways();
if (count($methods) != 0) {
echo "<table>";
foreach ($methods as $key => $method) {
$current_status = $wcw_transfer_only["{$key}"];
echo "<tr>";
echo "<td style ='padding-left: 0px; vertical-align: top;'>" . $method->title . "</td><td>";
foreach ($sts as $keys => $status) {
?>
<label class = "w200" for="dashboard_right_now-hide_<?php
echo $keys;
?>
_<?php
echo $key;
?>
示例10: save
/**
* Save settings.
*/
public function save()
{
global $current_section;
$wc_payment_gateways = WC_Payment_Gateways::instance();
if (!$current_section) {
WC_Admin_Settings::save_fields($this->get_settings());
$wc_payment_gateways->process_admin_options();
} else {
foreach ($wc_payment_gateways->payment_gateways() as $gateway) {
if (in_array($current_section, array($gateway->id, sanitize_title(get_class($gateway))))) {
do_action('woocommerce_update_options_payment_gateways_' . $gateway->id);
$wc_payment_gateways->init();
}
}
}
}
示例11: importOrderToWoocommerce
public function importOrderToWoocommerce($orders)
{
if (isset($orders) && !empty($orders)) {
$order_status = get_option('order_vend_to_wc');
//Order Status from order config setting
foreach ($orders['orders'] as $order) {
if (isset($order['id']) && !empty($order['id'])) {
$OrderIds = get_option("Vend_orderIDs");
if (isset($OrderIds) && !empty($OrderIds)) {
$Ids = unserialize($OrderIds);
} else {
$Ids = array();
}
if (!in_array($order['id'], $Ids)) {
update_option('Vend_orderIDs', serialize(array_merge($Ids, array($order['id']))));
$order_data = array('post_name' => 'order-' . date('M-d-Y-hi-a'), 'post_type' => 'shop_order', 'post_title' => date('M d, Y @ h:i A'), 'post_excerpt' => 'Source: ' . ucfirst($order['source']) . ' Order #' . $order['orderId'], 'post_status' => $order_status, 'ping_status' => 'closed', 'comment_status' => 'open');
$order_id = wp_insert_post($order_data, true);
// create order
if (is_wp_error($order_id)) {
$order->errors = $order_id;
} else {
if (isset($order['payment']['transactionNumber']) && !empty($order['payment']['transactionNumber'])) {
add_post_meta($order_id, 'transaction_id', $order['payment']['transactionNumber'], true);
}
/* ---------------------------------------Payment Mapping --------------------------------- */
if (isset($order['payment']['retailer_payment_type_id']) && !empty($order['payment']['retailer_payment_type_id'])) {
$all_payment = get_option('vend_to_wc_payments');
if (isset($all_payment) && !empty($all_payment)) {
$explode_payment = explode(',', $all_payment);
foreach ($explode_payment as $payments_method) {
$payment_method = explode('|', $payments_method);
if (in_array($order['payment']['retailer_payment_type_id'], $payment_method)) {
$gatways = new WC_Payment_Gateways();
$payment = $gatways->get_available_payment_gateways();
$wocoomercepayment = $payment_method[1];
foreach ($payment as $payment_method_id => $payment_method_title) {
if ($payment_method_title->title == $wocoomercepayment) {
add_post_meta($order_id, '_payment_method_title', $wocoomercepayment, true);
add_post_meta($order_id, '_payment_method', $payment_method_id, true);
}
}
}
}
}
}
$customer_import = get_option('vend_to_wc_customer');
if (isset($customer_import) && $customer_import == 'customer_data') {
if (isset($order['billingAddress'])) {
add_post_meta($order_id, '_billing_first_name', isset($order['billingAddress']['firstName']) ? $order['billingAddress']['firstName'] : NULL, true);
add_post_meta($order_id, '_billing_last_name', isset($order['billingAddress']['lastName']) ? $order['billingAddress']['lastName'] : NULL, true);
add_post_meta($order_id, '_billing_company', isset($order['billingAddress']['company']) ? $order['billingAddress']['company'] : NULL, true);
add_post_meta($order_id, '_billing_address_1', isset($order['billingAddress']['street1']) ? $order['billingAddress']['street1'] : NULL, true);
add_post_meta($order_id, '_billing_address_2', isset($order['billingAddress']['street2']) ? $order['billingAddress']['street2'] : NULL, true);
add_post_meta($order_id, '_billing_city', isset($order['billingAddress']['city']) ? $order['billingAddress']['city'] : NULL, true);
add_post_meta($order_id, '_billing_postcode', isset($order['billingAddress']['postalCode']) ? $order['billingAddress']['postalCode'] : NULL, true);
add_post_meta($order_id, '_billing_country', isset($order['billingAddress']['country']) ? $order['billingAddress']['country'] : NULL, true);
add_post_meta($order_id, '_billing_state', isset($order['billingAddress']['state']) ? $order['billingAddress']['state'] : NULL, true);
add_post_meta($order_id, '_billing_phone', isset($order['billingAddress']['phone']) ? $order['billingAddress']['phone'] : NULL, true);
}
if (isset($order['deliveryAddress'])) {
add_post_meta($order_id, '_shipping_first_name', isset($order['deliveryAddress']['firstName']) ? $order['deliveryAddress']['firstName'] : NULL, true);
add_post_meta($order_id, '_shipping_last_name', isset($order['deliveryAddress']['lastName']) ? $order['deliveryAddress']['lastName'] : NULL, true);
add_post_meta($order_id, '_shipping_company', isset($order['deliveryAddress']['company']) ? $order['deliveryAddress']['company'] : NULL, true);
add_post_meta($order_id, '_shipping_address_1', isset($order['deliveryAddress']['street1']) ? $order['deliveryAddress']['street1'] : NULL, true);
add_post_meta($order_id, '_shipping_address_2', isset($order['deliveryAddress']['street2']) ? $order['deliveryAddress']['street2'] : NULL, true);
add_post_meta($order_id, '_shipping_city', isset($order['deliveryAddress']['city']) ? $order['deliveryAddress']['city'] : NULL, true);
add_post_meta($order_id, '_shipping_postcode', isset($order['deliveryAddress']['postalCode']) ? $order['deliveryAddress']['postalCode'] : NULL, true);
add_post_meta($order_id, '_shipping_country', isset($order['deliveryAddress']['country']) ? $order['deliveryAddress']['country'] : NULL, true);
add_post_meta($order_id, '_shipping_state', isset($order['deliveryAddress']['state']) ? $order['deliveryAddress']['state'] : NULL, true);
}
if (isset($order['primary_email'])) {
require_once ABSPATH . 'wp-includes/user.php';
require_once ABSPATH . 'wp-includes/pluggable.php';
$user_email = $order['primary_email'];
$user_name = $order['billingAddress']['firstName'] . ' ' . $order['billingAddress']['lastName'];
$user_id = email_exists($user_email);
$email_password = false;
if (!$user_id) {
$user_password = wp_generate_password(12, false);
$user_id = wp_create_user($user_name, $user_password, $user_email);
update_user_option($user_id, 'default_password_nag', true, true);
$email_password = true;
$message = " Username: {$user_name}\n Password: {$user_password}\n " . wp_login_url();
if (isset($order['billingAddress'])) {
add_user_meta($user_id, 'billing_first_name', isset($order['billingAddress']['firstName']) ? $order['billingAddress']['firstName'] : NULL, true);
add_user_meta($user_id, 'billing_last_name', isset($order['billingAddress']['lastName']) ? $order['billingAddress']['lastName'] : NULL, true);
add_user_meta($user_id, 'billing_company', isset($order['billingAddress']['company']) ? $order['billingAddress']['company'] : NULL, true);
add_user_meta($user_id, 'billing_address_1', isset($order['billingAddress']['street1']) ? $order['billingAddress']['street1'] : NULL, true);
add_user_meta($user_id, 'billing_address_2', isset($order['billingAddress']['street2']) ? $order['billingAddress']['street2'] : NULL, true);
add_user_meta($user_id, 'billing_city', isset($order['billingAddress']['city']) ? $order['billingAddress']['city'] : NULL, true);
add_user_meta($user_id, 'billing_postcode', isset($order['billingAddress']['postalCode']) ? $order['billingAddress']['postalCode'] : NULL, true);
add_user_meta($user_id, 'billing_country', isset($order['billingAddress']['country']) ? $order['billingAddress']['country'] : NULL, true);
add_user_meta($user_id, 'billing_state', isset($order['billingAddress']['state']) ? $order['billingAddress']['state'] : NULL, true);
add_user_meta($user_id, 'billing_phone', isset($order['billingAddress']['phone']) ? $order['billingAddress']['phone'] : NULL, true);
}
if (isset($order['deliveryAddress'])) {
add_user_meta($user_id, 'shipping_first_name', isset($order['deliveryAddress']['firstName']) ? $order['deliveryAddress']['firstName'] : NULL, true);
add_user_meta($user_id, 'shipping_last_name', isset($order['deliveryAddress']['lastName']) ? $order['deliveryAddress']['lastName'] : NULL, true);
add_user_meta($user_id, 'shipping_company', isset($order['deliveryAddress']['company']) ? $order['deliveryAddress']['company'] : NULL, true);
add_user_meta($user_id, 'shipping_address_1', isset($order['deliveryAddress']['street1']) ? $order['deliveryAddress']['street1'] : NULL, true);
//.........这里部分代码省略.........
示例12: wcpgsk_payments_form
function wcpgsk_payments_form()
{
global $post;
//, $woo;
$postPayments = get_metadata('post', $post->ID, 'payment_gateways', false);
$woogate = new WC_Payment_Gateways();
$payments = $woogate->payment_gateways();
//get_available_payment_gateways();
foreach ($payments as $pay) {
$checked = '';
if (in_array($pay->id, $postPayments)) {
$checked = ' checked="yes" ';
}
?>
<input type="checkbox" <?php
echo $checked;
?>
value="<?php
echo $pay->id;
?>
" name="pays[]" id="payments" />
<label for="payment_gateway_meta_box_text"><?php
echo $pay->title;
?>
</label>
<br />
<?php
}
}
示例13: hocwp_wc_insert_order
function hocwp_wc_insert_order($data)
{
$post_id = hocwp_get_value_by_key($data, 'post_id');
if (hocwp_id_number_valid($post_id)) {
$post = get_post($post_id);
if (is_a($post, 'WP_Post') && 'product' == $post->post_type) {
$product = wc_get_product($post_id);
$variable_product = new WC_Product_Variable($product);
$variations = $variable_product->get_available_variations();
$variation_args = array();
$variation_id = null;
foreach ($variations as $variation) {
$variation_id = $variation['variation_id'];
$variation_args['variation'] = $variation['attributes'];
}
$name = hocwp_get_value_by_key($data, 'name');
$phone = hocwp_get_value_by_key($data, 'phone');
$email = hocwp_get_value_by_key($data, 'email');
$address = hocwp_get_value_by_key($data, 'address');
$message = hocwp_get_value_by_key($data, 'message');
$name = hocwp_sanitize_first_and_last_name($name);
$attributes = hocwp_get_value_by_key($data, 'attributes');
$addresses = array('first_name' => $name['first_name'], 'last_name' => $name['last_name'], 'email' => $email, 'phone' => $phone, 'address_1' => $address);
$args = array('customer_note' => $message, 'created_via' => 'programmatically');
if (is_user_logged_in()) {
$current = wp_get_current_user();
$args['customer_id'] = $current->ID;
}
$order = wc_create_order($args);
$gateway = WC_Payment_Gateways::instance();
$gateways = $gateway->get_available_payment_gateways();
if (hocwp_array_has_value($gateways)) {
$gateway = current($gateways);
$order->set_payment_method($gateway);
}
$order->set_address($addresses);
$order->set_address($addresses, 'shipping');
if (hocwp_array_has_value($attributes) && hocwp_id_number_valid($variation_id)) {
foreach ($attributes as $attribute) {
$attribute_name = hocwp_get_value_by_key($attribute, 'name');
$attribute_value = hocwp_get_value_by_key($attribute, 'value');
if (!empty($attribute_name) && !empty($attribute_value)) {
if (isset($variation_args['variation'][$attribute_name])) {
$variation_args['variation'][$attribute_name] = $attribute_value;
}
}
}
$variation_product = new WC_Product_Variation($variation_id);
$order->add_product($variation_product, 1, $variation_args);
} else {
$order->add_product($product);
}
$order->record_product_sales();
$order->calculate_totals();
$order->payment_complete();
return $order;
}
}
return false;
}
示例14: get_option
<?php
$LAIDKey = get_option('linksync_laid');
$testMode = get_option('linksync_test');
$apicall = new linksync_class($LAIDKey, $testMode);
$gatway = new WC_Payment_Gateways();
# Get Payment Types
for ($count_payment = 1; $count_payment <= 3; $count_payment++) {
$payment = $apicall->linksync_getpaymentTypes();
if (isset($payment) && !empty($payment)) {
break;
}
}
# Get Taxes
for ($count_taxes = 1; $count_taxes <= 3; $count_taxes++) {
$taxes = $apicall->linksync_getTaxes();
if (isset($taxes) && !empty($taxes)) {
break;
}
}
#Get Order Status
for ($count_order_Status = 1; $count_order_Status <= 3; $count_order_Status++) {
$order_Status = $apicall->linksync_get_order_statuses();
if (isset($order_Status) && !empty($order_Status)) {
break;
}
}
if (isset($_POST['save_order_sync_setting'])) {
//Woocommers To VEND
if (isset($_POST['order_sync_type']) && !empty($_POST['order_sync_type'])) {
update_option('order_sync_type', $_POST['order_sync_type']);
示例15: register_woocommerce_advanced_accounting_settings
/**
* WooCommerce Fortnox General Settings
*
* @access public
* @param void
* @return void
*/
function register_woocommerce_advanced_accounting_settings()
{
$this->plugin_settings_tabs[$this->advanced_accounting_key] = 'Avancerade Bokföringsinställningar';
$pg = new WC_Payment_Gateways();
$payment_gateways = $pg->get_available_payment_gateways();
register_setting($this->advanced_accounting_key, $this->advanced_accounting_key);
add_settings_section('section_general', 'Avancerade Bokföringsinställningar', array(&$this, 'section_freight_desc'), $this->advanced_accounting_key);
foreach ($payment_gateways as $payment_gateway) {
logthis($payment_gateway->enabled);
//add_settings_field( 'woocommerce-fortnox-api-key', 'API Nyckel', array( &$this, 'field_hidden_option_text' ), $this->general_settings_key, 'section_general', array ( 'tab_key' => $this->general_settings_key, 'key' => 'api-key', 'desc' => '') );
if ($payment_gateway->enabled == 'yes') {
add_settings_field('woocommerce-fortnox-advanced-accounting-' . $payment_gateway->id, $payment_gateway->title, array(&$this, 'field_option_text'), $this->advanced_accounting_key, 'section_general', array('tab_key' => $this->advanced_accounting_key, 'key' => $payment_gateway->id, 'desc' => ''));
}
}
add_settings_field('woocommerce-fortnox-product-sales-account-25', 'Bokföringskonto försäljning 25% Moms', array(&$this, 'field_option_text'), $this->advanced_accounting_key, 'section_general', array('tab_key' => $this->advanced_accounting_key, 'key' => 'product_sales_account_25', 'desc' => ''));
add_settings_field('woocommerce-fortnox-product-sales-account-12', 'Bokföringskonto försäljning 12% Moms', array(&$this, 'field_option_text'), $this->advanced_accounting_key, 'section_general', array('tab_key' => $this->advanced_accounting_key, 'key' => 'product_sales_account_12', 'desc' => ''));
add_settings_field('woocommerce-fortnox-product-sales-account-6', 'Bokföringskonto försäljning 6% Moms', array(&$this, 'field_option_text'), $this->advanced_accounting_key, 'section_general', array('tab_key' => $this->advanced_accounting_key, 'key' => 'product_sales_account_6', 'desc' => ''));
add_settings_field('woocommerce-fortnox-product-eu-sales-account', 'Bokföringskonto försäljning EU', array(&$this, 'field_option_text'), $this->advanced_accounting_key, 'section_general', array('tab_key' => $this->advanced_accounting_key, 'key' => 'product_eu_sales_account', 'desc' => ''));
add_settings_field('woocommerce-fortnox-product-eu-sales-vat-account', 'Bokföringskonto Moms EU', array(&$this, 'field_option_text'), $this->advanced_accounting_key, 'section_general', array('tab_key' => $this->advanced_accounting_key, 'key' => 'product_eu_sales_vat_account', 'desc' => ''));
add_settings_field('woocommerce-fortnox-product-export-sales-account', 'Bokföringskonto försäljning export', array(&$this, 'field_option_text'), $this->advanced_accounting_key, 'section_general', array('tab_key' => $this->advanced_accounting_key, 'key' => 'product_export_sales_account', 'desc' => ''));
add_settings_field('woocommerce-fortnox-product-purchase-account', 'Bokföringskonto inköp', array(&$this, 'field_option_text'), $this->advanced_accounting_key, 'section_general', array('tab_key' => $this->advanced_accounting_key, 'key' => 'product_purchase_account', 'desc' => ''));
}