| @@ -28,8 +28,17 @@ | ||
| 28 | 28 | */ |
| 29 | 29 | public static $is_module_preview = false; |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | + * Initialize the module's option group definitions. | |
| 33 | + * | |
| 34 | + * @return array<int, array<string, mixed>> Array of option group arrays. | |
| 35 | + */ | |
| 36 | + protected function init_option_groups() { | |
| 37 | + return require MERCHANT_DIR . 'inc/modules/' . self::MODULE_ID . '/admin/options.php'; | |
| 38 | + } | |
| 39 | + | |
| 40 | + /** | |
| 32 | 41 | * Constructor. |
| 33 | 42 | * |
| 34 | 43 | */ |
| 35 | 44 | public function __construct() { |
| @@ -51,22 +60,21 @@ | ||
| 51 | 60 | 'text' => __( 'Size Chart', 'merchant' ), |
| 52 | 61 | 'icon' => 'icon-size-chart', |
| 53 | 62 | ); |
| 54 | 63 | |
| 55 | - // Mount preview url. | |
| 56 | - $preview_url = site_url( '/' ); | |
| 64 | + // Module data. | |
| 65 | + $this->module_data = Merchant_Admin_Modules::$modules_data[ self::MODULE_ID ]; | |
| 57 | 66 | |
| 58 | - if ( function_exists( 'wc_get_products' ) ) { | |
| 59 | - $products = wc_get_products( array( 'limit' => 1 ) ); | |
| 60 | - | |
| 61 | - if ( ! empty( $products ) && ! empty( $products[0] ) ) { | |
| 62 | - $preview_url = get_permalink( $products[0]->get_id() ); | |
| 63 | - } | |
| 64 | - } | |
| 65 | - | |
| 66 | - // Module data. | |
| 67 | - $this->module_data = Merchant_Admin_Modules::$modules_data[ self::MODULE_ID ]; | |
| 68 | - $this->module_data['preview_url'] = $preview_url; | |
| 67 | + // AI prompt examples. | |
| 68 | + $this->ai_examples = array( | |
| 69 | + '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' ), | |
| 70 | + 'prompts' => array( | |
| 71 | + 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' ), | |
| 72 | + 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' ), | |
| 73 | + esc_html__( 'Look at your available WPVibe abilities, then assign the Footwear size chart to every product in the Shoes category', 'merchant' ), | |
| 74 | + esc_html__( 'See what abilities WPVibe exposes, then change the size chart button label from \'Size Chart\' to \'Find My Fit\'', 'merchant' ), | |
| 75 | + ), | |
| 76 | + ); | |
| 69 | 77 | |
| 70 | 78 | // Module options path. |
| 71 | 79 | $this->module_options_path = MERCHANT_DIR . 'inc/modules/' . self::MODULE_ID . '/admin/options.php'; |
| 72 | 80 | |