1)); } list($aieo_pn_open, $aieo_pn_close) = AIEO_DMM_UI::card(array( 'anchor' => 'product-needs-most-impactful-products-without-needs', 'icon' => 'zap', 'title' => __('Best sellers with no needs', 'ai-eshop-optimizer'), 'description' => __('A category says what a product is. A need says what it is FOR — dry skin, a gift, a first colour at home — and that is how people actually ask for things.', 'ai-eshop-optimizer'), 'flush' => true, )); echo $aieo_pn_open; ?> __('That gap matters more every month. Shoppers no longer only browse categories: they describe a problem, to your search box, to an on-site assistant, or to an AI that answers before they ever reach a shop. All three match on intent, and a product with no need attached has nothing for them to match against — however well it sells, and however good it is. It is not ranked lower; it is simply not a candidate.', 'ai-eshop-optimizer'), __('Where else do needs count?', 'ai-eshop-optimizer') => __('The same tags feed your own storefront filters and the recommendation engine, so one afternoon of tagging pays three times. Start at the top of the list below: it is ordered by what your untagged products actually sell, because an untagged best-seller costs far more than an untagged long-tail item.', 'ai-eshop-optimizer'), ) as $aieo_pn_ask => $aieo_pn_why) { echo class_exists('\Rooster\Admin\Guidance') ? \Rooster\Admin\Guidance::text($aieo_pn_why, 'guidance', array('question' => $aieo_pn_ask)) : '

' . esc_html($aieo_pn_why) . '

'; } ?> 0 ? 'warning' : 'mono', array('inline' => true)) : '

' . $aieo_pn_missing . '

'; echo $aieo_pn_missing; $aieo_pn_rows = array(); foreach ( $impactful as $aieo_pn_r ) { $aieo_pn_pid = (int) $aieo_pn_r['pid']; $aieo_pn_title = (string) $aieo_pn_r['title']; $aieo_pn_rows[] = array( 'pid' => $aieo_pn_pid, 'title' => '' !== $aieo_pn_title ? $aieo_pn_title : __( '— deleted —', 'ai-eshop-optimizer' ), 'sku' => (string) $aieo_pn_r['sku'], 'qty' => (int) $aieo_pn_r['qty'], 'turnover' => (float) $aieo_pn_r['turnover'], 'edit_link' => (string) $aieo_pn_r['edit_link'], 'select_link' => (string) $aieo_pn_r['select_link'], ); } AIEO_Table::render( array( 'page_id' => 'product_needs', 'row_key' => 'pid', 'rows' => $aieo_pn_rows, 'caps' => array( 'search' => true ), 'empty' => __( 'Every product with sales already has at least one need assigned. Nothing to action here.', 'ai-eshop-optimizer' ), 'columns' => array( array( 'key' => 'pid', 'label' => __( 'Product ID', 'ai-eshop-optimizer' ), 'type' => 'id', 'width' => '80px' ), array( 'key' => 'title', 'label' => __( 'Title', 'ai-eshop-optimizer' ), 'type' => 'link', 'format' => array( 'href' => 'edit_link', 'external' => true ), ), array( 'key' => 'sku', 'label' => __( 'SKU', 'ai-eshop-optimizer' ), 'type' => 'code' ), array( 'key' => 'qty', 'label' => __( 'Qty sold', 'ai-eshop-optimizer' ), 'type' => 'integer', 'width' => '120px' ), array( 'key' => 'turnover', 'label' => __( 'Turnover', 'ai-eshop-optimizer' ), 'type' => 'money', 'width' => '150px' ), ), 'actions' => array( array( 'id' => 'edit-needs', 'label' => __( 'Edit needs', 'ai-eshop-optimizer' ), 'description' => __( 'Opens the needs editor with this product.', 'ai-eshop-optimizer' ), 'class' => 'rooster-admin-button rooster-admin-button--secondary rooster-admin-button--sm', 'href' => static function ( $row ) { return $row['select_link']; }, ), ), ) ); echo $aieo_pn_close; if ($aieo_pn_band_close) { rooster_admin_band_close(); } if ($aieo_pn_band_open) { rooster_admin_band_open(array('cols' => 2)); } list($aieo_pn_open, $aieo_pn_close) = AIEO_DMM_UI::card(array( 'anchor' => 'product-needs-editor', 'icon' => 'pencil-line', 'title' => __('Product needs editor', 'ai-eshop-optimizer'), 'description' => __('Pick a product, then check off which needs it addresses. Drag the selected chips to reorder.', 'ai-eshop-optimizer'), )); echo $aieo_pn_open; ?> 0 && function_exists('wc_get_product')) { $aieo_pn_product = wc_get_product($preselect_pid); if ($aieo_pn_product) { $aieo_pn_option = ''; } } $aieo_pn_product_row = \Rooster\Admin\Ui::field_row(array( 'id' => 'aieo-dmm-needs-product', 'label' => __('Product', 'ai-eshop-optimizer'), 'control' => '', )); ?>
'product-needs-selected-needs', 'icon' => 'list-ordered', 'title' => __('Selected needs (drag to reorder)', 'ai-eshop-optimizer'), 'description' => __('The needs this product meets, in the order shoppers see them; drag one to move it.', 'ai-eshop-optimizer'), )); echo $aieo_pn_open; ?> 'aieo-dmm-needs-selected-empty', 'title' => __('No needs selected yet', 'ai-eshop-optimizer'), 'text' => __('Choose a product in the editor, then tick its needs below.', 'ai-eshop-optimizer'), 'compact' => true, )); ?>
true, 'sm' => true, 'attrs' => array('title' => $aieo_pn_badge_tip))) : '' . esc_html__('Internal', 'ai-eshop-optimizer') . ''; if ($aieo_pn_band_open) { rooster_admin_band_open(array('cols' => 1)); } list($aieo_pn_open, $aieo_pn_close) = AIEO_DMM_UI::card(array( 'anchor' => 'product-needs-available-needs', 'icon' => 'tags', 'title' => __('Available needs', 'ai-eshop-optimizer'), 'description' => __('Every need you have defined; pick the ones this product meets, or create a new one.', 'ai-eshop-optimizer'), 'tools' => '', 'footer' => '', )); echo $aieo_pn_open; ?> 'aieo-dmm-needs-create-name', 'label' => __('Name', 'ai-eshop-optimizer'), 'control' => $aieo_pn_ui::input('', '', array('id' => 'aieo-dmm-needs-create-name', 'medium' => true, 'placeholder' => __('e.g. Anti-frizz', 'ai-eshop-optimizer'))), )) . $aieo_pn_ui::field_row(array( 'id' => 'aieo-dmm-needs-create-slug', 'label' => sprintf('%1$s (%2$s)', __('Slug', 'ai-eshop-optimizer'), __('optional', 'ai-eshop-optimizer')), 'control' => $aieo_pn_ui::input('', '', array('id' => 'aieo-dmm-needs-create-slug', 'medium' => true, 'code' => true, 'placeholder' => __('auto', 'ai-eshop-optimizer'))), )); $aieo_pn_internal = $aieo_pn_ui::field_row(array( 'id' => 'aieo-dmm-needs-create-hidden', 'label' => __('Internal', 'ai-eshop-optimizer'), 'control' => '', )); $aieo_pn_search = $aieo_pn_ui::input('', '', array('id' => 'aieo-dmm-needs-search', 'type' => 'search', 'medium' => true, 'icon' => 'search', 'autocomplete' => 'off', 'aria-label' => __('Search needs by name or slug…', 'ai-eshop-optimizer'), 'placeholder' => __('Search needs by name or slug…', 'ai-eshop-optimizer'))); $aieo_pn_empty = \Rooster\Admin\States::state('first-use', array( 'id' => 'aieo-dmm-needs-empty', 'title' => __('No needs yet', 'ai-eshop-optimizer'), 'text' => __('Create the first one, then tick it on a product.', 'ai-eshop-optimizer'), 'action' => $aieo_pn_ui::button(__('New need', 'ai-eshop-optimizer'), array('icon' => 'plus', 'attrs' => array('data-aieo-needs-open' => ''))), )); ?>