2013-08-22 10:58:03 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2018-04-12 10:13:01 +00:00
|
|
|
* WooCommerce Account Settings.
|
2013-08-22 10:58:03 +00:00
|
|
|
*
|
2018-04-12 10:13:01 +00:00
|
|
|
* @package WooCommerce/Admin
|
2013-08-22 10:58:03 +00:00
|
|
|
*/
|
|
|
|
|
2018-04-12 10:13:01 +00:00
|
|
|
defined( 'ABSPATH' ) || exit;
|
2013-08-22 10:58:03 +00:00
|
|
|
|
2018-04-12 15:59:42 +00:00
|
|
|
if ( class_exists( 'WC_Settings_Accounts', false ) ) {
|
|
|
|
return new WC_Settings_Accounts();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WC_Settings_Accounts.
|
|
|
|
*/
|
|
|
|
class WC_Settings_Accounts extends WC_Settings_Page {
|
2013-08-22 10:58:03 +00:00
|
|
|
|
|
|
|
/**
|
2018-04-12 15:59:42 +00:00
|
|
|
* Constructor.
|
2013-08-22 10:58:03 +00:00
|
|
|
*/
|
2018-04-12 15:59:42 +00:00
|
|
|
public function __construct() {
|
|
|
|
$this->id = 'account';
|
|
|
|
$this->label = __( 'Accounts & Privacy', 'woocommerce' );
|
|
|
|
parent::__construct();
|
2013-08-22 10:58:03 +00:00
|
|
|
}
|
|
|
|
|
2018-04-12 15:59:42 +00:00
|
|
|
/**
|
|
|
|
* Get settings array.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function get_settings() {
|
|
|
|
$settings = apply_filters(
|
|
|
|
'woocommerce_' . $this->id . '_settings', array(
|
|
|
|
array(
|
|
|
|
'title' => '',
|
|
|
|
'type' => 'title',
|
|
|
|
'id' => 'account_registration_options',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => __( 'Guest checkout', 'woocommerce' ),
|
|
|
|
'desc' => __( 'Allow customers to place orders without an account.', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_enable_guest_checkout',
|
|
|
|
'default' => 'yes',
|
|
|
|
'type' => 'checkbox',
|
|
|
|
'checkboxgroup' => 'start',
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => __( 'Login', 'woocommerce' ),
|
|
|
|
'desc' => __( 'Allow customers to log into an existing account during checkout', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_enable_checkout_login_reminder',
|
|
|
|
'default' => 'yes',
|
|
|
|
'type' => 'checkbox',
|
|
|
|
'checkboxgroup' => 'end',
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => __( 'Account creation', 'woocommerce' ),
|
|
|
|
'desc' => __( 'Allow customers to create an account during checkout.', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_enable_signup_and_login_from_checkout',
|
|
|
|
'default' => 'yes',
|
|
|
|
'type' => 'checkbox',
|
|
|
|
'checkboxgroup' => 'start',
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'desc' => __( 'Allow customers to create an account on the "My account" page.', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_enable_myaccount_registration',
|
|
|
|
'default' => 'no',
|
|
|
|
'type' => 'checkbox',
|
|
|
|
'checkboxgroup' => '',
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'desc' => __( 'When creating an account, automatically generate a username from the customer\'s email address.', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_registration_generate_username',
|
|
|
|
'default' => 'yes',
|
|
|
|
'type' => 'checkbox',
|
|
|
|
'checkboxgroup' => '',
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'desc' => __( 'When creating an account, automatically generate an account password.', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_registration_generate_password',
|
|
|
|
'default' => 'no',
|
|
|
|
'type' => 'checkbox',
|
|
|
|
'checkboxgroup' => 'end',
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'type' => 'sectionend',
|
|
|
|
'id' => 'account_registration_options',
|
|
|
|
),
|
2018-04-17 10:45:24 +00:00
|
|
|
array(
|
|
|
|
'title' => __( 'Personal data cleanup', 'woocommerce' ),
|
|
|
|
'desc' => __( 'These tools let you clean up personal data when it\'s no longer needed for processing.', 'woocommerce' ),
|
|
|
|
'type' => 'title',
|
|
|
|
'id' => 'order_cleanup_options',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => __( 'Trash pending orders after: ', 'woocommerce' ),
|
|
|
|
'desc_tip' => __( 'Automatically trash orders with this status after a certain period of time. Leave blank to disable.', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_trash_pending_orders',
|
|
|
|
'type' => 'relative_time_selector',
|
|
|
|
'placeholder' => __( 'N/A', 'woocommerce' ),
|
|
|
|
'default' => array(
|
|
|
|
'number' => 30,
|
|
|
|
'unit' => 'days',
|
|
|
|
),
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => __( 'Trash failed orders after: ', 'woocommerce' ),
|
|
|
|
'desc_tip' => __( 'Automatically trash orders with this status after a certain period of time. Leave blank to disable.', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_trash_failed_orders',
|
|
|
|
'type' => 'relative_time_selector',
|
|
|
|
'placeholder' => __( 'N/A', 'woocommerce' ),
|
|
|
|
'default' => array(
|
|
|
|
'number' => 30,
|
|
|
|
'unit' => 'days',
|
|
|
|
),
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => __( 'Trash cancelled orders after: ', 'woocommerce' ),
|
|
|
|
'desc_tip' => __( 'Automatically trash orders with this status after a certain period of time. Leave blank to disable.', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_trash_cancelled_orders',
|
|
|
|
'type' => 'relative_time_selector',
|
|
|
|
'placeholder' => __( 'N/A', 'woocommerce' ),
|
|
|
|
'default' => array(
|
|
|
|
'number' => 30,
|
|
|
|
'unit' => 'days',
|
|
|
|
),
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => __( 'Anonymize completed guest orders after: ', 'woocommerce' ),
|
|
|
|
'desc_tip' => __( 'Remove personal data from guest orders after a certain period of time. Leave blank to disable.', 'woocommerce' ),
|
|
|
|
'id' => 'woocommerce_anonymize_completed_guest_orders',
|
|
|
|
'type' => 'relative_time_selector',
|
|
|
|
'placeholder' => __( 'N/A', 'woocommerce' ),
|
|
|
|
'default' => '',
|
|
|
|
'autoload' => false,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'type' => 'sectionend',
|
|
|
|
'id' => 'order_cleanup_options',
|
|
|
|
),
|
2018-04-12 15:59:42 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings );
|
|
|
|
}
|
|
|
|
}
|
2013-08-22 10:58:03 +00:00
|
|
|
|
2014-08-31 08:22:03 +00:00
|
|
|
return new WC_Settings_Accounts();
|