'insights_variations_stock', 'label' => 'Out of stock variations', 'description' => 'Variable products with at least one variation out of stock, worst first, so half-empty products stand out before they read as dead.', 'footnote' => 'Counts come from the shop\'s own stock status, recomputed nightly; products whose variations are all in stock are not listed. "Last sold" is the newest real order line for the product and is blank for products that have never sold. A variation on backorder counts in neither the in-stock nor the out-of-stock column.', 'group' => 'eshop_insights', 'section' => 'stock_management', 'icon' => 'layers', 'tier' => 'pro', 'scope' => 'both', 'source' => 'table', 'table' => '{prefix}aieo_variations_stock_condition', 'base_where' => 'pct_out_of_stock > 0', 'registry_id' => 'insights_t26.out_of_stock_variations', 'version' => '1', 'per_page' => 50, 'row_key' => 'id', 'default_sort' => array( 'pct_out_of_stock', 'desc' ), 'requires_hpos' => true, 'empty_state' => 'No variable product has an out-of-stock variation right now. This recomputes nightly from live stock.', 'filter_bar' => array( 'first' => array( 'brand', 'menu_category', 'sub_category', 'pct_out_of_stock' ) ), 'actions' => array( array( 'id' => 'edit', 'label' => 'Edit', 'intent' => array( 'name' => 'edit_product', 'key' => 'product_id' ), 'capability' => 'edit_products', ), ), 'columns' => array( array( 'key' => 'id', 'label' => 'ID', 'type' => 'id', 'hidden' => true, ), array( 'key' => 'image_url', 'label' => '', 'sr_label' => 'Product image', 'type' => 'image', 'format' => array( 'size' => 44, 'rehost' => true ), 'width' => '58px', 'sortable' => false, 'empty' => '', ), array( 'key' => 'name', 'label' => 'Product', 'type' => 'text', 'sortable' => true, 'searchable' => true, 'filter' => 'text', 'truncate' => 48, 'tooltip' => true, ), array( 'key' => 'brand', 'label' => 'Brand', 'type' => 'text', 'sortable' => true, 'filter' => 'select', ), array( 'key' => 'menu_category', 'label' => 'Menu category', 'type' => 'text', 'sortable' => true, 'filter' => 'select', ), array( 'key' => 'sub_category', 'label' => 'Category', 'type' => 'text', 'sortable' => true, 'filter' => 'select', ), array( 'key' => 'total_variations', 'label' => 'Variations', 'type' => 'integer', 'sortable' => true, 'aggregate' => 'SUM', ), array( 'key' => 'instock_variations', 'label' => 'In stock', 'type' => 'integer', 'sortable' => true, 'aggregate' => 'SUM', ), array( 'key' => 'out_of_stock_variations', 'label' => 'Out of stock', 'type' => 'integer', 'sortable' => true, 'filter' => 'number_range', 'aggregate' => 'SUM', ), array( 'key' => 'pct_out_of_stock', 'label' => 'Out of stock %', 'type' => 'percent', 'format' => array( 'precision' => 1 ), 'sortable' => true, 'filter' => 'number_range', 'bands' => array( array( 'min' => 100, 'tone' => 'danger' ), array( 'min' => 50, 'tone' => 'warning' ), ), ), array( 'key' => 'latest_sale_gmt', 'label' => 'Last sold', 'type' => 'datetime', 'format' => array( 'tz' => 'utc' ), 'sortable' => true, 'filter' => 'date_range', 'empty' => '—', ), array( 'key' => 'product_id', 'label' => 'Product ID', 'type' => 'id', 'hidden' => true, ), array( 'key' => 'created', 'label' => 'Built', 'type' => 'datetime', 'format' => array( 'tz' => 'utc' ), 'hidden' => true, ), ), );