1)); }
list($aieo_wl_open, $aieo_wl_close) = AIEO_DMM_UI::card(array(
'anchor' => 'waitlist-subscribers',
'icon' => 'bell',
'title' => __('Active subscriptions', 'ai-eshop-optimizer') . ' (' . (int) $total . ')',
'description' => __('Every active subscription. Notified rows stay so you can see the historical demand for each product.', 'ai-eshop-optimizer'),
'flush' => true,
));
echo $aieo_wl_open;
$display_url = add_query_arg(array(
'page' => AIEO_DMM::MENU_SLUG,
'dmm_tab' => 'waitlist_display',
), admin_url('admin.php'));
$aieo_wl_pointer = wp_kses_post(sprintf(
__('Looking for the waitlist form copy + restock email template? They now live under %1$sVisual Display → Waitlist Display%2$s.', 'ai-eshop-optimizer'),
'',
''
));
echo \Rooster\Admin\Ui::notice($aieo_wl_pointer, 'mono', array('inline' => true));
?>
id; }, (array) $subscribers))
: array();
foreach ((array) $subscribers as $sub) {
$aieo_wl_vid = (int) $sub->variation_id;
$aieo_wl_shade = $aieo_wl_vid > 0 ? AIEO_DMM_Waitlist_Box::shade_name($aieo_wl_vid) : '';
$aieo_wl_rows[] = array(
'id' => (int) $sub->id,
'email' => (string) $sub->email,
'product' => get_the_title((int) $sub->product_id) ?: '#' . (int) $sub->product_id,
'edit_url' => admin_url('post.php?post=' . (int) $sub->product_id . '&action=edit'),
'pid' => '#' . (int) $sub->product_id,
'variation' => $aieo_wl_shade,
'vid' => $aieo_wl_vid > 0 && '#' . $aieo_wl_vid !== $aieo_wl_shade ? '#' . $aieo_wl_vid : '',
'status' => (string) $sub->status,
'created' => (string) $sub->created_at,
'notified' => (string) $sub->notified_at,
'lead' => isset($aieo_wl_leads[(int) $sub->id]) ? __('Campaign and journey', 'ai-eshop-optimizer') : '',
'lead_url' => isset($aieo_wl_leads[(int) $sub->id]) ? AIEO_Submission_Panel::url($aieo_wl_leads[(int) $sub->id]) : '',
);
}
if (0 === (int) $total) {
\Rooster\Admin\States::enqueue();
$aieo_wl_first = \Rooster\Admin\States::state('first-use', array(
'title' => __('No subscribers yet.', 'ai-eshop-optimizer'),
'text' => __('Shoppers who ask to be told when an out-of-stock product is back appear here.', 'ai-eshop-optimizer'),
));
echo $aieo_wl_first;
} else {
AIEO_Table::render(array(
'page_id' => 'waitlist',
'row_key' => 'id',
'rows' => $aieo_wl_rows,
'sortable' => false,
'empty' => __('No subscribers yet.', 'ai-eshop-optimizer'),
'columns' => array(
array('key' => 'email', 'label' => __('Email', 'ai-eshop-optimizer')),
array('key' => 'product', 'label' => __('Product', 'ai-eshop-optimizer'), 'type' => 'link', 'format' => array('href' => 'edit_url'), 'suffix' => 'pid'),
array('key' => 'variation', 'label' => __('Variation', 'ai-eshop-optimizer'), 'suffix' => 'vid'),
array(
'key' => 'status',
'label' => __('Status', 'ai-eshop-optimizer'),
'type' => 'badge',
'format' => array('map' => array('notified' => 'success', 'subscribed' => 'warning')),
),
array('key' => 'created', 'label' => __('Subscribed', 'ai-eshop-optimizer'), 'nowrap' => true),
array('key' => 'notified', 'label' => __('Notified', 'ai-eshop-optimizer'), 'nowrap' => true),
array('key' => 'lead', 'label' => __('Campaign', 'ai-eshop-optimizer'), 'type' => 'link', 'format' => array('href' => 'lead_url')),
),
'actions' => array(
array('id' => 'delete', 'label' => __('Delete', 'ai-eshop-optimizer'), 'class' => 'button button-small aieo-dmm-waitlist-delete', 'data' => array('ra-confirm' => 'aieo-wl-delete-ask')),
),
));
$aieo_wl_ask = \Rooster\Admin\States::confirm(
'aieo-wl-delete-ask',
'delete',
__('Delete this subscriber?', 'ai-eshop-optimizer'),
esc_html__('They are not told when the product is back in stock. This cannot be undone.', 'ai-eshop-optimizer'),
array('confirm' => __('Delete subscriber', 'ai-eshop-optimizer'))
);
echo $aieo_wl_ask;
}
?>
1) :
$base_url = add_query_arg(array('page' => 'ai-eshop-dmm', 'dmm_tab' => 'waitlist'), admin_url('admin.php'));
$aieo_wl_page_url = static function ($n) use ($base_url) {
return add_query_arg('waitlist_paged', (int) $n, $base_url);
};
$aieo_wl_pager = \Rooster\Admin\Ui::pager((int) $current_page, $pages, $aieo_wl_page_url, array('total' => (int) $total, 'label' => __('Subscriber pages', 'ai-eshop-optimizer')));
echo $aieo_wl_pager;
endif;
?>