mirror of
https://github.com/woodchen-ink/czlexpress-for-woocommerce.git
synced 2025-07-18 22:11:58 +08:00
- Renamed the plugin from "woocommerce-czlexpress" to "CZL Express for WooCommerce" for better branding. - Updated README and readme.txt files to reflect the new plugin name and improved description. - Enhanced system requirements to support PHP 8.0 and tested compatibility with WordPress 6.7. - Removed outdated files and references, including the main plugin file and language files. - Improved localization by updating text domain references throughout the codebase. - Streamlined the admin interface for better usability, including updated labels and descriptions. These changes enhance the clarity, performance, and user experience of the CZL Express plugin.
55 lines
1.8 KiB
PHP
55 lines
1.8 KiB
PHP
<?php
|
|
class CZL_Settings {
|
|
private static $instance = null;
|
|
|
|
public static function instance() {
|
|
if (is_null(self::$instance)) {
|
|
self::$instance = new self();
|
|
}
|
|
return self::$instance;
|
|
}
|
|
|
|
public function __construct() {
|
|
add_action('admin_init', array($this, 'register_settings'));
|
|
}
|
|
|
|
public function register_settings() {
|
|
register_setting('czl_options_group', 'czl_api_url');
|
|
register_setting('czl_options_group', 'czl_username');
|
|
register_setting('czl_options_group', 'czl_password');
|
|
register_setting('czl_options_group', 'czl_exchange_rate');
|
|
register_setting('czl_options_group', 'czl_product_groups');
|
|
}
|
|
|
|
public function get_settings_fields() {
|
|
return array(
|
|
'basic' => array(
|
|
array(
|
|
'name' => 'czl_api_url',
|
|
'label' => __('API URL', 'czlexpress-for-woocommerce'),
|
|
'type' => 'text',
|
|
'default' => '',
|
|
),
|
|
array(
|
|
'name' => 'czl_username',
|
|
'label' => __('Username', 'czlexpress-for-woocommerce'),
|
|
'type' => 'text',
|
|
'default' => '',
|
|
),
|
|
array(
|
|
'name' => 'czl_password',
|
|
'label' => __('Password', 'czlexpress-for-woocommerce'),
|
|
'type' => 'password',
|
|
'default' => '',
|
|
),
|
|
array(
|
|
'name' => 'czl_exchange_rate',
|
|
'label' => __('Exchange Rate', 'czlexpress-for-woocommerce'),
|
|
'type' => 'number',
|
|
'default' => '1',
|
|
'step' => '0.0001',
|
|
),
|
|
)
|
|
);
|
|
}
|
|
}
|