> Array of option group arrays. */ protected function init_option_groups() { return require MERCHANT_DIR . 'inc/modules/' . self::MODULE_ID . '/admin/options.php'; } /** * Constructor. * */ public function __construct() { // Module id. $this->module_id = self::MODULE_ID; // WooCommerce only. $this->wc_only = true; // Parent construct. parent::__construct(); // Module section. $this->module_section = 'improve-experience'; // Module default settings. $this->module_default_settings = array( 'global_size_chart' => '', 'text' => __( 'Size Chart', 'merchant' ), 'icon' => 'icon-size-chart', ); // Module data. $this->module_data = Merchant_Admin_Modules::$modules_data[ self::MODULE_ID ]; // AI prompt examples. $this->ai_examples = array( 'blurb' => esc_html__( 'See what AI can do for your size charts, from building a new one to assigning it to the right products and categories.', 'merchant' ), 'prompts' => array( esc_html__( 'Explore the abilities WPVibe gives you access to, then create a Footwear size chart with US, EU, and UK columns covering shoe sizes 5 through 12', 'merchant' ), esc_html__( 'Check what abilities you have available through WPVibe, then add a Women\'s Sizing tab to the Footwear size chart and a short fit-guide description below it', 'merchant' ), esc_html__( 'Look at your available WPVibe abilities, then assign the Footwear size chart to every product in the Shoes category', 'merchant' ), esc_html__( 'See what abilities WPVibe exposes, then change the size chart button label from \'Size Chart\' to \'Find My Fit\'', 'merchant' ), ), ); // Module options path. $this->module_options_path = MERCHANT_DIR . 'inc/modules/' . self::MODULE_ID . '/admin/options.php'; // Is module preview page. if ( is_admin() && parent::is_module_settings_page() ) { self::$is_module_preview = true; // Enqueue admin styles. add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_css' ) ); // Enqueue admin scripts. add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); // Render module essencial instructions before the module page body content. add_action( 'merchant_admin_after_module_page_page_header', array( $this, 'admin_module_essencial_instructions' ) ); // Admin preview box. add_filter( 'merchant_module_preview', array( $this, 'render_admin_preview' ), 10, 2 ); // Custom CSS. // The custom CSS should be added here as well due to ensure preview box works properly. add_filter( 'merchant_custom_css', array( $this, 'admin_custom_css' ) ); } if ( Merchant_Modules::is_module_active( self::MODULE_ID ) && is_admin() ) { // Init translations. $this->init_translations(); } } /** * Init translations. * * @return void */ public function init_translations() { $settings = $this->get_module_settings(); if ( ! empty( $settings['text'] ) ) { Merchant_Translator::register_string( $settings['text'], esc_html__( 'Size chart: label text', 'merchant' ) ); } } /** * Admin enqueue CSS. * * @return void */ public function admin_enqueue_css() { if ( parent::is_module_settings_page() ) { wp_enqueue_style( 'merchant-' . self::MODULE_ID, MERCHANT_URI . 'assets/css/modules/' . self::MODULE_ID . '/size-chart.min.css', array(), MERCHANT_VERSION ); wp_enqueue_style( 'merchant-admin-' . self::MODULE_ID, MERCHANT_URI . 'assets/css/modules/' . self::MODULE_ID . '/admin/preview.min.css', array(), MERCHANT_VERSION ); } } /** * Admin Enqueue scripts. * * @return void */ public function admin_enqueue_scripts() { // Register and enqueue the main module script. wp_enqueue_script( 'merchant-' . self::MODULE_ID, MERCHANT_URI . 'assets/js/modules/' . self::MODULE_ID . '/size-chart.min.js', array(), MERCHANT_VERSION, true ); } /** * Render module essencial instructions. * * @return void */ public function admin_module_essencial_instructions() { ?>

%s', esc_url( admin_url( 'edit.php?post_type=product' ) ), esc_html__( 'View All Products', 'merchant' ) ); ?>

set_html( $content ); // Label Text. $preview->set_text( 'text', '.merchant-product-size-chart-button span' ); // Icon. $preview->set_svg_icon( 'icon', '.size-chart-icon' ); } return $preview; } /** * Admin preview content. * * @return void */ public function admin_preview_content() { $settings = $this->get_module_settings(); ?>
3 35 5
4 36 6
5 37 7
6 38 8
7 39 9

Lorem ipsum dolor sit a met, dont dolor sit a la quat.

get_module_custom_css(); return $css; } } // Initialize the module. add_action( 'init', function () { Merchant_Modules::create_module( new Merchant_Size_Chart() ); } );