WooCommerce -> Woo Viet * * @author htdat * @since 1.0 * */ class WooViet_Admin_Page { /** * @var string The message to display after saving settings */ var $message = ''; /** * WooViet_Admin_Page constructor. */ public function __construct() { // Catch and run the save_settings() action if ( isset( $_REQUEST['wooviet_nonce'] ) && isset ( $_REQUEST['action'] ) && 'wooviet_save_settings' == $_REQUEST['action'] ) { $this->save_settings(); } add_action( 'admin_menu', array( $this, 'register_submenu_page' ) ); } /** * Save settings for the plugin */ public function save_settings() { if ( wp_verify_nonce( $_REQUEST['wooviet_nonce'], 'wooviet_save_settings' ) ) { update_option( 'woo-viet', $this->sanitize_settings( $_REQUEST['settings'] ) ); $this->message = '

' . __( 'Settings saved', 'woo-viet' ) . '

'; } else { $this->message = '

' . __( 'Can not save settings! Please refresh this page.', 'woo-viet' ) . '

'; } } /** * Register the sub-menu under "WooCommerce" * Link: http://my-site.com/wp-admin/admin.php?page=woo-viet */ public function register_submenu_page() { add_submenu_page( 'woocommerce', __( 'Woo Viet Settings', 'woo-viet' ), 'Woo Viet', 'manage_options', 'woo-viet', array( $this, 'admin_page_html' ) ); } /** * Generate the HTML code of the settings page */ public function admin_page_html() { // check user capabilities if ( ! current_user_can( 'manage_options' ) ) { return; } $settings = WooViet::get_settings(); ?>

message ?>
>

>

>

>
>

000 of prices to K (or anything)', 'woo-viet' ) ?> >

the PayPal Standard gateway', 'woo-viet' ), 'https://docs.woocommerce.com/document/paypal-standard/' ) ?> >



the PayPal Express Checkout gateway', 'woo-viet' ), 'https://docs.woocommerce.com/document/paypal-express-checkout/' ) ?> >